mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 03:28:20 +02:00
FixGEP for const geps
This commit is contained in:
parent
a7183ad803
commit
9ce7a535b4
2 changed files with 28 additions and 2 deletions
|
@ -873,7 +873,8 @@ void BfIRCodeGen::Read(llvm::Value*& llvmValue, BfIRCodeGenEntry** codeGenEntry,
|
|||
llvm::Value* gepArgs[] = {
|
||||
llvm::ConstantInt::get(llvm::Type::getInt32Ty(*mLLVMContext), idx0),
|
||||
llvm::ConstantInt::get(llvm::Type::getInt32Ty(*mLLVMContext), idx1)};
|
||||
llvmValue = llvm::ConstantExpr::getInBoundsGetElementPtr(NULL, target, gepArgs);
|
||||
|
||||
llvmValue = FixGEP(target, llvm::ConstantExpr::getInBoundsGetElementPtr(NULL, target, gepArgs));
|
||||
return;
|
||||
}
|
||||
else if (constType == BfConstType_ExtractValue)
|
||||
|
@ -882,7 +883,7 @@ void BfIRCodeGen::Read(llvm::Value*& llvmValue, BfIRCodeGenEntry** codeGenEntry,
|
|||
CMD_PARAM(int, idx0);
|
||||
unsigned int gepArgs[] = {
|
||||
(unsigned int)idx0 };
|
||||
llvmValue = llvm::ConstantExpr::getExtractValue(target, gepArgs);
|
||||
llvmValue = FixGEP(target, llvm::ConstantExpr::getExtractValue(target, gepArgs));
|
||||
return;
|
||||
}
|
||||
else if (constType == BfConstType_PtrToInt)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue