aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Frontend/HeaderSearchOptions.h
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-11-07 04:20:50 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-11-07 04:20:50 +0000
commit63c8b77334f90472260d2f48df2742ed5067261e (patch)
tree5db87fbec28e7710ad9ac80d3bcd1b48d67b61cb /include/clang/Frontend/HeaderSearchOptions.h
parente166582f8f36f4db8f4ea157538fab7fe6bf2658 (diff)
Add HeaderSearchOptions class, for packaging the information needed to
initialize HeaderSearch. Not used yet. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86338 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Frontend/HeaderSearchOptions.h')
-rw-r--r--include/clang/Frontend/HeaderSearchOptions.h83
1 files changed, 83 insertions, 0 deletions
diff --git a/include/clang/Frontend/HeaderSearchOptions.h b/include/clang/Frontend/HeaderSearchOptions.h
new file mode 100644
index 0000000000..dc222c11cc
--- /dev/null
+++ b/include/clang/Frontend/HeaderSearchOptions.h
@@ -0,0 +1,83 @@
+//===--- HeaderSearchOptions.h ----------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_FRONTEND_HEADERSEARCHOPTIONS_H
+#define LLVM_CLANG_FRONTEND_HEADERSEARCHOPTIONS_H
+
+// FIXME: Drop this dependency.
+#include "clang/Frontend/InitHeaderSearch.h"
+#include "llvm/ADT/StringRef.h"
+
+namespace clang {
+
+/// HeaderSearchOptions - Helper class for storing options related to the
+/// initialization of the HeaderSearch object.
+class HeaderSearchOptions {
+public:
+ struct Entry {
+ std::string Path;
+ InitHeaderSearch::IncludeDirGroup Group;
+ unsigned IsCXXAware : 1;
+ unsigned IsUserSupplied : 1;
+ unsigned IsFramework : 1;
+ unsigned IgnoreSysRoot : 1;
+
+ Entry(llvm::StringRef _Path, InitHeaderSearch::IncludeDirGroup _Group,
+ bool _IsCXXAware, bool _IsUserSupplied, bool _IsFramework,
+ bool _IgnoreSysRoot)
+ : Path(_Path), Group(_Group), IsCXXAware(_IsCXXAware),
+ IsUserSupplied(_IsUserSupplied), IsFramework(_IsFramework),
+ IgnoreSysRoot(_IgnoreSysRoot) {}
+ };
+
+ /// If non-empty, the directory to use as a "virtual system root" for include
+ /// paths.
+ std::string Sysroot;
+
+ /// User specified include entries.
+ std::vector<Entry> UserEntries;
+
+ /// A (system-path) delimited list of include paths to be added from the
+ /// environment following the user specified includes (but prior to builtin
+ /// and standard includes). This is parsed in the same manner as the CPATH
+ /// environment variable for gcc.
+ std::string EnvIncPath;
+
+ /// A (system-path) delimited list of include paths to be added from the
+ /// environment following the user specified includes and the \see EnvIncPath
+ /// includes (but prior to builtin and standard includes). This is parsed in
+ /// the same manner as the CPATH environment variable for gcc.
+ std::string LangEnvIncPath;
+
+ /// If non-empty, the path to the compiler builtin include directory, which
+ /// will be searched following the user and environment includes.
+ std::string BuiltinIncludePath;
+
+ /// Include the system standard include search directories.
+ unsigned UseStandardIncludes : 1;
+
+ /// Whether header search information should be output as for -v.
+ unsigned Verbose : 1;
+
+public:
+ HeaderSearchOptions(llvm::StringRef _Sysroot)
+ : Sysroot(_Sysroot), UseStandardIncludes(true) {}
+
+ /// AddPath - Add the \arg Path path to the specified \arg Group list.
+ void AddPath(llvm::StringRef Path, InitHeaderSearch::IncludeDirGroup Group,
+ bool IsCXXAware, bool IsUserSupplied,
+ bool IsFramework, bool IgnoreSysRoot = false) {
+ UserEntries.push_back(Entry(Path, Group, IsCXXAware, IsUserSupplied,
+ IsFramework, IgnoreSysRoot));
+ }
+};
+
+} // end namespace clang
+
+#endif