diff options
Diffstat (limited to 'llvm/lib/AsmParser/LLParser.cpp')
-rw-r--r-- | llvm/lib/AsmParser/LLParser.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp index 9b9054dbaed..0da81e42c68 100644 --- a/llvm/lib/AsmParser/LLParser.cpp +++ b/llvm/lib/AsmParser/LLParser.cpp @@ -63,15 +63,19 @@ bool LLParser::parseStandaloneConstantValue(Constant *&C, return false; } -bool LLParser::parseStandaloneType(Type *&Ty, const SlotMapping *Slots) { +bool LLParser::parseTypeAtBeginning(Type *&Ty, unsigned &Read, + const SlotMapping *Slots) { restoreParsingState(Slots); Lex.Lex(); + Read = 0; + SMLoc Start = Lex.getLoc(); Ty = nullptr; if (ParseType(Ty)) return true; - if (Lex.getKind() != lltok::Eof) - return Error(Lex.getLoc(), "expected end of string"); + SMLoc End = Lex.getLoc(); + Read = End.getPointer() - Start.getPointer(); + return false; } |