diff options
Diffstat (limited to 'clang/lib/Lex/Lexer.cpp')
-rw-r--r-- | clang/lib/Lex/Lexer.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/clang/lib/Lex/Lexer.cpp b/clang/lib/Lex/Lexer.cpp index 149041559ab..d311b7e5ddc 100644 --- a/clang/lib/Lex/Lexer.cpp +++ b/clang/lib/Lex/Lexer.cpp @@ -229,12 +229,10 @@ unsigned Lexer::MeasureTokenLength(SourceLocation Loc, // the token this macro expanded to. Loc = SM.getInstantiationLoc(Loc); std::pair<FileID, unsigned> LocInfo = SM.getDecomposedLoc(Loc); - llvm::StringRef FileName; - std::string ErrorStr; + bool Invalid = false; std::pair<const char *,const char *> Buffer = SM.getBufferData(LocInfo.first, - FileName, - ErrorStr); - if (!Buffer.first) + &Invalid); + if (Invalid) return 0; const char *StrData = Buffer.first+LocInfo.second; |