[Code generation] Prototype for phi node
This commit is contained in:
@@ -2,6 +2,9 @@
|
||||
#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();
|
||||
@@ -14,6 +17,8 @@ const char src[] =
|
||||
"\
|
||||
void test(fp32 *A, fp32 *B, fp32 *C){\
|
||||
int32 i = 0;\
|
||||
int32 j = 1;\
|
||||
i = i + j;\
|
||||
}\
|
||||
";
|
||||
|
||||
@@ -25,5 +30,8 @@ int main() {
|
||||
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