aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-09-08 05:10:46 +0000
committerChris Lattner <sabre@nondot.org>2010-09-08 05:10:46 +0000
commit34e53140c2cc02ce4c9d060e48302576d3962e1c (patch)
tree2935f144ee34b31941cc1ead2b3916111afb1a3f /lib/Target
parent9607c40601b345c21af9de97ec03e124179efd24 (diff)
downloadexternal_llvm-34e53140c2cc02ce4c9d060e48302576d3962e1c.zip
external_llvm-34e53140c2cc02ce4c9d060e48302576d3962e1c.tar.gz
external_llvm-34e53140c2cc02ce4c9d060e48302576d3962e1c.tar.bz2
change the MC "ParseInstruction" interface to make it the
implementation's job to check for and lex the EndOfStatement marker. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113347 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r--lib/Target/ARM/AsmParser/ARMAsmParser.cpp5
-rw-r--r--lib/Target/X86/AsmParser/X86AsmParser.cpp4
2 files changed, 9 insertions, 0 deletions
diff --git a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
index f2099d2..f44470b 100644
--- a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
+++ b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
@@ -737,6 +737,11 @@ bool ARMAsmParser::ParseInstruction(StringRef Name, SMLoc NameLoc,
Operands.push_back(Op.take());
}
}
+
+ if (getLexer().isNot(AsmToken::EndOfStatement))
+ return TokError("unexpected token in argument list");
+ Parser.Lex(); // Consume the EndOfStatement
+
return false;
}
diff --git a/lib/Target/X86/AsmParser/X86AsmParser.cpp b/lib/Target/X86/AsmParser/X86AsmParser.cpp
index 58e4554..068ed56 100644
--- a/lib/Target/X86/AsmParser/X86AsmParser.cpp
+++ b/lib/Target/X86/AsmParser/X86AsmParser.cpp
@@ -786,6 +786,10 @@ ParseInstruction(StringRef Name, SMLoc NameLoc,
return true;
}
}
+
+ if (getLexer().isNot(AsmToken::EndOfStatement))
+ return TokError("unexpected token in argument list");
+ Parser.Lex(); // Consume the EndOfStatement
// FIXME: Hack to handle recognizing s{hr,ar,hl}? $1.
if ((Name.startswith("shr") || Name.startswith("sar") ||