diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2010-03-16 14:14:31 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2010-03-16 14:14:31 +0000 |
commit | f6ac97b101c8840efa92bf29166077ce4049e293 (patch) | |
tree | ae3c4bd11598f49ee678e6fba5a3e2df38d24427 /lib/Sema/SemaChecking.cpp | |
parent | c506357c3778092c2a3251243f12524e8eb89274 (diff) |
Let SourceManager::getBufferData return StringRef instead of a pair of two const char*.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98630 91177308-0d34-0410-b5e6-96231b3b80d8
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); |