如何卸载我从源码安装的gcc版本.我正在使用gcc 4.9而我正在使用ubuntu 12.04.
或者有没有办法通过ubuntu存储库升级到最新的gcc版本?
我正在尝试编写一个简单的解释器。
我正在尝试生成 LLVM IR 进行赋值操作。生成部分的代码如下所示
llvm::Value* codeGenSymTab(llvm::LLVMContext& context) {
printf("\n CodeGen SymTab \n");
Value *num = ConstantInt::get(Type::getInt64Ty(context), aTable.value, true);
Value *alloc = new AllocaInst(IntegerType::get(context, 32), aTable.variableName,entry);
StoreInst *ptr = new StoreInst(num,alloc,false,entry);
}
Run Code Online (Sandbox Code Playgroud)
SymTab 定义如下:
struct SymTab {
char* variableName;
int value;
llvm::Value* (*codeGen)(llvm::LLVMContext& context);
};
Run Code Online (Sandbox Code Playgroud)
当我尝试执行输出文件时,出现以下错误:
Assertion failed: (getOperand(0)->getType() == cast<PointerType>(getOperand(1)->getType())->getElementType() && "Ptr must be a pointer to Val type!"), function AssertOK, file Instructions.cpp, line 1084.
Abort trap: 6
Run Code Online (Sandbox Code Playgroud)
你能帮我解决吗?
谢谢
c++ ×1
gcc ×1
linux ×1
llvm ×1
llvm-c++-api ×1
llvm-ir ×1
ubuntu ×1
ubuntu-12.04 ×1
uninstall ×1