From ba2cde995514de4e08619d289eed20b8f60913d6 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Thu, 19 Dec 2013 03:02:49 +0000 Subject: [PATCH] Switched code from using hasAttr followed by getAttr to simply call getAttr directly and check the resulting value. No functional changes intended. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197650 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGDeclCXX.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/CodeGen/CGDeclCXX.cpp b/lib/CodeGen/CGDeclCXX.cpp index 7bdb9eb0a4..73f3c987d1 100644 --- a/lib/CodeGen/CGDeclCXX.cpp +++ b/lib/CodeGen/CGDeclCXX.cpp @@ -281,9 +281,8 @@ CodeGenModule::EmitCXXGlobalVarDeclInitFunc(const VarDecl *D, // FIXME: We only need to register one __cxa_thread_atexit function for the // entire TU. CXXThreadLocalInits.push_back(Fn); - } else if (D->hasAttr()) { - unsigned int order = D->getAttr()->getPriority(); - OrderGlobalInits Key(order, PrioritizedCXXGlobalInits.size()); + } else if (const InitPriorityAttr *IPA = D->getAttr()) { + OrderGlobalInits Key(IPA->getPriority(), PrioritizedCXXGlobalInits.size()); PrioritizedCXXGlobalInits.push_back(std::make_pair(Key, Fn)); DelayedCXXInitPosition.erase(D); } else if (D->getTemplateSpecializationKind() != TSK_ExplicitSpecialization && -- 2.40.0