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 | c25d8058958d9cda0d9d6216b475180ba2f7c71d (patch) | |
tree | 1b30bfa5622b3d35faa9465488db076418ec6d1a /lib/Lex/PPDirectives.cpp | |
parent | 08d3e7c9ccbed9b26c301390d5997871b2dd41b7 (diff) |
In assembler-with-cpp mode, don't error on '#' (stringize) operator applied to
non-argument names, pass the tokens through.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72283 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/PPDirectives.cpp')
-rw-r--r-- | lib/Lex/PPDirectives.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Lex/PPDirectives.cpp b/lib/Lex/PPDirectives.cpp index 331424bdc8..d7b8fc7fd8 100644 --- a/lib/Lex/PPDirectives.cpp +++ b/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); |