aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Lex/HeaderSearch.h
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2011-05-24 04:31:14 +0000
committerNico Weber <nicolasweber@gmx.de>2011-05-24 04:31:14 +0000
commit74a5fd8bcc68b540b58f6fcd2d80e6e926966e71 (patch)
tree9344d37c06747ce7349a5303df983b47f9be7e9d /include/clang/Lex/HeaderSearch.h
parent0f161593b36584ec447e5268dbed2953489854d8 (diff)
Make it possible for external tools to distinguish between paths that come from -I and paths that come from -system. Patch from Paul Holden!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131955 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Lex/HeaderSearch.h')
-rw-r--r--include/clang/Lex/HeaderSearch.h25
1 files changed, 22 insertions, 3 deletions
diff --git a/include/clang/Lex/HeaderSearch.h b/include/clang/Lex/HeaderSearch.h
index 3d99f15412..5e36d8e608 100644
--- a/include/clang/Lex/HeaderSearch.h
+++ b/include/clang/Lex/HeaderSearch.h
@@ -105,11 +105,12 @@ class HeaderSearch {
FileManager &FileMgr;
/// #include search path information. Requests for #include "x" search the
/// directory of the #including file first, then each directory in SearchDirs
- /// consequtively. Requests for <x> search the current dir first, then each
- /// directory in SearchDirs, starting at SystemDirIdx, consequtively. If
+ /// consecutively. Requests for <x> search the current dir first, then each
+ /// directory in SearchDirs, starting at AngledDirIdx, consecutively. If
/// NoCurDirSearch is true, then the check for the file in the current
/// directory is suppressed.
std::vector<DirectoryLookup> SearchDirs;
+ unsigned AngledDirIdx;
unsigned SystemDirIdx;
bool NoCurDirSearch;
@@ -160,8 +161,12 @@ public:
/// SetSearchPaths - Interface for setting the file search paths.
///
void SetSearchPaths(const std::vector<DirectoryLookup> &dirs,
- unsigned systemDirIdx, bool noCurDirSearch) {
+ unsigned angledDirIdx, unsigned systemDirIdx,
+ bool noCurDirSearch) {
+ assert(angledDirIdx <= systemDirIdx && systemDirIdx <= dirs.size() &&
+ "Directory indicies are unordered");
SearchDirs = dirs;
+ AngledDirIdx = angledDirIdx;
SystemDirIdx = systemDirIdx;
NoCurDirSearch = noCurDirSearch;
//LookupFileCache.clear();
@@ -298,6 +303,20 @@ public:
search_dir_iterator search_dir_end() const { return SearchDirs.end(); }
unsigned search_dir_size() const { return SearchDirs.size(); }
+ search_dir_iterator quoted_dir_begin() const {
+ return SearchDirs.begin();
+ }
+ search_dir_iterator quoted_dir_end() const {
+ return SearchDirs.begin() + AngledDirIdx;
+ }
+
+ search_dir_iterator angled_dir_begin() const {
+ return SearchDirs.begin() + AngledDirIdx;
+ }
+ search_dir_iterator angled_dir_end() const {
+ return SearchDirs.begin() + SystemDirIdx;
+ }
+
search_dir_iterator system_dir_begin() const {
return SearchDirs.begin() + SystemDirIdx;
}