[llvm-commits] [llvm] r159491 - /llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp
Bill Wendling
isanbard at gmail.com
Sat Jun 30 13:21:19 PDT 2012
Author: void
Date: Sat Jun 30 15:21:19 2012
New Revision: 159491
URL: http://llvm.org/viewvc/llvm-project?rev=159491&view=rev
Log:
Don't reinsert the 'atexit' function if it already exists.
Modified:
llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp
Modified: llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp?rev=159491&r1=159490&r2=159491&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp Sat Jun 30 15:21:19 2012
@@ -687,8 +687,7 @@
FTy = FunctionType::get(Type::getInt32Ty(*Ctx),
PointerType::get(FTy, 0), false);
- Function *AtExitFn =
- Function::Create(FTy, GlobalValue::ExternalLinkage, "atexit", M);
+ Constant *AtExitFn = M->getOrInsertFunction("atexit", FTy);
Builder.CreateCall(AtExitFn, WriteoutF);
Builder.CreateRetVoid();
More information about the llvm-commits
mailing list