diff options
author | Vassil Vassilev <v.g.vassilev@gmail.com> | 2016-10-27 09:12:20 +0000 |
---|---|---|
committer | Vassil Vassilev <v.g.vassilev@gmail.com> | 2016-10-27 09:12:20 +0000 |
commit | 188ad3ac02d06cab3ca13241196a3e110f845439 (patch) | |
tree | 64d1e8a23339337e0b9bfd6acaca8b374af45852 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 9d61e14771e52134091441f147590d6094a8c65e (diff) | |
download | bcm5719-llvm-188ad3ac02d06cab3ca13241196a3e110f845439.tar.gz bcm5719-llvm-188ad3ac02d06cab3ca13241196a3e110f845439.zip |
Empty the CtorLists/DtorLists once emitted.
This is essential when clang is running in incremental processing mode because
we don't want to reemit the 'tors over and over again.
Patch by Axel Naumann!
Reviewed by Richard Smith and me. (https://reviews.llvm.org/D25605)
llvm-svn: 285277
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 21849590b11..81d9ead3d16 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -721,7 +721,7 @@ void CodeGenModule::AddGlobalDtor(llvm::Function *Dtor, int Priority) { GlobalDtors.push_back(Structor(Priority, Dtor, nullptr)); } -void CodeGenModule::EmitCtorList(const CtorList &Fns, const char *GlobalName) { +void CodeGenModule::EmitCtorList(CtorList &Fns, const char *GlobalName) { // Ctor function type is void()*. llvm::FunctionType* CtorFTy = llvm::FunctionType::get(VoidTy, false); llvm::Type *CtorPFTy = llvm::PointerType::getUnqual(CtorFTy); @@ -749,6 +749,7 @@ void CodeGenModule::EmitCtorList(const CtorList &Fns, const char *GlobalName) { llvm::ConstantArray::get(AT, Ctors), GlobalName); } + Fns.clear(); } llvm::GlobalValue::LinkageTypes |