r197650 - Switched code from using hasAttr followed by getAttr to simply call getAttr directly and check the resulting value.
Aaron Ballman
aaron at aaronballman.com
Wed Dec 18 19:02:49 PST 2013
Author: aaronballman
Date: Wed Dec 18 21:02:49 2013
New Revision: 197650
URL: http://llvm.org/viewvc/llvm-project?rev=197650&view=rev
Log:
Switched code from using hasAttr followed by getAttr to simply call getAttr directly and check the resulting value.
No functional changes intended.
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=197650&r1=197649&r2=197650&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDeclCXX.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDeclCXX.cpp Wed Dec 18 21:02:49 2013
@@ -281,9 +281,8 @@ CodeGenModule::EmitCXXGlobalVarDeclInitF
// FIXME: We only need to register one __cxa_thread_atexit function for the
// entire TU.
CXXThreadLocalInits.push_back(Fn);
- } else if (D->hasAttr<InitPriorityAttr>()) {
- unsigned int order = D->getAttr<InitPriorityAttr>()->getPriority();
- OrderGlobalInits Key(order, PrioritizedCXXGlobalInits.size());
+ } else if (const InitPriorityAttr *IPA = D->getAttr<InitPriorityAttr>()) {
+ OrderGlobalInits Key(IPA->getPriority(), PrioritizedCXXGlobalInits.size());
PrioritizedCXXGlobalInits.push_back(std::make_pair(Key, Fn));
DelayedCXXInitPosition.erase(D);
} else if (D->getTemplateSpecializationKind() != TSK_ExplicitSpecialization &&
More information about the cfe-commits
mailing list