summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Module.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/IR/Module.cpp')
-rw-r--r--llvm/lib/IR/Module.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/llvm/lib/IR/Module.cpp b/llvm/lib/IR/Module.cpp
index b6dd7ab70a8..fd6495f4dbd 100644
--- a/llvm/lib/IR/Module.cpp
+++ b/llvm/lib/IR/Module.cpp
@@ -140,8 +140,8 @@ void Module::getOperandBundleTags(SmallVectorImpl<StringRef> &Result) const {
// it. This is nice because it allows most passes to get away with not handling
// the symbol table directly for this common task.
//
-FunctionCallee Module::getOrInsertFunction(StringRef Name, FunctionType *Ty,
- AttributeList AttributeList) {
+Constant *Module::getOrInsertFunction(StringRef Name, FunctionType *Ty,
+ AttributeList AttributeList) {
// See if we have a definition for the specified function already.
GlobalValue *F = getNamedValue(Name);
if (!F) {
@@ -151,20 +151,21 @@ FunctionCallee Module::getOrInsertFunction(StringRef Name, FunctionType *Ty,
if (!New->isIntrinsic()) // Intrinsics get attrs set on construction
New->setAttributes(AttributeList);
FunctionList.push_back(New);
- return {Ty, New}; // Return the new prototype.
+ return New; // Return the new prototype.
}
// If the function exists but has the wrong type, return a bitcast to the
// right type.
auto *PTy = PointerType::get(Ty, F->getAddressSpace());
if (F->getType() != PTy)
- return {Ty, ConstantExpr::getBitCast(F, PTy)};
+ return ConstantExpr::getBitCast(F, PTy);
// Otherwise, we just found the existing function or a prototype.
- return {Ty, F};
+ return F;
}
-FunctionCallee Module::getOrInsertFunction(StringRef Name, FunctionType *Ty) {
+Constant *Module::getOrInsertFunction(StringRef Name,
+ FunctionType *Ty) {
return getOrInsertFunction(Name, Ty, AttributeList());
}
OpenPOWER on IntegriCloud