diff options
| author | Chris Lattner <sabre@nondot.org> | 2006-07-08 08:28:12 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2006-07-08 08:28:12 +0000 |
| commit | cefc768f5b4a6789c45584a7264b950e65fe253d (patch) | |
| tree | e4eaf546e999a0c9e1152ad3d45be22773e3a81d /clang/Lex/Lexer.cpp | |
| parent | 21284dfdd128f2f2e7faec9b1694aaa88fb0ab2d (diff) | |
| download | bcm5719-llvm-cefc768f5b4a6789c45584a7264b950e65fe253d.tar.gz bcm5719-llvm-cefc768f5b4a6789c45584a7264b950e65fe253d.zip | |
Start reading/validating the argument list for a function-like macro.
llvm-svn: 38681
Diffstat (limited to 'clang/Lex/Lexer.cpp')
| -rw-r--r-- | clang/Lex/Lexer.cpp | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/clang/Lex/Lexer.cpp b/clang/Lex/Lexer.cpp index aaaa349f646..9cf0dae0a0c 100644 --- a/clang/Lex/Lexer.cpp +++ b/clang/Lex/Lexer.cpp @@ -349,22 +349,13 @@ void Lexer::LexIdentifier(LexerToken &Result, const char *CurPtr) { // FIXME: UCNs. if (C != '\\' && C != '?' && (C != '$' || !Features.DollarIdents)) { FinishIdentifier: - const char *IdStart = BufferPtr, *IdEnd = CurPtr; + const char *IdStart = BufferPtr; FormTokenWithChars(Result, CurPtr); Result.SetKind(tok::identifier); - // Look up this token, see if it is a macro, or if it is a language keyword. - IdentifierInfo *II; - if (!Result.needsCleaning()) { - // No cleaning needed, just use the characters from the lexed buffer. - II = PP.getIdentifierInfo(IdStart, IdEnd); - } else { - // Cleaning needed, alloca a buffer, clean into it, then use the buffer. - const char *TmpBuf = (char*)alloca(Result.getLength()); - unsigned Size = PP.getSpelling(Result, TmpBuf); - II = PP.getIdentifierInfo(TmpBuf, TmpBuf+Size); - } - Result.SetIdentifierInfo(II); + // Fill in Result.IdentifierInfo, looking up the identifier in the + // identifier table. + PP.LookUpIdentifierInfo(Result, IdStart); // Finally, now that we know we have an identifier, pass this off to the // preprocessor, which may macro expand it or something. |

