summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Analysis/TBAATest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/unittests/Analysis/TBAATest.cpp')
-rw-r--r--llvm/unittests/Analysis/TBAATest.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/unittests/Analysis/TBAATest.cpp b/llvm/unittests/Analysis/TBAATest.cpp
index 5a71c74a80b..a626018c838 100644
--- a/llvm/unittests/Analysis/TBAATest.cpp
+++ b/llvm/unittests/Analysis/TBAATest.cpp
@@ -33,7 +33,7 @@ protected:
static StoreInst *getFunctionWithSingleStore(Module *M, StringRef Name) {
auto &C = M->getContext();
FunctionType *FTy = FunctionType::get(Type::getVoidTy(C), {});
- auto *F = Function::Create(FTy, Function::ExternalLinkage, Name, M);
+ auto *F = cast<Function>(M->getOrInsertFunction(Name, FTy));
auto *BB = BasicBlock::Create(C, "entry", F);
auto *IntType = Type::getInt32Ty(C);
auto *PtrType = Type::getInt32PtrTy(C);
OpenPOWER on IntegriCloud