diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-06-13 20:27:03 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-06-13 20:27:03 +0000 |
commit | f122a138e39dbb29162abfa9a3d44091d8efa7af (patch) | |
tree | 08459273e5a9442d2471a8f499d76c58341011bd /include/clang/Lex/HeaderSearch.h | |
parent | 8ab09da1faaa33b9fa78de59cc4e191bfe9907b5 (diff) |
Add -isystem-prefix and -ino-system-prefix arguments, which can be used to
override whether headers are system headers by checking for prefixes of the
header name specified in the #include directive.
This allows warnings to be disabled for third-party code which is found in
specific subdirectories of include paths.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158418 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Lex/HeaderSearch.h')
-rw-r--r-- | include/clang/Lex/HeaderSearch.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/clang/Lex/HeaderSearch.h b/include/clang/Lex/HeaderSearch.h index 5128ce6c11..e087e7190e 100644 --- a/include/clang/Lex/HeaderSearch.h +++ b/include/clang/Lex/HeaderSearch.h @@ -16,6 +16,7 @@ #include "clang/Lex/DirectoryLookup.h" #include "clang/Lex/ModuleMap.h" +#include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/StringMap.h" #include "llvm/ADT/StringSet.h" #include "llvm/Support/Allocator.h" @@ -144,6 +145,12 @@ class HeaderSearch { unsigned SystemDirIdx; bool NoCurDirSearch; + /// #include prefixes for which the 'system header' property is overridden. + /// For a #include "x" or #include <x> directive, the last string in this + /// list which is a prefix of 'x' determines whether the file is treated as + /// a system header. + std::vector<std::pair<std::string, bool> > SystemHeaderPrefixes; + /// \brief The path to the module cache. std::string ModuleCachePath; @@ -235,6 +242,11 @@ public: SystemDirIdx++; } + /// SetSystemHeaderPrefixes - Set the list of system header prefixes. + void SetSystemHeaderPrefixes(ArrayRef<std::pair<std::string, bool> > P) { + SystemHeaderPrefixes.assign(P.begin(), P.end()); + } + /// HasIncludeAliasMap - Checks whether the map exists or not bool HasIncludeAliasMap() const { return IncludeAliases; |