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 | eb92dc0b09262ed29149bf4faaa74a38df738cec (patch) | |
tree | 89b03c6567597b8a33fba0e7e446cd55fe674d9a /clang/lib/Sema/SemaChecking.cpp | |
parent | 0eb690390d35371c791d4076bdac973643f0de41 (diff) | |
download | bcm5719-llvm-eb92dc0b09262ed29149bf4faaa74a38df738cec.tar.gz bcm5719-llvm-eb92dc0b09262ed29149bf4faaa74a38df738cec.zip |
Let SourceManager::getBufferData return StringRef instead of a pair of two const char*.
llvm-svn: 98630
Diffstat (limited to 'clang/lib/Sema/SemaChecking.cpp')
-rw-r--r-- | clang/lib/Sema/SemaChecking.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp index 5ec01d00116..3fac79deba4 100644 --- a/clang/lib/Sema/SemaChecking.cpp +++ b/clang/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); |