diff options
Diffstat (limited to 'lib/Sema/SemaChecking.cpp')
-rw-r--r-- | lib/Sema/SemaChecking.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp index 5ec01d0011..3fac79deba 100644 --- a/lib/Sema/SemaChecking.cpp +++ b/lib/Sema/SemaChecking.cpp @@ -60,12 +60,11 @@ SourceLocation Sema::getLocationOfStringLiteralByte(const StringLiteral *SL, std::pair<FileID, unsigned> LocInfo = SourceMgr.getDecomposedLoc(StrTokSpellingLoc); bool Invalid = false; - std::pair<const char *,const char *> Buffer = - SourceMgr.getBufferData(LocInfo.first, &Invalid); + llvm::StringRef Buffer = SourceMgr.getBufferData(LocInfo.first, &Invalid); if (Invalid) return StrTokSpellingLoc; - const char *StrData = Buffer.first+LocInfo.second; + const char *StrData = Buffer.data()+LocInfo.second; // Create a langops struct and enable trigraphs. This is sufficient for // relexing tokens. @@ -73,8 +72,8 @@ SourceLocation Sema::getLocationOfStringLiteralByte(const StringLiteral *SL, LangOpts.Trigraphs = true; // Create a lexer starting at the beginning of this token. - Lexer TheLexer(StrTokSpellingLoc, LangOpts, Buffer.first, StrData, - Buffer.second); + Lexer TheLexer(StrTokSpellingLoc, LangOpts, Buffer.begin(), StrData, + Buffer.end()); Token TheTok; TheLexer.LexFromRawLexer(TheTok); |