Add support for macro parameters/arguments delimited by spaces,

to improve compatibility with GNU as.

Based on a patch by PaX Team.

Fixed assertion failures on non-Darwin and added additional test cases.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164248 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Preston Gurd
2012-09-19 20:36:12 +00:00
parent 4caf5281bf
commit 7b6f2034ac
6 changed files with 188 additions and 33 deletions

View File

@@ -40,6 +40,7 @@ public:
// No-value.
EndOfStatement,
Colon,
Space,
Plus, Minus, Tilde,
Slash, // '/'
BackSlash, // '\'
@@ -126,6 +127,7 @@ class MCAsmLexer {
void operator=(const MCAsmLexer &) LLVM_DELETED_FUNCTION;
protected: // Can only create subclasses.
const char *TokStart;
bool SkipSpace;
MCAsmLexer();
@@ -175,6 +177,9 @@ public:
/// isNot - Check if the current token has kind \p K.
bool isNot(AsmToken::TokenKind K) const { return CurTok.isNot(K); }
/// setSkipSpace - Set whether spaces should be ignored by the lexer
void setSkipSpace(bool val) { SkipSpace = val; }
};
} // End llvm namespace