diff options
Diffstat (limited to 'include/clang/Frontend/HeaderSearchOptions.h')
-rw-r--r-- | include/clang/Frontend/HeaderSearchOptions.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/include/clang/Frontend/HeaderSearchOptions.h b/include/clang/Frontend/HeaderSearchOptions.h index 687f439fe1..bdd26232c0 100644 --- a/include/clang/Frontend/HeaderSearchOptions.h +++ b/include/clang/Frontend/HeaderSearchOptions.h @@ -69,6 +69,18 @@ public: IsInternal(isInternal), ImplicitExternC(implicitExternC) {} }; + struct SystemHeaderPrefix { + /// A prefix to be matched against paths in #include directives. + std::string Prefix; + + /// True if paths beginning with this prefix should be treated as system + /// headers. + bool IsSystemHeader; + + SystemHeaderPrefix(StringRef Prefix, bool IsSystemHeader) + : Prefix(Prefix), IsSystemHeader(IsSystemHeader) {} + }; + /// If non-empty, the directory to use as a "virtual system root" for include /// paths. std::string Sysroot; @@ -76,6 +88,9 @@ public: /// User specified include entries. std::vector<Entry> UserEntries; + /// User-specified system header prefixes. + std::vector<SystemHeaderPrefix> SystemHeaderPrefixes; + /// The directory which holds the compiler resource files (builtin includes, /// etc.). std::string ResourceDir; @@ -117,6 +132,13 @@ public: UserEntries.push_back(Entry(Path, Group, IsUserSupplied, IsFramework, IgnoreSysRoot, IsInternal, ImplicitExternC)); } + + /// AddSystemHeaderPrefix - Override whether #include directives naming a + /// path starting with \arg Prefix should be considered as naming a system + /// header. + void AddSystemHeaderPrefix(StringRef Prefix, bool IsSystemHeader) { + SystemHeaderPrefixes.push_back(SystemHeaderPrefix(Prefix, IsSystemHeader)); + } }; } // end namespace clang |