aboutsummaryrefslogtreecommitdiff
path: root/lib/Lex/Lexer.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-03-16 00:06:06 +0000
committerDouglas Gregor <dgregor@apple.com>2010-03-16 00:06:06 +0000
commitf715ca12bfc9fddfde75f98a197424434428b821 (patch)
treebd19f3ce3d9a7850942f25d25c03633954e91faa /lib/Lex/Lexer.cpp
parentf9b0a58a103784495309543dce4469e44861b4cc (diff)
Give SourceManager a Diagnostic object with which to report errors,
and start simplifying the interfaces in SourceManager that can fail. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98594 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/Lexer.cpp')
-rw-r--r--lib/Lex/Lexer.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/Lex/Lexer.cpp b/lib/Lex/Lexer.cpp
index 149041559a..d311b7e5dd 100644
--- a/lib/Lex/Lexer.cpp
+++ b/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;