diff options
Diffstat (limited to 'lib/Lex/Preprocessor.cpp')
-rw-r--r-- | lib/Lex/Preprocessor.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/Lex/Preprocessor.cpp b/lib/Lex/Preprocessor.cpp index df0e702ab4..84ce062a6a 100644 --- a/lib/Lex/Preprocessor.cpp +++ b/lib/Lex/Preprocessor.cpp @@ -503,10 +503,8 @@ IdentifierInfo *Preprocessor::LookUpIdentifierInfo(Token &Identifier, } else { // Cleaning needed, alloca a buffer, clean into it, then use the buffer. llvm::SmallVector<char, 64> IdentifierBuffer; - IdentifierBuffer.resize(Identifier.getLength()); - const char *TmpBuf = &IdentifierBuffer[0]; - unsigned Size = getSpelling(Identifier, TmpBuf); - II = getIdentifierInfo(llvm::StringRef(TmpBuf, Size)); + llvm::StringRef CleanedStr = getSpelling(Identifier, IdentifierBuffer); + II = getIdentifierInfo(CleanedStr); } Identifier.setIdentifierInfo(II); return II; |