aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Lex/TokenLexer.cpp
diff options
context:
space:
mode:
authorRoman Divacky <rdivacky@FreeBSD.org>2010-03-16 16:52:15 +0000
committerRoman Divacky <rdivacky@FreeBSD.org>2010-03-16 16:52:15 +0000
commit4a37f65f1c1373c9956d118a012943de2f61edb0 (patch)
tree52aebaff3a47b97dbac434530524c30967468412 /lib/Lex/TokenLexer.cpp
parenta16e9ac1f192503038f49e0c52edd7dcb2ce023a (diff)
downloadsrc-4a37f65f1c1373c9956d118a012943de2f61edb0.tar.gz
src-4a37f65f1c1373c9956d118a012943de2f61edb0.zip
Update clang to r98631.
Notes
Notes: svn path=/vendor/clang/dist/; revision=205219
Diffstat (limited to 'lib/Lex/TokenLexer.cpp')
-rw-r--r--lib/Lex/TokenLexer.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/Lex/TokenLexer.cpp b/lib/Lex/TokenLexer.cpp
index 5d95eb39c89e..dbd1b8400de3 100644
--- a/lib/Lex/TokenLexer.cpp
+++ b/lib/Lex/TokenLexer.cpp
@@ -325,7 +325,7 @@ void TokenLexer::Lex(Token &Tok) {
// returned by PasteTokens, not the pasted token.
if (PasteTokens(Tok))
return;
-
+
TokenIsFromPaste = true;
}
@@ -379,7 +379,7 @@ void TokenLexer::Lex(Token &Tok) {
/// are more ## after it, chomp them iteratively. Return the result as Tok.
/// If this returns true, the caller should immediately return the token.
bool TokenLexer::PasteTokens(Token &Tok) {
- llvm::SmallVector<char, 128> Buffer;
+ llvm::SmallString<128> Buffer;
const char *ResultTokStrPtr = 0;
do {
// Consume the ## operator.
@@ -439,7 +439,11 @@ bool TokenLexer::PasteTokens(Token &Tok) {
SourceManager &SourceMgr = PP.getSourceManager();
FileID LocFileID = SourceMgr.getFileID(ResultTokLoc);
- const char *ScratchBufStart = SourceMgr.getBufferData(LocFileID).first;
+ bool Invalid = false;
+ const char *ScratchBufStart
+ = SourceMgr.getBufferData(LocFileID, &Invalid).data();
+ if (Invalid)
+ return false;
// Make a lexer to lex this string from. Lex just this one token.
// Make a lexer object so that we lex and expand the paste result.
@@ -506,8 +510,7 @@ bool TokenLexer::PasteTokens(Token &Tok) {
if (Tok.is(tok::identifier)) {
// Look up the identifier info for the token. We disabled identifier lookup
// by saying we're skipping contents, so we need to do this manually.
- IdentifierInfo *II = PP.LookUpIdentifierInfo(Tok, ResultTokStrPtr);
- Tok.setIdentifierInfo(II);
+ PP.LookUpIdentifierInfo(Tok, ResultTokStrPtr);
}
return false;
}