xVMP icon indicating copy to clipboard operation
xVMP copied to clipboard

llvm12移植时问题

Open qwemnbvv opened this issue 1 year ago • 20 comments

为了支持代码在较高版本的使用,将xVMP.cpp移植到了llvm12下编译完成,但是在编译后的使用存在一些问题 为了支持llvm12的使用, 将 Value *called_value = inst->getCalledValue(); 更改为 Value *called_value = inst->getCalledOperand();

resultValue = IRBcallFunction.CreateCall(value, ArrayRef<Value *>(target_func_args)); 更改 FunctionType *funcType = cast<FunctionType>(cast<PointerType>(value->getType())->getElementType()); FunctionCallee funcCallee(funcType, value); resultValue = IRBcallFunction.CreateCall(funcCallee, ArrayRef<Value *>(target_func_args));

Value * arg = IRBcon.CreateLoad(ptr); 更改 Value * arg = IRBcon.CreateLoad(target_ptr_type,ptr);

Constant *tmp = Mod->getOrInsertFunction(fun->getName().str(), fun->getFunctionType()); Function *NewF = cast<Function>(tmp); NewF->setLinkage(llvm::GlobalValue::LinkageTypes::InternalLinkage); 更改 FunctionCallee tmp = Mod->getOrInsertFunction(fun->getName().str(), fun->getFunctionType()); Function *NewF = cast<Function>(tmp.getCallee()); NewF->setLinkage(llvm::GlobalValue::LinkageTypes::InternalLinkage); 这样在llvm12中可以正常编译,但是在随后在执行pass经过的函数触发了Segmentation fault 我应该继续深入重构代码的实现 或者在代码的更新中出现了错误?

qwemnbvv avatar Mar 19 '23 20:03 qwemnbvv