diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-07-07 21:54:45 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-07-07 21:54:45 +0000 |
commit | 7a759606d93975866051f67104ae58446e55f404 (patch) | |
tree | 7cea5f3d5011bf43b5ba37f3163aa33b3e48ccb1 /include/clang | |
parent | 14ef3191a75b8bcdab391e6ffa6367b731c2ce67 (diff) |
Move SourceManager::isAt[Start/End]OfMacroInstantiation functions to the Lexer, since they depend on it now.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134644 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang')
-rw-r--r-- | include/clang/Basic/SourceManager.h | 10 | ||||
-rw-r--r-- | include/clang/Lex/Lexer.h | 14 | ||||
-rw-r--r-- | include/clang/Lex/Preprocessor.h | 12 |
3 files changed, 25 insertions, 11 deletions
diff --git a/include/clang/Basic/SourceManager.h b/include/clang/Basic/SourceManager.h index 33c66e7f7c..bd8f5ef6ef 100644 --- a/include/clang/Basic/SourceManager.h +++ b/include/clang/Basic/SourceManager.h @@ -832,16 +832,6 @@ public: return getFileCharacteristic(Loc) == SrcMgr::C_ExternCSystem; } - /// \brief Returns true if the given MacroID location points at the first - /// token of the macro instantiation. - bool isAtStartOfMacroInstantiation(SourceLocation Loc, - const LangOptions &LangOpts) const; - - /// \brief Returns true if the given MacroID location points at the last - /// token of the macro instantiation. - bool isAtEndOfMacroInstantiation(SourceLocation Loc, - const LangOptions &LangOpts) const; - /// \brief Given a specific chunk of a FileID (FileID with offset+length), /// returns true if \arg Loc is inside that chunk and sets relative offset /// (offset of \arg Loc from beginning of chunk) to \arg relativeOffset. diff --git a/include/clang/Lex/Lexer.h b/include/clang/Lex/Lexer.h index 7c3d863bd3..937e468034 100644 --- a/include/clang/Lex/Lexer.h +++ b/include/clang/Lex/Lexer.h @@ -293,7 +293,19 @@ public: static SourceLocation getLocForEndOfToken(SourceLocation Loc, unsigned Offset, const SourceManager &SM, const LangOptions &Features); - + + /// \brief Returns true if the given MacroID location points at the first + /// token of the macro instantiation. + static bool isAtStartOfMacroInstantiation(SourceLocation loc, + const SourceManager &SM, + const LangOptions &LangOpts); + + /// \brief Returns true if the given MacroID location points at the last + /// token of the macro instantiation. + static bool isAtEndOfMacroInstantiation(SourceLocation loc, + const SourceManager &SM, + const LangOptions &LangOpts); + /// \brief Compute the preamble of the given file. /// /// The preamble of a file contains the initial comments, include directives, diff --git a/include/clang/Lex/Preprocessor.h b/include/clang/Lex/Preprocessor.h index 56fc9d1727..e1ea37f241 100644 --- a/include/clang/Lex/Preprocessor.h +++ b/include/clang/Lex/Preprocessor.h @@ -753,6 +753,18 @@ public: return Lexer::getLocForEndOfToken(Loc, Offset, SourceMgr, Features); } + /// \brief Returns true if the given MacroID location points at the first + /// token of the macro instantiation. + bool isAtStartOfMacroInstantiation(SourceLocation loc) const { + return Lexer::isAtStartOfMacroInstantiation(loc, SourceMgr, Features); + } + + /// \brief Returns true if the given MacroID location points at the last + /// token of the macro instantiation. + bool isAtEndOfMacroInstantiation(SourceLocation loc) const { + return Lexer::isAtEndOfMacroInstantiation(loc, SourceMgr, Features); + } + /// DumpToken - Print the token to stderr, used for debugging. /// void DumpToken(const Token &Tok, bool DumpFlags = false) const; |