summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCParser/AsmLexer.cpp
diff options
context:
space:
mode:
authorNirav Dave <niravd@google.com>2016-06-02 17:15:05 +0000
committerNirav Dave <niravd@google.com>2016-06-02 17:15:05 +0000
commit1180e689b6e97d1fd32642c41be6ef36b5cf18c1 (patch)
tree2d30d076784815239563ff97e1e37d4b2c72d3b9 /llvm/lib/MC/MCParser/AsmLexer.cpp
parent75c3ebfa020fa3355cd631f37eac2e5897ef3dad (diff)
downloadbcm5719-llvm-1180e689b6e97d1fd32642c41be6ef36b5cf18c1.tar.gz
bcm5719-llvm-1180e689b6e97d1fd32642c41be6ef36b5cf18c1.zip
Ignore Lexing errors in macro body definitions
Do not issue lexing errors found during the parsing of macro body definitions and parseIdentifier function in AsmParser. This changes the Parser to not issue a lexing error when we reach an error, but rather when it is consumed allowing us time to examine and recover from an error. As a result, of this, we stop issuing a both lexing error and a parsing error in floating-literals test. Minor tweak to parseDirectiveRealValue to favor more meaningful lexing error over less helpful parse error. Reviewers: rnk, majnemer Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D20535 llvm-svn: 271542
Diffstat (limited to 'llvm/lib/MC/MCParser/AsmLexer.cpp')
-rw-r--r--llvm/lib/MC/MCParser/AsmLexer.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/MC/MCParser/AsmLexer.cpp b/llvm/lib/MC/MCParser/AsmLexer.cpp
index 9b057c2dc04..f653304186b 100644
--- a/llvm/lib/MC/MCParser/AsmLexer.cpp
+++ b/llvm/lib/MC/MCParser/AsmLexer.cpp
@@ -46,7 +46,7 @@ void AsmLexer::setBuffer(StringRef Buf, const char *ptr) {
AsmToken AsmLexer::ReturnError(const char *Loc, const std::string &Msg) {
SetError(SMLoc::getFromPointer(Loc), Msg);
- return AsmToken(AsmToken::Error, StringRef(Loc, 0));
+ return AsmToken(AsmToken::Error, StringRef(Loc, CurPtr - Loc));
}
int AsmLexer::getNextChar() {
OpenPOWER on IntegriCloud