Nico Weber | 0fca022 | 2008-08-22 09:25:22 +0000 | [diff] [blame] | 1 | //===--- InitHeaderSearch.cpp - Initialize header search paths ----------*-===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file implements the InitHeaderSearch class. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #include "clang/Driver/InitHeaderSearch.h" |
Nico Weber | 0fca022 | 2008-08-22 09:25:22 +0000 | [diff] [blame] | 15 | #include "clang/Lex/HeaderSearch.h" |
| 16 | #include "clang/Basic/FileManager.h" |
| 17 | #include "clang/Basic/LangOptions.h" |
| 18 | #include "llvm/ADT/SmallString.h" |
| 19 | #include "llvm/ADT/SmallPtrSet.h" |
| 20 | #include "llvm/System/Path.h" |
Argyrios Kyrtzidis | 121e3c2 | 2008-09-05 09:41:20 +0000 | [diff] [blame] | 21 | #include "llvm/Config/config.h" |
Nico Weber | 0fca022 | 2008-08-22 09:25:22 +0000 | [diff] [blame] | 22 | #include <vector> |
| 23 | |
| 24 | using namespace clang; |
| 25 | |
| 26 | void InitHeaderSearch::AddPath(const std::string &Path, IncludeDirGroup Group, |
| 27 | bool isCXXAware, bool isUserSupplied, |
| 28 | bool isFramework) { |
| 29 | assert(!Path.empty() && "can't handle empty path here"); |
| 30 | FileManager &FM = Headers.getFileMgr(); |
| 31 | |
| 32 | // Compute the actual path, taking into consideration -isysroot. |
| 33 | llvm::SmallString<256> MappedPath; |
| 34 | |
| 35 | // Handle isysroot. |
| 36 | if (Group == System) { |
| 37 | // FIXME: Portability. This should be a sys::Path interface, this doesn't |
| 38 | // handle things like C:\ right, nor win32 \\network\device\blah. |
| 39 | if (isysroot.size() != 1 || isysroot[0] != '/') // Add isysroot if present. |
| 40 | MappedPath.append(isysroot.begin(), isysroot.end()); |
| 41 | } |
| 42 | |
| 43 | MappedPath.append(Path.begin(), Path.end()); |
| 44 | |
| 45 | // Compute the DirectoryLookup type. |
Chris Lattner | 9d72851 | 2008-10-27 01:19:25 +0000 | [diff] [blame] | 46 | SrcMgr::CharacteristicKind Type; |
Nico Weber | 0fca022 | 2008-08-22 09:25:22 +0000 | [diff] [blame] | 47 | if (Group == Quoted || Group == Angled) |
Chris Lattner | 0b9e736 | 2008-09-26 21:18:42 +0000 | [diff] [blame] | 48 | Type = SrcMgr::C_User; |
Nico Weber | 0fca022 | 2008-08-22 09:25:22 +0000 | [diff] [blame] | 49 | else if (isCXXAware) |
Chris Lattner | 0b9e736 | 2008-09-26 21:18:42 +0000 | [diff] [blame] | 50 | Type = SrcMgr::C_System; |
Nico Weber | 0fca022 | 2008-08-22 09:25:22 +0000 | [diff] [blame] | 51 | else |
Chris Lattner | 0b9e736 | 2008-09-26 21:18:42 +0000 | [diff] [blame] | 52 | Type = SrcMgr::C_ExternCSystem; |
Nico Weber | 0fca022 | 2008-08-22 09:25:22 +0000 | [diff] [blame] | 53 | |
| 54 | |
| 55 | // If the directory exists, add it. |
| 56 | if (const DirectoryEntry *DE = FM.getDirectory(&MappedPath[0], |
| 57 | &MappedPath[0]+ |
| 58 | MappedPath.size())) { |
| 59 | IncludeGroup[Group].push_back(DirectoryLookup(DE, Type, isUserSupplied, |
| 60 | isFramework)); |
| 61 | return; |
| 62 | } |
| 63 | |
| 64 | // Check to see if this is an apple-style headermap (which are not allowed to |
| 65 | // be frameworks). |
| 66 | if (!isFramework) { |
| 67 | if (const FileEntry *FE = FM.getFile(&MappedPath[0], |
| 68 | &MappedPath[0]+MappedPath.size())) { |
| 69 | if (const HeaderMap *HM = Headers.CreateHeaderMap(FE)) { |
| 70 | // It is a headermap, add it to the search path. |
| 71 | IncludeGroup[Group].push_back(DirectoryLookup(HM, Type,isUserSupplied)); |
| 72 | return; |
| 73 | } |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | if (Verbose) |
| 78 | fprintf(stderr, "ignoring nonexistent directory \"%s\"\n", Path.c_str()); |
| 79 | } |
| 80 | |
| 81 | |
| 82 | void InitHeaderSearch::AddEnvVarPaths(const char *Name) { |
| 83 | const char* at = getenv(Name); |
Daniel Dunbar | bb95255 | 2008-10-04 20:58:18 +0000 | [diff] [blame] | 84 | if (!at || *at == 0) // Empty string should not add '.' path. |
Nico Weber | 0fca022 | 2008-08-22 09:25:22 +0000 | [diff] [blame] | 85 | return; |
| 86 | |
| 87 | const char* delim = strchr(at, llvm::sys::PathSeparator); |
| 88 | while (delim != 0) { |
| 89 | if (delim-at == 0) |
| 90 | AddPath(".", Angled, false, true, false); |
| 91 | else |
| 92 | AddPath(std::string(at, std::string::size_type(delim-at)), Angled, false, |
Chris Lattner | 7a73940 | 2008-09-26 17:46:45 +0000 | [diff] [blame] | 93 | true, false); |
Nico Weber | 0fca022 | 2008-08-22 09:25:22 +0000 | [diff] [blame] | 94 | at = delim + 1; |
| 95 | delim = strchr(at, llvm::sys::PathSeparator); |
| 96 | } |
| 97 | if (*at == 0) |
| 98 | AddPath(".", Angled, false, true, false); |
| 99 | else |
| 100 | AddPath(at, Angled, false, true, false); |
| 101 | } |
| 102 | |
| 103 | |
| 104 | void InitHeaderSearch::AddDefaultSystemIncludePaths(const LangOptions &Lang) { |
| 105 | // FIXME: temporary hack: hard-coded paths. |
| 106 | // FIXME: get these from the target? |
Argyrios Kyrtzidis | 121e3c2 | 2008-09-05 09:41:20 +0000 | [diff] [blame] | 107 | |
| 108 | #ifdef LLVM_ON_WIN32 |
| 109 | if (Lang.CPlusPlus) { |
| 110 | // Mingw32 GCC version 4 |
| 111 | AddPath("c:/mingw/lib/gcc/mingw32/4.3.0/include/c++", System, true, false, false); |
| 112 | AddPath("c:/mingw/lib/gcc/mingw32/4.3.0/include/c++/mingw32", System, true, false, false); |
| 113 | AddPath("c:/mingw/lib/gcc/mingw32/4.3.0/include/c++/backward", System, true, false, false); |
| 114 | } |
| 115 | |
| 116 | // Mingw32 GCC version 4 |
| 117 | AddPath("C:/mingw/lib/gcc/mingw32/4.3.0/include", System, false, false, false); |
| 118 | AddPath("C:/mingw/include", System, false, false, false); |
| 119 | #else |
| 120 | |
Nico Weber | 0fca022 | 2008-08-22 09:25:22 +0000 | [diff] [blame] | 121 | if (Lang.CPlusPlus) { |
| 122 | AddPath("/usr/include/c++/4.2.1", System, true, false, false); |
| 123 | AddPath("/usr/include/c++/4.2.1/i686-apple-darwin10", System, true, false, |
| 124 | false); |
| 125 | AddPath("/usr/include/c++/4.2.1/backward", System, true, false, false); |
| 126 | |
| 127 | AddPath("/usr/include/c++/4.0.0", System, true, false, false); |
| 128 | AddPath("/usr/include/c++/4.0.0/i686-apple-darwin8", System, true, false, |
| 129 | false); |
| 130 | AddPath("/usr/include/c++/4.0.0/backward", System, true, false, false); |
| 131 | |
| 132 | // Ubuntu 7.10 - Gutsy Gibbon |
| 133 | AddPath("/usr/include/c++/4.1.3", System, true, false, false); |
| 134 | AddPath("/usr/include/c++/4.1.3/i486-linux-gnu", System, true, false, |
| 135 | false); |
| 136 | AddPath("/usr/include/c++/4.1.3/backward", System, true, false, false); |
| 137 | |
| 138 | // Fedora 8 |
| 139 | AddPath("/usr/include/c++/4.1.2", System, true, false, false); |
| 140 | AddPath("/usr/include/c++/4.1.2/i386-redhat-linux", System, true, false, |
| 141 | false); |
| 142 | AddPath("/usr/include/c++/4.1.2/backward", System, true, false, false); |
| 143 | |
| 144 | // Fedora 9 |
| 145 | AddPath("/usr/include/c++/4.3.0", System, true, false, false); |
| 146 | AddPath("/usr/include/c++/4.3.0/i386-redhat-linux", System, true, false, |
| 147 | false); |
| 148 | AddPath("/usr/include/c++/4.3.0/backward", System, true, false, false); |
| 149 | |
Zhongxing Xu | 776caef | 2008-12-25 09:28:01 +0000 | [diff] [blame] | 150 | // Fedora 10 |
| 151 | AddPath("/usr/include/c++/4.3.2", System, true, false, false); |
| 152 | AddPath("/usr/include/c++/4.3.2/i386-redhat-linux", System, true, false, |
| 153 | false); |
| 154 | AddPath("/usr/include/c++/4.3.2/backward", System, true, false, false); |
| 155 | |
Nico Weber | 0fca022 | 2008-08-22 09:25:22 +0000 | [diff] [blame] | 156 | // Arch Linux 2008-06-24 |
| 157 | AddPath("/usr/include/c++/4.3.1", System, true, false, false); |
| 158 | AddPath("/usr/include/c++/4.3.1/i686-pc-linux-gnu", System, true, false, |
| 159 | false); |
| 160 | AddPath("/usr/include/c++/4.3.1/backward", System, true, false, false); |
| 161 | AddPath("/usr/include/c++/4.3.1/x86_64-unknown-linux-gnu", System, true, |
| 162 | false, false); |
Chris Lattner | 5654ffd | 2008-08-23 18:25:07 +0000 | [diff] [blame] | 163 | |
Nuno Lopes | a3d783b | 2008-12-07 12:11:37 +0000 | [diff] [blame] | 164 | // Gentoo x86 stable |
| 165 | AddPath("/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/g++-v4", System, |
| 166 | true, false, false); |
| 167 | AddPath("/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/g++-v4/" |
| 168 | "i686-pc-linux-gnu", System, true, false, false); |
| 169 | AddPath("/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/g++-v4/backward", |
| 170 | System, true, false, false); |
| 171 | |
| 172 | |
Chris Lattner | 5654ffd | 2008-08-23 18:25:07 +0000 | [diff] [blame] | 173 | // DragonFly |
| 174 | AddPath("/usr/include/c++/4.1", System, true, false, false); |
Nico Weber | 0fca022 | 2008-08-22 09:25:22 +0000 | [diff] [blame] | 175 | } |
| 176 | |
| 177 | AddPath("/usr/local/include", System, false, false, false); |
| 178 | |
| 179 | AddPath("/usr/lib/gcc/i686-apple-darwin10/4.2.1/include", System, |
| 180 | false, false, false); |
| 181 | AddPath("/usr/lib/gcc/powerpc-apple-darwin10/4.2.1/include", |
| 182 | System, false, false, false); |
| 183 | |
| 184 | // leopard |
| 185 | AddPath("/usr/lib/gcc/i686-apple-darwin9/4.0.1/include", System, |
| 186 | false, false, false); |
| 187 | AddPath("/usr/lib/gcc/powerpc-apple-darwin9/4.0.1/include", |
| 188 | System, false, false, false); |
| 189 | AddPath("/usr/lib/gcc/powerpc-apple-darwin9/" |
| 190 | "4.0.1/../../../../powerpc-apple-darwin0/include", |
| 191 | System, false, false, false); |
| 192 | |
| 193 | // tiger |
| 194 | AddPath("/usr/lib/gcc/i686-apple-darwin8/4.0.1/include", System, |
| 195 | false, false, false); |
| 196 | AddPath("/usr/lib/gcc/powerpc-apple-darwin8/4.0.1/include", |
| 197 | System, false, false, false); |
| 198 | AddPath("/usr/lib/gcc/powerpc-apple-darwin8/" |
| 199 | "4.0.1/../../../../powerpc-apple-darwin8/include", |
| 200 | System, false, false, false); |
| 201 | |
| 202 | // Ubuntu 7.10 - Gutsy Gibbon |
| 203 | AddPath("/usr/lib/gcc/i486-linux-gnu/4.1.3/include", System, |
| 204 | false, false, false); |
| 205 | |
| 206 | // Fedora 8 |
| 207 | AddPath("/usr/lib/gcc/i386-redhat-linux/4.1.2/include", System, |
| 208 | false, false, false); |
| 209 | |
| 210 | // Fedora 9 |
| 211 | AddPath("/usr/lib/gcc/i386-redhat-linux/4.3.0/include", System, |
| 212 | false, false, false); |
| 213 | |
Zhongxing Xu | 776caef | 2008-12-25 09:28:01 +0000 | [diff] [blame] | 214 | // Fedora 10 |
| 215 | AddPath("/usr/lib/gcc/i386-redhat-linux/4.3.2/include", System, |
| 216 | false, false, false); |
| 217 | |
Nico Weber | 0fca022 | 2008-08-22 09:25:22 +0000 | [diff] [blame] | 218 | //Debian testing/lenny x86 |
| 219 | AddPath("/usr/lib/gcc/i486-linux-gnu/4.2.3/include", System, |
| 220 | false, false, false); |
| 221 | |
| 222 | //Debian testing/lenny amd64 |
| 223 | AddPath("/usr/lib/gcc/x86_64-linux-gnu/4.2.3/include", System, |
| 224 | false, false, false); |
| 225 | |
Torok Edwin | f7ea67a | 2009-02-05 18:12:45 +0000 | [diff] [blame] | 226 | // Debian sid amd64 |
| 227 | AddPath("/usr/lib/gcc/x86_64-linux-gnu/4.3/include", System, |
| 228 | false, false, false); |
| 229 | AddPath("/usr/lib/gcc/x86_64-linux-gnu/4.3/include-fixed", |
| 230 | System, false, false, false); |
| 231 | |
Nico Weber | 0fca022 | 2008-08-22 09:25:22 +0000 | [diff] [blame] | 232 | // Arch Linux 2008-06-24 |
| 233 | AddPath("/usr/lib/gcc/i686-pc-linux-gnu/4.3.1/include", System, |
| 234 | false, false, false); |
| 235 | AddPath("/usr/lib/gcc/i686-pc-linux-gnu/4.3.1/include-fixed", System, |
| 236 | false, false, false); |
| 237 | AddPath("/usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.1/include", System, |
| 238 | false, false, false); |
| 239 | AddPath("/usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.1/include-fixed", |
| 240 | System, false, false, false); |
| 241 | |
| 242 | // Debian testing/lenny ppc32 |
| 243 | AddPath("/usr/lib/gcc/powerpc-linux-gnu/4.2.3/include", System, |
| 244 | false, false, false); |
| 245 | |
| 246 | // Gentoo x86 stable |
| 247 | AddPath("/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include", System, |
| 248 | false, false, false); |
| 249 | |
Chris Lattner | 5654ffd | 2008-08-23 18:25:07 +0000 | [diff] [blame] | 250 | // DragonFly |
| 251 | AddPath("/usr/libdata/gcc41", System, true, false, false); |
| 252 | |
Nico Weber | 0fca022 | 2008-08-22 09:25:22 +0000 | [diff] [blame] | 253 | AddPath("/usr/include", System, false, false, false); |
| 254 | AddPath("/System/Library/Frameworks", System, true, false, true); |
| 255 | AddPath("/Library/Frameworks", System, true, false, true); |
Argyrios Kyrtzidis | 121e3c2 | 2008-09-05 09:41:20 +0000 | [diff] [blame] | 256 | |
| 257 | #endif |
Nico Weber | 0fca022 | 2008-08-22 09:25:22 +0000 | [diff] [blame] | 258 | } |
| 259 | |
| 260 | void InitHeaderSearch::AddDefaultEnvVarPaths(const LangOptions &Lang) { |
| 261 | AddEnvVarPaths("CPATH"); |
| 262 | if (Lang.CPlusPlus && Lang.ObjC1) |
| 263 | AddEnvVarPaths("OBJCPLUS_INCLUDE_PATH"); |
| 264 | else if (Lang.CPlusPlus) |
| 265 | AddEnvVarPaths("CPLUS_INCLUDE_PATH"); |
| 266 | else if (Lang.ObjC1) |
| 267 | AddEnvVarPaths("OBJC_INCLUDE_PATH"); |
| 268 | else |
| 269 | AddEnvVarPaths("C_INCLUDE_PATH"); |
| 270 | } |
| 271 | |
| 272 | |
| 273 | /// RemoveDuplicates - If there are duplicate directory entries in the specified |
| 274 | /// search list, remove the later (dead) ones. |
| 275 | static void RemoveDuplicates(std::vector<DirectoryLookup> &SearchList, |
| 276 | bool Verbose) { |
| 277 | llvm::SmallPtrSet<const DirectoryEntry *, 8> SeenDirs; |
| 278 | llvm::SmallPtrSet<const DirectoryEntry *, 8> SeenFrameworkDirs; |
| 279 | llvm::SmallPtrSet<const HeaderMap *, 8> SeenHeaderMaps; |
| 280 | for (unsigned i = 0; i != SearchList.size(); ++i) { |
Chris Lattner | 7a73940 | 2008-09-26 17:46:45 +0000 | [diff] [blame] | 281 | unsigned DirToRemove = i; |
| 282 | |
Nico Weber | 0fca022 | 2008-08-22 09:25:22 +0000 | [diff] [blame] | 283 | if (SearchList[i].isNormalDir()) { |
| 284 | // If this isn't the first time we've seen this dir, remove it. |
| 285 | if (SeenDirs.insert(SearchList[i].getDir())) |
| 286 | continue; |
Nico Weber | 0fca022 | 2008-08-22 09:25:22 +0000 | [diff] [blame] | 287 | } else if (SearchList[i].isFramework()) { |
| 288 | // If this isn't the first time we've seen this framework dir, remove it. |
| 289 | if (SeenFrameworkDirs.insert(SearchList[i].getFrameworkDir())) |
| 290 | continue; |
Nico Weber | 0fca022 | 2008-08-22 09:25:22 +0000 | [diff] [blame] | 291 | } else { |
| 292 | assert(SearchList[i].isHeaderMap() && "Not a headermap or normal dir?"); |
| 293 | // If this isn't the first time we've seen this headermap, remove it. |
| 294 | if (SeenHeaderMaps.insert(SearchList[i].getHeaderMap())) |
| 295 | continue; |
Chris Lattner | 30f05b5 | 2009-02-08 00:55:22 +0000 | [diff] [blame^] | 296 | } |
| 297 | |
| 298 | // If we have a normal #include dir/framework/headermap that is shadowed |
| 299 | // later in the chain by a system include location, we actually want to |
| 300 | // ignore the user's request and drop the user dir... keeping the system |
| 301 | // dir. This is weird, but required to emulate GCC's search path correctly. |
| 302 | // |
| 303 | // Since dupes of system dirs are rare, just rescan to find the original |
| 304 | // that we're nuking instead of using a DenseMap. |
| 305 | if (SearchList[i].getDirCharacteristic() != SrcMgr::C_User) { |
| 306 | // Find the dir that this is the same of. |
| 307 | unsigned FirstDir; |
| 308 | for (FirstDir = 0; ; ++FirstDir) { |
| 309 | assert(FirstDir != i && "Didn't find dupe?"); |
| 310 | |
| 311 | // If these are different lookup types, then they can't be the dupe. |
| 312 | if (SearchList[FirstDir].getLookupType() != |
| 313 | SearchList[i].getLookupType()) |
| 314 | continue; |
| 315 | |
| 316 | bool isSame; |
| 317 | if (SearchList[i].isNormalDir()) |
| 318 | isSame = SearchList[FirstDir].getDir() == SearchList[i].getDir(); |
| 319 | else if (SearchList[i].isFramework()) |
| 320 | isSame = SearchList[FirstDir].getFrameworkDir() == |
| 321 | SearchList[i].getFrameworkDir(); |
| 322 | else { |
| 323 | assert(SearchList[i].isHeaderMap() && "Not a headermap or normal dir?"); |
| 324 | isSame = SearchList[FirstDir].getHeaderMap() == |
| 325 | SearchList[i].getHeaderMap(); |
| 326 | } |
| 327 | |
| 328 | if (isSame) |
| 329 | break; |
| 330 | } |
Nico Weber | 0fca022 | 2008-08-22 09:25:22 +0000 | [diff] [blame] | 331 | |
Chris Lattner | 30f05b5 | 2009-02-08 00:55:22 +0000 | [diff] [blame^] | 332 | // If the first dir in the search path is a non-system dir, zap it |
| 333 | // instead of the system one. |
| 334 | if (SearchList[FirstDir].getDirCharacteristic() == SrcMgr::C_User) |
| 335 | DirToRemove = FirstDir; |
| 336 | } |
| 337 | |
| 338 | if (Verbose) { |
| 339 | fprintf(stderr, "ignoring duplicate directory \"%s\"\n", |
| 340 | SearchList[i].getName()); |
| 341 | if (DirToRemove != i) |
| 342 | fprintf(stderr, " as it is a non-system directory that duplicates" |
| 343 | " a system directory\n"); |
Nico Weber | 0fca022 | 2008-08-22 09:25:22 +0000 | [diff] [blame] | 344 | } |
| 345 | |
Chris Lattner | 7a73940 | 2008-09-26 17:46:45 +0000 | [diff] [blame] | 346 | // This is reached if the current entry is a duplicate. Remove the |
| 347 | // DirToRemove (usually the current dir). |
| 348 | SearchList.erase(SearchList.begin()+DirToRemove); |
Nico Weber | 0fca022 | 2008-08-22 09:25:22 +0000 | [diff] [blame] | 349 | --i; |
| 350 | } |
| 351 | } |
| 352 | |
| 353 | |
| 354 | void InitHeaderSearch::Realize() { |
| 355 | // Concatenate ANGLE+SYSTEM+AFTER chains together into SearchList. |
| 356 | std::vector<DirectoryLookup> SearchList; |
| 357 | SearchList = IncludeGroup[Angled]; |
| 358 | SearchList.insert(SearchList.end(), IncludeGroup[System].begin(), |
| 359 | IncludeGroup[System].end()); |
| 360 | SearchList.insert(SearchList.end(), IncludeGroup[After].begin(), |
| 361 | IncludeGroup[After].end()); |
| 362 | RemoveDuplicates(SearchList, Verbose); |
| 363 | RemoveDuplicates(IncludeGroup[Quoted], Verbose); |
| 364 | |
| 365 | // Prepend QUOTED list on the search list. |
| 366 | SearchList.insert(SearchList.begin(), IncludeGroup[Quoted].begin(), |
| 367 | IncludeGroup[Quoted].end()); |
| 368 | |
| 369 | |
| 370 | bool DontSearchCurDir = false; // TODO: set to true if -I- is set? |
| 371 | Headers.SetSearchPaths(SearchList, IncludeGroup[Quoted].size(), |
| 372 | DontSearchCurDir); |
| 373 | |
| 374 | // If verbose, print the list of directories that will be searched. |
| 375 | if (Verbose) { |
| 376 | fprintf(stderr, "#include \"...\" search starts here:\n"); |
| 377 | unsigned QuotedIdx = IncludeGroup[Quoted].size(); |
| 378 | for (unsigned i = 0, e = SearchList.size(); i != e; ++i) { |
| 379 | if (i == QuotedIdx) |
| 380 | fprintf(stderr, "#include <...> search starts here:\n"); |
| 381 | const char *Name = SearchList[i].getName(); |
| 382 | const char *Suffix; |
| 383 | if (SearchList[i].isNormalDir()) |
| 384 | Suffix = ""; |
| 385 | else if (SearchList[i].isFramework()) |
| 386 | Suffix = " (framework directory)"; |
| 387 | else { |
| 388 | assert(SearchList[i].isHeaderMap() && "Unknown DirectoryLookup"); |
| 389 | Suffix = " (headermap)"; |
| 390 | } |
| 391 | fprintf(stderr, " %s%s\n", Name, Suffix); |
| 392 | } |
| 393 | fprintf(stderr, "End of search list.\n"); |
| 394 | } |
| 395 | } |
| 396 | |