summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineOutliner.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/MachineOutliner.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineOutliner.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/MachineOutliner.cpp b/llvm/lib/CodeGen/MachineOutliner.cpp
index 1a0190c2fbf..8c0626092bb 100644
--- a/llvm/lib/CodeGen/MachineOutliner.cpp
+++ b/llvm/lib/CodeGen/MachineOutliner.cpp
@@ -1104,9 +1104,9 @@ MachineOutliner::createOutlinedFunction(Module &M, OutlinedFunction &OF,
// Create the function using an IR-level function.
LLVMContext &C = M.getContext();
- Function *F = dyn_cast<Function>(
- M.getOrInsertFunction(NameStream.str(), Type::getVoidTy(C)));
- assert(F && "Function was null!");
+ Function *F =
+ Function::Create(FunctionType::get(Type::getVoidTy(C), false),
+ Function::ExternalLinkage, NameStream.str(), M);
// NOTE: If this is linkonceodr, then we can take advantage of linker deduping
// which gives us better results when we outline from linkonceodr functions.
OpenPOWER on IntegriCloud