aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Basic/SourceManager.h
diff options
context:
space:
mode:
authorMatt Beaumont-Gay <matthewbg@google.com>2012-01-06 22:43:58 +0000
committerMatt Beaumont-Gay <matthewbg@google.com>2012-01-06 22:43:58 +0000
commitd87a0cd2b3e1c9e9f01212875f4cbe5b7bb7ab57 (patch)
tree6919ce0acbee739edf215e680d38e224d0c18c86 /include/clang/Basic/SourceManager.h
parentcd93b96bc51c255d104095bc6a6d8eac74a84b1e (diff)
Suppress -Wunused-value within macros from system headers.
Along the way, move a helper function from SemaChecking.cpp to a more accessible home in SourceManager. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147692 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/SourceManager.h')
-rw-r--r--include/clang/Basic/SourceManager.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/clang/Basic/SourceManager.h b/include/clang/Basic/SourceManager.h
index b1fb78ea56..038b8c65d0 100644
--- a/include/clang/Basic/SourceManager.h
+++ b/include/clang/Basic/SourceManager.h
@@ -1087,6 +1087,11 @@ public:
return getFileCharacteristic(Loc) == SrcMgr::C_ExternCSystem;
}
+ /// \brief Returns whether \p Loc is expanded from a macro in a system header.
+ bool isInSystemMacro(SourceLocation loc) {
+ return loc.isMacroID() && isInSystemHeader(getSpellingLoc(loc));
+ }
+
/// \brief The size of the SLocEnty that \p FID represents.
unsigned getFileIDSize(FileID FID) const;