1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00

Don't reinsert the 'atexit' function if it already exists.

llvm-svn: 159491
This commit is contained in:
Bill Wendling 2012-06-30 20:21:19 +00:00
parent 7f56993d8e
commit 53675fa303

View File

@ -687,8 +687,7 @@ void GCOVProfiler::insertCounterWriteout(
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();