[IR gen] debugging
This commit is contained in:
@@ -18,6 +18,7 @@ add_executable(sysyc
|
|||||||
SysYIRGenerator.cpp
|
SysYIRGenerator.cpp
|
||||||
Backend.cpp
|
Backend.cpp
|
||||||
LLVMIRGenerator.cpp
|
LLVMIRGenerator.cpp
|
||||||
|
LLVMIRGenerator_1.cpp
|
||||||
)
|
)
|
||||||
target_include_directories(sysyc PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
|
target_include_directories(sysyc PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
target_compile_options(sysyc PRIVATE -frtti)
|
target_compile_options(sysyc PRIVATE -frtti)
|
||||||
|
|||||||
@@ -171,6 +171,7 @@ std::any LLVMIRGenerator::visitVarDef(SysYParser::VarDefContext* ctx) {
|
|||||||
std::string llvmType = getLLVMType(type);
|
std::string llvmType = getLLVMType(type);
|
||||||
std::string allocaName = getNextTemp();
|
std::string allocaName = getNextTemp();
|
||||||
|
|
||||||
|
|
||||||
irStream << " " << allocaName << " = alloca " << llvmType << ", align 4\n";
|
irStream << " " << allocaName << " = alloca " << llvmType << ", align 4\n";
|
||||||
|
|
||||||
if (ctx->ASSIGN()) {
|
if (ctx->ASSIGN()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user