r240220 - Avoid clearing an empty PrioritizedCXXGlobalInits, NFC
Yaron Keren
yaron.keren at gmail.com
Sat Jun 20 08:51:52 PDT 2015
Author: yrnkrn
Date: Sat Jun 20 10:51:52 2015
New Revision: 240220
URL: http://llvm.org/viewvc/llvm-project?rev=240220&view=rev
Log:
Avoid clearing an empty PrioritizedCXXGlobalInits, NFC
We already test for PrioritizedCXXGlobalInits being non-empty
and process it so it makes sense to clear it only in that if.
Modified:
cfe/trunk/lib/CodeGen/CGDeclCXX.cpp
Modified: cfe/trunk/lib/CodeGen/CGDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDeclCXX.cpp?rev=240220&r1=240219&r2=240220&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDeclCXX.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDeclCXX.cpp Sat Jun 20 10:51:52 2015
@@ -424,6 +424,7 @@ CodeGenModule::EmitCXXGlobalInitFunc() {
CodeGenFunction(*this).GenerateCXXGlobalInitFunc(Fn, LocalCXXGlobalInits);
AddGlobalCtor(Fn, Priority);
}
+ PrioritizedCXXGlobalInits.clear();
}
SmallString<128> FileName;
@@ -451,7 +452,6 @@ CodeGenModule::EmitCXXGlobalInitFunc() {
AddGlobalCtor(Fn);
CXXGlobalInits.clear();
- PrioritizedCXXGlobalInits.clear();
}
void CodeGenModule::EmitCXXGlobalDtorFunc() {
More information about the cfe-commits
mailing list