mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-08 19:25:47 +00:00
AsmParser: Split up ParseMDFieldsImpl(), NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226526 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -2953,16 +2953,7 @@ bool LLParser::ParseMDField(LocTy Loc, StringRef Name, MDField &Result) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <class ParserTy>
|
template <class ParserTy>
|
||||||
bool LLParser::ParseMDFieldsImpl(ParserTy parseField, LocTy &ClosingLoc) {
|
bool LLParser::ParseMDFieldsImplBody(ParserTy parseField) {
|
||||||
assert(Lex.getKind() == lltok::MetadataVar && "Expected metadata type name");
|
|
||||||
Lex.Lex();
|
|
||||||
|
|
||||||
if (ParseToken(lltok::lparen, "expected '(' here"))
|
|
||||||
return true;
|
|
||||||
ClosingLoc = Lex.getLoc();
|
|
||||||
if (EatIfPresent(lltok::rparen))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
do {
|
do {
|
||||||
if (Lex.getKind() != lltok::LabelStr)
|
if (Lex.getKind() != lltok::LabelStr)
|
||||||
return TokError("expected field label here");
|
return TokError("expected field label here");
|
||||||
@@ -2971,6 +2962,20 @@ bool LLParser::ParseMDFieldsImpl(ParserTy parseField, LocTy &ClosingLoc) {
|
|||||||
return true;
|
return true;
|
||||||
} while (EatIfPresent(lltok::comma));
|
} while (EatIfPresent(lltok::comma));
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class ParserTy>
|
||||||
|
bool LLParser::ParseMDFieldsImpl(ParserTy parseField, LocTy &ClosingLoc) {
|
||||||
|
assert(Lex.getKind() == lltok::MetadataVar && "Expected metadata type name");
|
||||||
|
Lex.Lex();
|
||||||
|
|
||||||
|
if (ParseToken(lltok::lparen, "expected '(' here"))
|
||||||
|
return true;
|
||||||
|
if (Lex.getKind() != lltok::rparen)
|
||||||
|
if (ParseMDFieldsImplBody(parseField))
|
||||||
|
return true;
|
||||||
|
|
||||||
ClosingLoc = Lex.getLoc();
|
ClosingLoc = Lex.getLoc();
|
||||||
return ParseToken(lltok::rparen, "expected ')' here");
|
return ParseToken(lltok::rparen, "expected ')' here");
|
||||||
}
|
}
|
||||||
|
@@ -422,6 +422,8 @@ namespace llvm {
|
|||||||
MDUnsignedField<uint32_t> &Result);
|
MDUnsignedField<uint32_t> &Result);
|
||||||
bool ParseMDField(LocTy Loc, StringRef Name, MDField &Result);
|
bool ParseMDField(LocTy Loc, StringRef Name, MDField &Result);
|
||||||
template <class ParserTy>
|
template <class ParserTy>
|
||||||
|
bool ParseMDFieldsImplBody(ParserTy parseField);
|
||||||
|
template <class ParserTy>
|
||||||
bool ParseMDFieldsImpl(ParserTy parseField, LocTy &ClosingLoc);
|
bool ParseMDFieldsImpl(ParserTy parseField, LocTy &ClosingLoc);
|
||||||
bool ParseSpecializedMDNode(MDNode *&N, bool IsDistinct = false);
|
bool ParseSpecializedMDNode(MDNode *&N, bool IsDistinct = false);
|
||||||
bool ParseMDLocation(MDNode *&Result, bool IsDistinct);
|
bool ParseMDLocation(MDNode *&Result, bool IsDistinct);
|
||||||
|
Reference in New Issue
Block a user