diff --git a/lib/AsmParser/LLParser.cpp b/lib/AsmParser/LLParser.cpp index 3dbc5fd67d9..18e2b572c6a 100644 --- a/lib/AsmParser/LLParser.cpp +++ b/lib/AsmParser/LLParser.cpp @@ -257,45 +257,26 @@ bool LLParser::ParseTopLevelEntities() { case lltok::kw_appending: // OptionalLinkage case lltok::kw_common: // OptionalLinkage case lltok::kw_extern_weak: // OptionalLinkage - case lltok::kw_external: { // OptionalLinkage + case lltok::kw_external: // OptionalLinkage + case lltok::kw_default: // OptionalVisibility + case lltok::kw_hidden: // OptionalVisibility + case lltok::kw_protected: // OptionalVisibility + case lltok::kw_thread_local: // OptionalThreadLocal + case lltok::kw_addrspace: // OptionalAddrSpace + case lltok::kw_constant: // GlobalType + case lltok::kw_global: { // GlobalType unsigned Linkage, Visibility, DLLStorageClass; GlobalVariable::ThreadLocalMode TLM; - if (ParseOptionalLinkage(Linkage) || + bool HasLinkage; + if (ParseOptionalLinkage(Linkage, HasLinkage) || ParseOptionalVisibility(Visibility) || ParseOptionalDLLStorageClass(DLLStorageClass) || ParseOptionalThreadLocal(TLM) || - ParseGlobal("", SMLoc(), Linkage, true, Visibility, DLLStorageClass, - TLM)) + ParseGlobal("", SMLoc(), Linkage, HasLinkage, Visibility, + DLLStorageClass, TLM)) return true; break; } - case lltok::kw_default: // OptionalVisibility - case lltok::kw_hidden: // OptionalVisibility - case lltok::kw_protected: { // OptionalVisibility - unsigned Visibility, DLLStorageClass; - GlobalVariable::ThreadLocalMode TLM; - if (ParseOptionalVisibility(Visibility) || - ParseOptionalDLLStorageClass(DLLStorageClass) || - ParseOptionalThreadLocal(TLM) || - ParseGlobal("", SMLoc(), 0, false, Visibility, DLLStorageClass, TLM)) - return true; - break; - } - - case lltok::kw_thread_local: { // OptionalThreadLocal - GlobalVariable::ThreadLocalMode TLM; - if (ParseOptionalThreadLocal(TLM) || - ParseGlobal("", SMLoc(), 0, false, 0, 0, TLM)) - return true; - break; - } - - case lltok::kw_addrspace: // OptionalAddrSpace - case lltok::kw_constant: // GlobalType - case lltok::kw_global: // GlobalType - if (ParseGlobal("", SMLoc(), 0, false, 0, 0, GlobalValue::NotThreadLocal)) - return true; - break; case lltok::kw_attributes: if (ParseUnnamedAttrGrp()) return true; break; }