summaryrefslogtreecommitdiff
path: root/lib/Lex/MacroArgs.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-01-26 19:29:26 +0000
committerChris Lattner <sabre@nondot.org>2009-01-26 19:29:26 +0000
commit47246be8ac5b0ddde6c402b8fc6946b6135487b5 (patch)
tree7d62292bae42147bda438278b0cba02eb818db50 /lib/Lex/MacroArgs.cpp
parent550faa3a6bb394eaa4013fcff0582434f4e924af (diff)
downloadclang-47246be8ac5b0ddde6c402b8fc6946b6135487b5.tar.gz
This change refactors some of the low-level lexer interfaces a bit.
Token now has a class of kinds for "literals", which include numeric constants, strings, etc. These tokens can optionally have a pointer to the start of the token in the lexer buffer. This makes it faster to get spelling and do other gymnastics, because we don't have to go through source locations. This change is performance neutral, but will make other changes more feasible down the road. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63028 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/MacroArgs.cpp')
-rw-r--r--lib/Lex/MacroArgs.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/Lex/MacroArgs.cpp b/lib/Lex/MacroArgs.cpp
index 77c96e0ab3..c3d7738afe 100644
--- a/lib/Lex/MacroArgs.cpp
+++ b/lib/Lex/MacroArgs.cpp
@@ -225,8 +225,7 @@ Token MacroArgs::StringifyArgument(const Token *ArgToks,
}
}
- Tok.setLength(Result.size());
- Tok.setLocation(PP.CreateString(&Result[0], Result.size()));
+ PP.CreateString(&Result[0], Result.size(), Tok);
return Tok;
}