summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Instructions.cpp
diff options
context:
space:
mode:
authorJames Y Knight <jyknight@google.com>2019-01-31 21:51:58 +0000
committerJames Y Knight <jyknight@google.com>2019-01-31 21:51:58 +0000
commitfadf25068e32b44b010e6e03c6ab93bec41eae82 (patch)
tree9b22878f495e0b75d9e86cd01bcf199308dc9234 /llvm/lib/IR/Instructions.cpp
parentc62214da3de04f702e29e4ba4772c9463e2829ca (diff)
downloadbcm5719-llvm-fadf25068e32b44b010e6e03c6ab93bec41eae82.tar.gz
bcm5719-llvm-fadf25068e32b44b010e6e03c6ab93bec41eae82.zip
Revert "[opaque pointer types] Add a FunctionCallee wrapper type, and use it."
This reverts commit f47d6b38c7a61d50db4566b02719de05492dcef1 (r352791). Seems to run into compilation failures with GCC (but not clang, where I tested it). Reverting while I investigate. llvm-svn: 352800
Diffstat (limited to 'llvm/lib/IR/Instructions.cpp')
-rw-r--r--llvm/lib/IR/Instructions.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/IR/Instructions.cpp b/llvm/lib/IR/Instructions.cpp
index 4819d5f7b7d..6c7817adc6a 100644
--- a/llvm/lib/IR/Instructions.cpp
+++ b/llvm/lib/IR/Instructions.cpp
@@ -517,7 +517,7 @@ static Instruction *createMalloc(Instruction *InsertBefore,
BasicBlock *BB = InsertBefore ? InsertBefore->getParent() : InsertAtEnd;
Module *M = BB->getParent()->getParent();
Type *BPTy = Type::getInt8PtrTy(BB->getContext());
- FunctionCallee MallocFunc = MallocF;
+ Value *MallocFunc = MallocF;
if (!MallocFunc)
// prototype malloc as "void *malloc(size_t)"
MallocFunc = M->getOrInsertFunction("malloc", BPTy, IntPtrTy);
@@ -541,7 +541,7 @@ static Instruction *createMalloc(Instruction *InsertBefore,
}
}
MCall->setTailCall();
- if (Function *F = dyn_cast<Function>(MallocFunc.getCallee())) {
+ if (Function *F = dyn_cast<Function>(MallocFunc)) {
MCall->setCallingConv(F->getCallingConv());
if (!F->returnDoesNotAlias())
F->setReturnDoesNotAlias();
@@ -614,7 +614,7 @@ static Instruction *createFree(Value *Source,
Type *VoidTy = Type::getVoidTy(M->getContext());
Type *IntPtrTy = Type::getInt8PtrTy(M->getContext());
// prototype free as "void free(void*)"
- FunctionCallee FreeFunc = M->getOrInsertFunction("free", VoidTy, IntPtrTy);
+ Value *FreeFunc = M->getOrInsertFunction("free", VoidTy, IntPtrTy);
CallInst *Result = nullptr;
Value *PtrCast = Source;
if (InsertBefore) {
@@ -627,7 +627,7 @@ static Instruction *createFree(Value *Source,
Result = CallInst::Create(FreeFunc, PtrCast, Bundles, "");
}
Result->setTailCall();
- if (Function *F = dyn_cast<Function>(FreeFunc.getCallee()))
+ if (Function *F = dyn_cast<Function>(FreeFunc))
Result->setCallingConv(F->getCallingConv());
return Result;
OpenPOWER on IntegriCloud