diff options
| author | Dmitri Gribenko <gribozavr@gmail.com> | 2012-09-24 21:07:17 +0000 |
|---|---|---|
| committer | Dmitri Gribenko <gribozavr@gmail.com> | 2012-09-24 21:07:17 +0000 |
| commit | b8e9e7507e3aef9d73bcb5450852de5a9c85c8ff (patch) | |
| tree | 9f91dd28f06192991f0a32ee89d37f78d1f7795c /clang/lib/Lex/Preprocessor.cpp | |
| parent | ae07f72017a509890365b84b37975ddaa1ad0a6d (diff) | |
StringRef'ize Preprocessor::CreateString().
llvm-svn: 164555
Diffstat (limited to 'clang/lib/Lex/Preprocessor.cpp')
| -rw-r--r-- | clang/lib/Lex/Preprocessor.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp index 614530cf387f..9fa3aabe4c8f 100644 --- a/clang/lib/Lex/Preprocessor.cpp +++ b/clang/lib/Lex/Preprocessor.cpp @@ -378,17 +378,17 @@ StringRef Preprocessor::getSpelling(const Token &Tok, /// CreateString - Plop the specified string into a scratch buffer and return a /// location for it. If specified, the source location provides a source /// location for the token. -void Preprocessor::CreateString(const char *Buf, unsigned Len, Token &Tok, +void Preprocessor::CreateString(StringRef Str, Token &Tok, SourceLocation ExpansionLocStart, SourceLocation ExpansionLocEnd) { - Tok.setLength(Len); + Tok.setLength(Str.size()); const char *DestPtr; - SourceLocation Loc = ScratchBuf->getToken(Buf, Len, DestPtr); + SourceLocation Loc = ScratchBuf->getToken(Str.data(), Str.size(), DestPtr); if (ExpansionLocStart.isValid()) Loc = SourceMgr.createExpansionLoc(Loc, ExpansionLocStart, - ExpansionLocEnd, Len); + ExpansionLocEnd, Str.size()); Tok.setLocation(Loc); // If this is a raw identifier or a literal token, set the pointer data. |
