diff options
Diffstat (limited to 'include/clang/Basic/SourceManager.h')
-rw-r--r-- | include/clang/Basic/SourceManager.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/clang/Basic/SourceManager.h b/include/clang/Basic/SourceManager.h index a2d7a59032..6aa5347231 100644 --- a/include/clang/Basic/SourceManager.h +++ b/include/clang/Basic/SourceManager.h @@ -329,6 +329,11 @@ namespace SrcMgr { SourceLocation::getFromRawEncoding(ExpansionLocEnd).isInvalid(); } + bool isMacroBodyExpansion() const { + return getExpansionLocStart().isValid() && + SourceLocation::getFromRawEncoding(ExpansionLocEnd).isValid(); + } + bool isFunctionMacroExpansion() const { return getExpansionLocStart().isValid() && getExpansionLocStart() != getExpansionLocEnd(); @@ -1126,6 +1131,13 @@ public: /// expanded. bool isMacroArgExpansion(SourceLocation Loc) const; + /// \brief Tests whether the given source location represents the expansion of + /// a macro body. + /// + /// This is equivalent to testing whether the location is part of a macro + /// expansion but not the expansion of an argument to a function-like macro. + bool isMacroBodyExpansion(SourceLocation Loc) const; + /// \brief Returns true if \p Loc is inside the [\p Start, +\p Length) /// chunk of the source location address space. /// |