From: Rafael Espindola Date: Tue, 3 Jun 2014 20:00:20 +0000 (+0000) Subject: Simplify the parsing of unnamed globals. No functionality changed. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=52b7442c281603319817753037bb61c182d4f79f;p=platform%2Fupstream%2Fllvm.git Simplify the parsing of unnamed globals. No functionality changed. llvm-svn: 210120 --- diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp index 3dbc5fd..18e2b57 100644 --- a/llvm/lib/AsmParser/LLParser.cpp +++ b/llvm/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; }