mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-27 21:50:40 +00:00
AsmParser: Reorder ParseMetadata() logic, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225709 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9460ae45a6
commit
9e9479148f
@ -2966,6 +2966,16 @@ bool LLParser::ParseMetadata(Metadata *&MD, PerFunctionState *PFS) {
|
||||
assert(Lex.getKind() == lltok::exclaim && "Expected '!' here");
|
||||
Lex.Lex();
|
||||
|
||||
// MDString:
|
||||
// ::= '!' STRINGCONSTANT
|
||||
if (Lex.getKind() == lltok::StringConstant) {
|
||||
MDString *S;
|
||||
if (ParseMDString(S))
|
||||
return true;
|
||||
MD = S;
|
||||
return false;
|
||||
}
|
||||
|
||||
// MDNode:
|
||||
// !{ ... }
|
||||
if (Lex.getKind() == lltok::lbrace) {
|
||||
@ -2978,20 +2988,10 @@ bool LLParser::ParseMetadata(Metadata *&MD, PerFunctionState *PFS) {
|
||||
|
||||
// Standalone metadata reference
|
||||
// !42
|
||||
if (Lex.getKind() == lltok::APSInt) {
|
||||
MDNode *N;
|
||||
if (ParseMDNodeID(N))
|
||||
return true;
|
||||
MD = N;
|
||||
return false;
|
||||
}
|
||||
|
||||
// MDString:
|
||||
// ::= '!' STRINGCONSTANT
|
||||
MDString *S;
|
||||
if (ParseMDString(S))
|
||||
MDNode *N;
|
||||
if (ParseMDNodeID(N))
|
||||
return true;
|
||||
MD = S;
|
||||
MD = N;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user