[Intermediate Representation] Added skeleton
This commit is contained in:
@@ -1,10 +1,6 @@
|
||||
#include <cstring>
|
||||
#include <cstdio>
|
||||
#include "ast.h"
|
||||
#include "codegen.h"
|
||||
#include "llvm/IR/IRPrintingPasses.h"
|
||||
#include "llvm/IR/LegacyPassManager.h"
|
||||
#include "llvm/IR/PassManager.h"
|
||||
|
||||
typedef struct yy_buffer_state * YY_BUFFER_STATE;
|
||||
extern int yyparse();
|
||||
@@ -29,12 +25,12 @@ int main() {
|
||||
YY_BUFFER_STATE buffer = yy_scan_string(src);
|
||||
yyparse();
|
||||
yy_delete_buffer(buffer);
|
||||
translation_unit *program = ast_root;
|
||||
tdl::context context;
|
||||
tdl::module module("matrix", &context);
|
||||
program->codegen(&module);
|
||||
llvm::PrintModulePass print(llvm::outs());
|
||||
llvm::AnalysisManager<llvm::Module> analysis;
|
||||
print.run(*module.handle(), analysis);
|
||||
// translation_unit *program = ast_root;
|
||||
// tdl::context context;
|
||||
// tdl::module module("matrix", &context);
|
||||
// program->codegen(&module);
|
||||
// llvm::PrintModulePass print(llvm::outs());
|
||||
// llvm::AnalysisManager<llvm::Module> analysis;
|
||||
// print.run(*module.handle(), analysis);
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user