aboutsummaryrefslogtreecommitdiff
path: root/lib/Lex
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-11-17 06:35:43 +0000
committerChris Lattner <sabre@nondot.org>2010-11-17 06:35:43 +0000
commitca1475ea0e76da6b852796610139ed9b49c8d4a6 (patch)
treee98e307c4d41610bd81007f5adc477dda0b12d3c /lib/Lex
parent48cf9824fbad42995f4d91d59d08d2620effd683 (diff)
push use of Preprocessor out of getOffsetOfStringByte
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119470 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex')
-rw-r--r--lib/Lex/LiteralSupport.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/Lex/LiteralSupport.cpp b/lib/Lex/LiteralSupport.cpp
index 26be1d0ae1..0739c88d20 100644
--- a/lib/Lex/LiteralSupport.cpp
+++ b/lib/Lex/LiteralSupport.cpp
@@ -1007,18 +1007,17 @@ StringLiteralParser(const Token *StringToks, unsigned NumStringToks,
/// advancing over escape sequences in the string.
unsigned StringLiteralParser::getOffsetOfStringByte(const Token &Tok,
unsigned ByteNo,
- Preprocessor &PP,
+ const SourceManager &SM,
+ const LangOptions &Features,
const TargetInfo &Target,
Diagnostic *Diags) {
// Get the spelling of the token.
- llvm::SmallString<16> SpellingBuffer;
+ llvm::SmallString<32> SpellingBuffer;
SpellingBuffer.resize(Tok.getLength());
bool StringInvalid = false;
const char *SpellingPtr = &SpellingBuffer[0];
- unsigned TokLen = Preprocessor::getSpelling(Tok, SpellingPtr,
- PP.getSourceManager(),
- PP.getLangOptions(),
+ unsigned TokLen = Preprocessor::getSpelling(Tok, SpellingPtr, SM, Features,
&StringInvalid);
if (StringInvalid)
return 0;
@@ -1047,7 +1046,7 @@ unsigned StringLiteralParser::getOffsetOfStringByte(const Token &Tok,
// Otherwise, this is an escape character. Advance over it.
bool HadError = false;
ProcessCharEscape(SpellingPtr, SpellingEnd, HadError,
- FullSourceLoc(Tok.getLocation(), PP.getSourceManager()),
+ FullSourceLoc(Tok.getLocation(), SM),
false, Diags, Target);
assert(!HadError && "This method isn't valid on erroneous strings");
--ByteNo;