summaryrefslogtreecommitdiffstats
path: root/llvm/lib/AsmParser/LLParser.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-01-19 23:39:32 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-01-19 23:39:32 +0000
commit66ca92e509c83765f259ad1e3a36a86bc53a8d9c (patch)
treeba47842295e3d741e67793f6c7452f9c16b8b170 /llvm/lib/AsmParser/LLParser.cpp
parente4a6fef98ffd066db6360c53986032bcbd338275 (diff)
downloadbcm5719-llvm-66ca92e509c83765f259ad1e3a36a86bc53a8d9c.tar.gz
bcm5719-llvm-66ca92e509c83765f259ad1e3a36a86bc53a8d9c.zip
AsmParser: Split up ParseMDFieldsImpl(), NFC
llvm-svn: 226526
Diffstat (limited to 'llvm/lib/AsmParser/LLParser.cpp')
-rw-r--r--llvm/lib/AsmParser/LLParser.cpp25
1 files changed, 15 insertions, 10 deletions
diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp
index ff313ce2d74..467ed484f92 100644
--- a/llvm/lib/AsmParser/LLParser.cpp
+++ b/llvm/lib/AsmParser/LLParser.cpp
@@ -2953,16 +2953,7 @@ bool LLParser::ParseMDField(LocTy Loc, StringRef Name, MDField &Result) {
}
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;
- ClosingLoc = Lex.getLoc();
- if (EatIfPresent(lltok::rparen))
- return false;
-
+bool LLParser::ParseMDFieldsImplBody(ParserTy parseField) {
do {
if (Lex.getKind() != lltok::LabelStr)
return TokError("expected field label here");
@@ -2971,6 +2962,20 @@ bool LLParser::ParseMDFieldsImpl(ParserTy parseField, LocTy &ClosingLoc) {
return true;
} 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();
return ParseToken(lltok::rparen, "expected ')' here");
}
OpenPOWER on IntegriCloud