diff options
author | John McCall <rjmccall@apple.com> | 2011-03-08 07:59:04 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2011-03-08 07:59:04 +0000 |
commit | 834e3f6c77d9ac03997a3f0c56934edcf406a355 (patch) | |
tree | 9996ca50172c3a9cb33026731c560de98b8f4cc7 /include/clang/Lex/Preprocessor.h | |
parent | 2792fa5115c5de7cbe11d99d23663c569bfb4cae (diff) |
Fix my earlier commit to work with escaped newlines and leave breadcrumbs
in case we want to make a world where we can check intermediate instantiations
for this kind of breadcrumb.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127221 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Lex/Preprocessor.h')
-rw-r--r-- | include/clang/Lex/Preprocessor.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/include/clang/Lex/Preprocessor.h b/include/clang/Lex/Preprocessor.h index 0b01710abf..42af489d90 100644 --- a/include/clang/Lex/Preprocessor.h +++ b/include/clang/Lex/Preprocessor.h @@ -644,10 +644,18 @@ public: return Diags->Report(Tok.getLocation(), DiagID); } - /// getSpelling() - Return the 'spelling' of the token at the given location. + /// getSpelling() - Return the 'spelling' of the token at the given + /// location; does not go up to the spelling location or down to the + /// instantiation location. /// + /// \param buffer A buffer which will be used only if the token requires + /// "cleaning", e.g. if it contains trigraphs or escaped newlines /// \param invalid If non-null, will be set \c true if an error occurs. - llvm::StringRef getSpelling(SourceLocation loc, bool *invalid = 0) const; + llvm::StringRef getSpelling(SourceLocation loc, + llvm::SmallVectorImpl<char> &buffer, + bool *invalid = 0) const { + return Lexer::getSpelling(loc, buffer, SourceMgr, Features, invalid); + } /// getSpelling() - Return the 'spelling' of the Tok token. The spelling of a /// token is the characters used to represent the token in the source file |