mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-26 09:18:56 +00:00
Use a constant expr GEP instead of an actual instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6620 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -231,10 +231,8 @@ static void InsertPrintInst(Value *V, BasicBlock *BB, Instruction *InsertBefore,
|
|||||||
GlobalVariable *fmtVal = getStringRef(Mod, Message+getPrintfCodeFor(V)+"\n");
|
GlobalVariable *fmtVal = getStringRef(Mod, Message+getPrintfCodeFor(V)+"\n");
|
||||||
|
|
||||||
// Turn the format string into an sbyte *
|
// Turn the format string into an sbyte *
|
||||||
Instruction *GEP =
|
Constant *GEP =ConstantExpr::getGetElementPtr(ConstantPointerRef::get(fmtVal),
|
||||||
new GetElementPtrInst(fmtVal,
|
vector<Constant*>(2,Constant::getNullValue(Type::LongTy)));
|
||||||
vector<Value*>(2,ConstantSInt::get(Type::LongTy, 0)),
|
|
||||||
"trstrp", InsertBefore);
|
|
||||||
|
|
||||||
// Insert a call to the hash function if this is a pointer value
|
// Insert a call to the hash function if this is a pointer value
|
||||||
if (V && isa<PointerType>(V->getType()) && !DisablePtrHashing) {
|
if (V && isa<PointerType>(V->getType()) && !DisablePtrHashing) {
|
||||||
|
Reference in New Issue
Block a user