aboutsummaryrefslogtreecommitdiff
path: root/lib/Lex/Preprocessor.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-11-05 01:53:39 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-11-05 01:53:39 +0000
commit3da736c1143126be19b253804b3b135ebcd3d6ff (patch)
treeec3d5e10f15d57bd7c81855f748b4b8a7ac14414 /lib/Lex/Preprocessor.cpp
parent4cc1a259328977c30aff3ecc1b9dc9002cac60ec (diff)
StringRefize Preprocessor::getIdentifierInfo.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86105 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/Preprocessor.cpp')
-rw-r--r--lib/Lex/Preprocessor.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Lex/Preprocessor.cpp b/lib/Lex/Preprocessor.cpp
index b175a49856..eddff746f6 100644
--- a/lib/Lex/Preprocessor.cpp
+++ b/lib/Lex/Preprocessor.cpp
@@ -409,14 +409,14 @@ IdentifierInfo *Preprocessor::LookUpIdentifierInfo(Token &Identifier,
IdentifierInfo *II;
if (BufPtr && !Identifier.needsCleaning()) {
// No cleaning needed, just use the characters from the lexed buffer.
- II = getIdentifierInfo(BufPtr, BufPtr+Identifier.getLength());
+ II = getIdentifierInfo(llvm::StringRef(BufPtr, Identifier.getLength()));
} 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(TmpBuf, TmpBuf+Size);
+ II = getIdentifierInfo(llvm::StringRef(TmpBuf, Size));
}
Identifier.setIdentifierInfo(II);
return II;