summaryrefslogtreecommitdiff
path: root/lib/Lex/Preprocessor.cpp
diff options
context:
space:
mode:
authorAlp Toker <alp@nuanti.com>2014-05-17 04:53:25 +0000
committerAlp Toker <alp@nuanti.com>2014-05-17 04:53:25 +0000
commit9db67864c522312bf596a17cd260d8567af669d1 (patch)
treeda5a39a168d84b0f29ce929fe6254096d7a1b625 /lib/Lex/Preprocessor.cpp
parent5027d6f10a9e7c2afa88ce6dc6560f8f4c4ff47c (diff)
downloadclang-9db67864c522312bf596a17cd260d8567af669d1.tar.gz
clang-9db67864c522312bf596a17cd260d8567af669d1.tar.bz2
clang-9db67864c522312bf596a17cd260d8567af669d1.tar.xz
Provide and use a safe Token::getRawIdentifier() accessor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209061 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/Preprocessor.cpp')
-rw-r--r--lib/Lex/Preprocessor.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/Lex/Preprocessor.cpp b/lib/Lex/Preprocessor.cpp
index fec0d5bd73..5072978ed6 100644
--- a/lib/Lex/Preprocessor.cpp
+++ b/lib/Lex/Preprocessor.cpp
@@ -501,14 +501,13 @@ void Preprocessor::EndSourceFile() {
/// identifier information for the token and install it into the token,
/// updating the token kind accordingly.
IdentifierInfo *Preprocessor::LookUpIdentifierInfo(Token &Identifier) const {
- assert(Identifier.getRawIdentifierData() != 0 && "No raw identifier data!");
+ assert(!Identifier.getRawIdentifier().empty() && "No raw identifier data!");
// Look up this token, see if it is a macro, or if it is a language keyword.
IdentifierInfo *II;
if (!Identifier.needsCleaning() && !Identifier.hasUCN()) {
// No cleaning needed, just use the characters from the lexed buffer.
- II = getIdentifierInfo(StringRef(Identifier.getRawIdentifierData(),
- Identifier.getLength()));
+ II = getIdentifierInfo(Identifier.getRawIdentifier());
} else {
// Cleaning needed, alloca a buffer, clean into it, then use the buffer.
SmallString<64> IdentifierBuffer;