|
@@ -850,17 +850,14 @@ again:
|
|
}
|
|
}
|
|
|
|
|
|
StringRef Lexer::getSpelling(const Token &Tok,
|
|
StringRef Lexer::getSpelling(const Token &Tok,
|
|
- const SourceManager &SourceMgr,
|
|
|
|
- bool *Invalid) const {
|
|
|
|
|
|
+ const SourceManager &SourceMgr) const {
|
|
SourceLocation Loc = Tok.getLocation();
|
|
SourceLocation Loc = Tok.getLocation();
|
|
std::pair<FileID, unsigned> LocInfo = SourceMgr.getDecomposedLoc(Loc);
|
|
std::pair<FileID, unsigned> LocInfo = SourceMgr.getDecomposedLoc(Loc);
|
|
|
|
|
|
bool InvalidTemp = false;
|
|
bool InvalidTemp = false;
|
|
StringRef File = SourceMgr.getBufferData(LocInfo.first, &InvalidTemp);
|
|
StringRef File = SourceMgr.getBufferData(LocInfo.first, &InvalidTemp);
|
|
- if (InvalidTemp) {
|
|
|
|
- *Invalid = true;
|
|
|
|
|
|
+ if (InvalidTemp)
|
|
return StringRef();
|
|
return StringRef();
|
|
- }
|
|
|
|
|
|
|
|
const char *Begin = File.data() + LocInfo.second;
|
|
const char *Begin = File.data() + LocInfo.second;
|
|
return StringRef(Begin, Tok.getLength());
|
|
return StringRef(Begin, Tok.getLength());
|