diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-05-22 21:35:34 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-05-22 21:35:34 +0000 |
commit | 0721c2c155882008d2d5ad6b659d7eedaa380fe4 (patch) | |
tree | d34888b7b333951701259acafcd42866f69d829f /clang/lib/Lex/PPDirectives.cpp | |
parent | efe7c393e128b37baa78738fc114fea90706419c (diff) | |
download | bcm5719-llvm-0721c2c155882008d2d5ad6b659d7eedaa380fe4.tar.gz bcm5719-llvm-0721c2c155882008d2d5ad6b659d7eedaa380fe4.zip |
In assembler-with-cpp mode, don't error on '#' (stringize) operator applied to
non-argument names, pass the tokens through.
llvm-svn: 72283
Diffstat (limited to 'clang/lib/Lex/PPDirectives.cpp')
-rw-r--r-- | clang/lib/Lex/PPDirectives.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp index 331424bdc8e..d7b8fc7fd82 100644 --- a/clang/lib/Lex/PPDirectives.cpp +++ b/clang/lib/Lex/PPDirectives.cpp @@ -1376,9 +1376,11 @@ void Preprocessor::HandleDefineDirective(Token &DefineTok) { // Get the next token of the macro. LexUnexpandedToken(Tok); - // Not a macro arg identifier? - if (!Tok.getIdentifierInfo() || - MI->getArgumentNum(Tok.getIdentifierInfo()) == -1) { + // Check for a valid macro arg identifier, unless this is a .S file in + // which case it is still added to the body. + if ((!Tok.getIdentifierInfo() || + MI->getArgumentNum(Tok.getIdentifierInfo()) == -1) && + !getLangOptions().AsmPreprocessor) { Diag(Tok, diag::err_pp_stringize_not_parameter); ReleaseMacroInfo(MI); |