diff options
author | rdivacky <rdivacky@FreeBSD.org> | 2009-11-05 17:18:09 +0000 |
---|---|---|
committer | rdivacky <rdivacky@FreeBSD.org> | 2009-11-05 17:18:09 +0000 |
commit | b3a51061b1b9c4add078237850649f7c9efb13ab (patch) | |
tree | 8b316eca843681b024034db1125707173b9adb4a /lib/Lex/Preprocessor.cpp | |
parent | b6d5e15aae202f157c6cd63da8fa4b089e7b31e9 (diff) | |
download | FreeBSD-src-b3a51061b1b9c4add078237850649f7c9efb13ab.zip FreeBSD-src-b3a51061b1b9c4add078237850649f7c9efb13ab.tar.gz |
Update clang to r86140.
Diffstat (limited to 'lib/Lex/Preprocessor.cpp')
-rw-r--r-- | lib/Lex/Preprocessor.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/Lex/Preprocessor.cpp b/lib/Lex/Preprocessor.cpp index 7f3afc6..487b9d6 100644 --- a/lib/Lex/Preprocessor.cpp +++ b/lib/Lex/Preprocessor.cpp @@ -43,8 +43,6 @@ using namespace clang; //===----------------------------------------------------------------------===// -PreprocessorFactory::~PreprocessorFactory() {} - Preprocessor::Preprocessor(Diagnostic &diags, const LangOptions &opts, TargetInfo &target, SourceManager &SM, HeaderSearch &Headers, @@ -403,7 +401,7 @@ void Preprocessor::EnterMainSourceFile() { /// LookUpIdentifierInfo - Given a tok::identifier token, look up the /// identifier information for the token and install it into the token. IdentifierInfo *Preprocessor::LookUpIdentifierInfo(Token &Identifier, - const char *BufPtr) { + const char *BufPtr) const { assert(Identifier.is(tok::identifier) && "Not an identifier!"); assert(Identifier.getIdentifierInfo() == 0 && "Identinfo already exists!"); @@ -411,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; |