diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-11-14 01:20:48 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-11-14 01:20:48 +0000 |
commit | 0ff1042ddaad1419264be0de6da17f3b378482a4 (patch) | |
tree | 5bd6b2e68aec7d1909621e261c7c63b62a89b7f9 /lib | |
parent | 8a9f569262860b8d03203327afd6047be2a9b5a6 (diff) |
Add static version of Preprocessor::getSpelling.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88732 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Lex/Preprocessor.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/Lex/Preprocessor.cpp b/lib/Lex/Preprocessor.cpp index 96c6682ad7..066909475f 100644 --- a/lib/Lex/Preprocessor.cpp +++ b/lib/Lex/Preprocessor.cpp @@ -192,13 +192,14 @@ void Preprocessor::PrintStats() { // Token Spelling //===----------------------------------------------------------------------===// - /// getSpelling() - Return the 'spelling' of this token. The spelling of a /// token are the characters used to represent the token in the source file /// after trigraph expansion and escaped-newline folding. In particular, this /// wants to get the true, uncanonicalized, spelling of things like digraphs /// UCNs, etc. -std::string Preprocessor::getSpelling(const Token &Tok) const { +std::string Preprocessor::getSpelling(const Token &Tok, + const SourceManager &SourceMgr, + const LangOptions &Features) { assert((int)Tok.getLength() >= 0 && "Token character range is bogus!"); // If this token contains nothing interesting, return it directly. @@ -221,6 +222,15 @@ std::string Preprocessor::getSpelling(const Token &Tok) const { return Result; } +/// getSpelling() - Return the 'spelling' of this token. The spelling of a +/// token are the characters used to represent the token in the source file +/// after trigraph expansion and escaped-newline folding. In particular, this +/// wants to get the true, uncanonicalized, spelling of things like digraphs +/// UCNs, etc. +std::string Preprocessor::getSpelling(const Token &Tok) const { + return getSpelling(Tok, SourceMgr, Features); +} + /// getSpelling - This method is used to get the spelling of a token into a /// preallocated buffer, instead of as an std::string. The caller is required /// to allocate enough space for the token, which is guaranteed to be at least |