-
Notifications
You must be signed in to change notification settings - Fork 133
Expand file tree
/
Copy pathTablegenMain.cpp
More file actions
35 lines (30 loc) · 1.17 KB
/
TablegenMain.cpp
File metadata and controls
35 lines (30 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "lib/Tablegen/CompilationTargetEmitter.h"
#include "llvm/include/llvm/Support/CommandLine.h" // from @llvm-project
#include "llvm/include/llvm/Support/InitLLVM.h" // from @llvm-project
#include "llvm/include/llvm/TableGen/Main.h" // from @llvm-project
#include "llvm/include/llvm/TableGen/Record.h" // from @llvm-project
using namespace mlir;
using namespace heir;
enum ActionType {
None,
GenCompilationTargetRegistration,
};
static llvm::cl::opt<ActionType> action(
llvm::cl::desc("Action to perform:"),
llvm::cl::values(clEnumValN(GenCompilationTargetRegistration,
"gen-compilation-target-registration",
"Generate compilation target registration")));
bool heirTableGenMain(llvm::raw_ostream& os,
const llvm::RecordKeeper& records) {
switch (action) {
case GenCompilationTargetRegistration:
return emitCompilationTargetRegistration(records, os);
default:
return false;
}
}
int main(int argc, char** argv) {
llvm::InitLLVM y(argc, argv);
llvm::cl::ParseCommandLineOptions(argc, argv);
return llvm::TableGenMain(argv[0], &heirTableGenMain);
}