1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00

Simplify the parsing of unnamed globals. No functionality changed.

llvm-svn: 210120
This commit is contained in:
Rafael Espindola 2014-06-03 20:00:20 +00:00
parent 3ae2a07518
commit 48a1992b7f

View File

@ -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;
}