summaryrefslogtreecommitdiffstats
path: root/clang/Lex/Lexer.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-07-08 08:28:12 +0000
committerChris Lattner <sabre@nondot.org>2006-07-08 08:28:12 +0000
commitcefc768f5b4a6789c45584a7264b950e65fe253d (patch)
treee4eaf546e999a0c9e1152ad3d45be22773e3a81d /clang/Lex/Lexer.cpp
parent21284dfdd128f2f2e7faec9b1694aaa88fb0ab2d (diff)
downloadbcm5719-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.cpp17
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.
OpenPOWER on IntegriCloud