InitHeaderSearch.cpp revision 5c5758bb0a4ec0f572cd20249277736da5715003
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/Frontend/InitHeaderSearch.h" 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/Support/raw_ostream.h" 21#include "llvm/System/Path.h" 22#include "llvm/Config/config.h" 23#include <cstdio> 24#ifdef _MSC_VER 25 #define WIN32_LEAN_AND_MEAN 1 26 #include <windows.h> 27#endif 28using namespace clang; 29 30void InitHeaderSearch::AddPath(const llvm::StringRef &Path, 31 IncludeDirGroup Group, bool isCXXAware, 32 bool isUserSupplied, bool isFramework, 33 bool IgnoreSysRoot) { 34 assert(!Path.empty() && "can't handle empty path here"); 35 FileManager &FM = Headers.getFileMgr(); 36 37 // Compute the actual path, taking into consideration -isysroot. 38 llvm::SmallString<256> MappedPath; 39 40 // Handle isysroot. 41 if (Group == System && !IgnoreSysRoot) { 42 // FIXME: Portability. This should be a sys::Path interface, this doesn't 43 // handle things like C:\ right, nor win32 \\network\device\blah. 44 if (isysroot.size() != 1 || isysroot[0] != '/') // Add isysroot if present. 45 MappedPath.append(isysroot.begin(), isysroot.end()); 46 } 47 48 MappedPath.append(Path.begin(), Path.end()); 49 50 // Compute the DirectoryLookup type. 51 SrcMgr::CharacteristicKind Type; 52 if (Group == Quoted || Group == Angled) 53 Type = SrcMgr::C_User; 54 else if (isCXXAware) 55 Type = SrcMgr::C_System; 56 else 57 Type = SrcMgr::C_ExternCSystem; 58 59 60 // If the directory exists, add it. 61 if (const DirectoryEntry *DE = FM.getDirectory(MappedPath.str())) { 62 IncludeGroup[Group].push_back(DirectoryLookup(DE, Type, isUserSupplied, 63 isFramework)); 64 return; 65 } 66 67 // Check to see if this is an apple-style headermap (which are not allowed to 68 // be frameworks). 69 if (!isFramework) { 70 if (const FileEntry *FE = FM.getFile(MappedPath.str())) { 71 if (const HeaderMap *HM = Headers.CreateHeaderMap(FE)) { 72 // It is a headermap, add it to the search path. 73 IncludeGroup[Group].push_back(DirectoryLookup(HM, Type,isUserSupplied)); 74 return; 75 } 76 } 77 } 78 79 if (Verbose) 80 llvm::errs() << "ignoring nonexistent directory \"" 81 << MappedPath.str() << "\"\n"; 82} 83 84 85void InitHeaderSearch::AddEnvVarPaths(const char *Name) { 86 const char* at = getenv(Name); 87 if (!at || *at == 0) // Empty string should not add '.' path. 88 return; 89 90 const char* delim = strchr(at, llvm::sys::PathSeparator); 91 while (delim != 0) { 92 if (delim-at == 0) 93 AddPath(".", Angled, false, true, false); 94 else 95 AddPath(llvm::StringRef(at, delim-at), Angled, false, true, false); 96 at = delim + 1; 97 delim = strchr(at, llvm::sys::PathSeparator); 98 } 99 if (*at == 0) 100 AddPath(".", Angled, false, true, false); 101 else 102 AddPath(at, Angled, false, true, false); 103} 104 105void InitHeaderSearch::AddGnuCPlusPlusIncludePaths(const std::string &Base, 106 const char *Dir32, 107 const char *Dir64, 108 const llvm::Triple &triple) { 109 llvm::Triple::ArchType arch = triple.getArch(); 110 bool is64bit = arch == llvm::Triple::ppc64 || arch == llvm::Triple::x86_64; 111 112 AddPath(Base, System, true, false, false); 113 if (is64bit) 114 AddPath(Base + "/" + Dir64, System, true, false, false); 115 else 116 AddPath(Base + "/" + Dir32, System, true, false, false); 117 AddPath(Base + "/backward", System, true, false, false); 118} 119 120void InitHeaderSearch::AddMinGWCPlusPlusIncludePaths(const std::string &Base, 121 const char *Arch, 122 const char *Version) { 123 std::string localBase = Base + "/" + Arch + "/" + Version + "/include"; 124 AddPath(localBase, System, true, false, false); 125 AddPath(localBase + "/c++", System, true, false, false); 126 AddPath(localBase + "/c++/backward", System, true, false, false); 127} 128 129 // FIXME: This probably should goto to some platform utils place. 130#ifdef _MSC_VER 131 // Read registry string. 132bool getSystemRegistryString(const char *keyPath, const char *valueName, 133 char *value, size_t maxLength) { 134 HKEY hRootKey = NULL; 135 HKEY hKey = NULL; 136 const char* subKey = NULL; 137 DWORD valueType; 138 DWORD valueSize = maxLength - 1; 139 bool returnValue = false; 140 if (strncmp(keyPath, "HKEY_CLASSES_ROOT\\", 18) == 0) { 141 hRootKey = HKEY_CLASSES_ROOT; 142 subKey = keyPath + 18; 143 } 144 else if (strncmp(keyPath, "HKEY_USERS\\", 11) == 0) { 145 hRootKey = HKEY_USERS; 146 subKey = keyPath + 11; 147 } 148 else if (strncmp(keyPath, "HKEY_LOCAL_MACHINE\\", 19) == 0) { 149 hRootKey = HKEY_LOCAL_MACHINE; 150 subKey = keyPath + 19; 151 } 152 else if (strncmp(keyPath, "HKEY_CURRENT_USER\\", 18) == 0) { 153 hRootKey = HKEY_CURRENT_USER; 154 subKey = keyPath + 18; 155 } 156 else 157 return(false); 158 long lResult = RegOpenKeyEx(hRootKey, subKey, 0, KEY_READ, &hKey); 159 if (lResult == ERROR_SUCCESS) { 160 lResult = RegQueryValueEx(hKey, valueName, NULL, &valueType, 161 (LPBYTE)value, &valueSize); 162 if (lResult == ERROR_SUCCESS) 163 returnValue = true; 164 RegCloseKey(hKey); 165 } 166 return(returnValue); 167} 168#else // _MSC_VER 169 // Read registry string. 170bool getSystemRegistryString(const char *, const char *, char *, size_t) { 171 return(false); 172} 173#endif // _MSC_VER 174 175 // Get Visual Studio installation directory. 176bool getVisualStudioDir(std::string &path) { 177 // Try the Windows registry first. 178 char vs80IDEInstallDir[256]; 179 char vs90IDEInstallDir[256]; 180 const char* vsIDEInstallDir = NULL; 181 bool has80 = getSystemRegistryString( 182 "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0", 183 "InstallDir", vs80IDEInstallDir, sizeof(vs80IDEInstallDir) - 1); 184 bool has90 = getSystemRegistryString( 185 "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0", 186 "InstallDir", vs90IDEInstallDir, sizeof(vs90IDEInstallDir) - 1); 187 // If we have both vc80 and vc90, pick version we were compiled with. 188 if (has80 && has90) { 189 #ifdef _MSC_VER 190 #if (_MSC_VER >= 1500) // VC90 191 vsIDEInstallDir = vs90IDEInstallDir; 192 #elif (_MSC_VER == 1400) // VC80 193 vsIDEInstallDir = vs80IDEInstallDir; 194 #else 195 vsIDEInstallDir = vs90IDEInstallDir; 196 #endif 197 #else 198 vsIDEInstallDir = vs90IDEInstallDir; 199 #endif 200 } 201 else if (has90) 202 vsIDEInstallDir = vs90IDEInstallDir; 203 else if (has80) 204 vsIDEInstallDir = vs80IDEInstallDir; 205 if (vsIDEInstallDir && *vsIDEInstallDir) { 206 char *p = (char*)strstr(vsIDEInstallDir, "\\Common7\\IDE"); 207 if (p) 208 *p = '\0'; 209 path = vsIDEInstallDir; 210 return(true); 211 } 212 else { 213 // Try the environment. 214 const char* vs90comntools = getenv("VS90COMNTOOLS"); 215 const char* vs80comntools = getenv("VS80COMNTOOLS"); 216 const char* vscomntools = NULL; 217 // If we have both vc80 and vc90, pick version we were compiled with. 218 if (vs90comntools && vs80comntools) { 219 #if (_MSC_VER >= 1500) // VC90 220 vscomntools = vs90comntools; 221 #elif (_MSC_VER == 1400) // VC80 222 vscomntools = vs80comntools; 223 #else 224 vscomntools = vs90comntools; 225 #endif 226 } 227 else if (vs90comntools) 228 vscomntools = vs90comntools; 229 else if (vs80comntools) 230 vscomntools = vs80comntools; 231 if (vscomntools && *vscomntools) { 232 char *p = (char*)strstr(vscomntools, "\\Common7\\Tools"); 233 if (p) 234 *p = '\0'; 235 path = vscomntools; 236 return(true); 237 } 238 else 239 return(false); 240 } 241 return(false); 242} 243 244void InitHeaderSearch::AddDefaultCIncludePaths(const llvm::Triple &triple) { 245 // FIXME: temporary hack: hard-coded paths. 246 llvm::Triple::OSType os = triple.getOS(); 247 switch (os) { 248 case llvm::Triple::Win32: 249 { 250 std::string VSDir; 251 if (getVisualStudioDir(VSDir)) { 252 AddPath(VSDir + "\\VC\\include", System, false, false, false); 253 AddPath(VSDir + "\\VC\\PlatformSDK\\Include", 254 System, false, false, false); 255 } 256 else { 257 // Default install paths. 258 AddPath("C:/Program Files/Microsoft Visual Studio 9.0/VC/include", 259 System, false, false, false); 260 AddPath( 261 "C:/Program Files/Microsoft Visual Studio 9.0/VC/PlatformSDK/Include", 262 System, false, false, false); 263 AddPath("C:/Program Files/Microsoft Visual Studio 8/VC/include", 264 System, false, false, false); 265 AddPath( 266 "C:/Program Files/Microsoft Visual Studio 8/VC/PlatformSDK/Include", 267 System, false, false, false); 268 // For some clang developers. 269 AddPath("G:/Program Files/Microsoft Visual Studio 9.0/VC/include", 270 System, false, false, false); 271 AddPath( 272 "G:/Program Files/Microsoft Visual Studio 9.0/VC/PlatformSDK/Include", 273 System, false, false, false); 274 } 275 } 276 break; 277 case llvm::Triple::MinGW64: 278 case llvm::Triple::MinGW32: 279 AddPath("c:/mingw/include", System, true, false, false); 280 break; 281 default: 282 break; 283 } 284 285 AddPath("/usr/local/include", System, false, false, false); 286 AddPath("/usr/include", System, false, false, false); 287} 288 289void InitHeaderSearch::AddDefaultCPlusPlusIncludePaths(const llvm::Triple &triple) { 290 llvm::Triple::OSType os = triple.getOS(); 291 // FIXME: temporary hack: hard-coded paths. 292 switch (os) { 293 case llvm::Triple::Cygwin: 294 AddPath("/lib/gcc/i686-pc-cygwin/3.4.4/include", 295 System, true, false, false); 296 AddPath("/lib/gcc/i686-pc-cygwin/3.4.4/include/c++", 297 System, true, false, false); 298 break; 299 case llvm::Triple::MinGW64: 300 // Try gcc 4.4.0 301 AddMinGWCPlusPlusIncludePaths("c:/MinGW/lib/gcc", "mingw64", "4.4.0"); 302 // Try gcc 4.3.0 303 AddMinGWCPlusPlusIncludePaths("c:/MinGW/lib/gcc", "mingw64", "4.3.0"); 304 // Fall through. 305 case llvm::Triple::MinGW32: 306 // Try gcc 4.4.0 307 AddMinGWCPlusPlusIncludePaths("c:/MinGW/lib/gcc", "mingw32", "4.4.0"); 308 // Try gcc 4.3.0 309 AddMinGWCPlusPlusIncludePaths("c:/MinGW/lib/gcc", "mingw32", "4.3.0"); 310 break; 311 case llvm::Triple::Darwin: 312 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.2.1", 313 "i686-apple-darwin10", 314 "i686-apple-darwin10/x86_64", 315 triple); 316 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.0.0", 317 "i686-apple-darwin8", 318 "i686-apple-darwin8", 319 triple); 320 break; 321 case llvm::Triple::Linux: 322 // Ubuntu 7.10 - Gutsy Gibbon 323 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.1.3", 324 "i486-linux-gnu", 325 "i486-linux-gnu", 326 triple); 327 // Ubuntu 9.04 328 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.3.3", 329 "x86_64-linux-gnu/32", 330 "x86_64-linux-gnu", 331 triple); 332 // Ubuntu 9.10 333 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.4.1", 334 "x86_64-linux-gnu/32", 335 "x86_64-linux-gnu", 336 triple); 337 // Fedora 8 338 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.1.2", 339 "i386-redhat-linux", 340 "i386-redhat-linux", 341 triple); 342 // Fedora 9 343 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.3.0", 344 "i386-redhat-linux", 345 "i386-redhat-linux", 346 triple); 347 // Fedora 10 348 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.3.2", 349 "i386-redhat-linux", 350 "i386-redhat-linux", 351 triple); 352 // openSUSE 11.1 32 bit 353 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.3", 354 "i586-suse-linux", 355 "i586-suse-linux", 356 triple); 357 // openSUSE 11.1 64 bit 358 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.3", 359 "x86_64-suse-linux/32", 360 "x86_64-suse-linux", 361 triple); 362 // openSUSE 11.2 363 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.4", 364 "i586-suse-linux", 365 "i586-suse-linux", 366 triple); 367 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.4", 368 "x86_64-suse-linux", 369 "x86_64-suse-linux", 370 triple); 371 // Arch Linux 2008-06-24 372 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.3.1", 373 "i686-pc-linux-gnu", 374 "i686-pc-linux-gnu", 375 triple); 376 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.3.1", 377 "x86_64-unknown-linux-gnu", 378 "x86_64-unknown-linux-gnu", 379 triple); 380 // Gentoo x86 2009.1 stable 381 AddGnuCPlusPlusIncludePaths( 382 "/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4", 383 "i686-pc-linux-gnu", 384 "i686-pc-linux-gnu", 385 triple); 386 // Gentoo x86 2009.0 stable 387 AddGnuCPlusPlusIncludePaths( 388 "/usr/lib/gcc/i686-pc-linux-gnu/4.3.2/include/g++-v4", 389 "i686-pc-linux-gnu", 390 "i686-pc-linux-gnu", 391 triple); 392 // Gentoo x86 2008.0 stable 393 AddGnuCPlusPlusIncludePaths( 394 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/g++-v4", 395 "i686-pc-linux-gnu", 396 "i686-pc-linux-gnu", 397 triple); 398 // Ubuntu 8.10 399 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.3", 400 "i486-pc-linux-gnu", 401 "i486-pc-linux-gnu", 402 triple); 403 // Ubuntu 9.04 404 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.3", 405 "i486-linux-gnu", 406 "i486-linux-gnu", 407 triple); 408 // Gentoo amd64 stable 409 AddGnuCPlusPlusIncludePaths( 410 "/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.2/include/g++-v4", 411 "i686-pc-linux-gnu", 412 "i686-pc-linux-gnu", 413 triple); 414 // Exherbo (2009-10-26) 415 AddGnuCPlusPlusIncludePaths( 416 "/usr/include/c++/4.4.2", 417 "x86_64-pc-linux-gnu/32", 418 "x86_64-pc-linux-gnu", 419 triple); 420 AddGnuCPlusPlusIncludePaths( 421 "/usr/include/c++/4.4.2", 422 "i686-pc-linux-gnu", 423 "i686-pc-linux-gnu", 424 triple); 425 break; 426 case llvm::Triple::FreeBSD: 427 // DragonFly 428 AddPath("/usr/include/c++/4.1", System, true, false, false); 429 // FreeBSD 430 AddPath("/usr/include/c++/4.2", System, true, false, false); 431 break; 432 case llvm::Triple::Solaris: 433 // Solaris - Fall though.. 434 case llvm::Triple::AuroraUX: 435 // AuroraUX 436 AddGnuCPlusPlusIncludePaths("/opt/gcc4/include/c++/4.2.4", 437 "i386-pc-solaris2.11", 438 "i386-pc-solaris2.11", 439 triple); 440 break; 441 default: 442 break; 443 } 444} 445 446void InitHeaderSearch::AddDefaultFrameworkIncludePaths(const llvm::Triple &triple) { 447 llvm::Triple::OSType os = triple.getOS(); 448 if (os != llvm::Triple::Darwin) 449 return; 450 AddPath("/System/Library/Frameworks", System, true, false, true); 451 AddPath("/Library/Frameworks", System, true, false, true); 452} 453 454void InitHeaderSearch::AddDefaultSystemIncludePaths(const LangOptions &Lang, 455 const llvm::Triple &triple) { 456 AddDefaultCIncludePaths(triple); 457 AddDefaultFrameworkIncludePaths(triple); 458 if (Lang.CPlusPlus) 459 AddDefaultCPlusPlusIncludePaths(triple); 460} 461 462void InitHeaderSearch::AddDefaultEnvVarPaths(const LangOptions &Lang) { 463 AddEnvVarPaths("CPATH"); 464 if (Lang.CPlusPlus && Lang.ObjC1) 465 AddEnvVarPaths("OBJCPLUS_INCLUDE_PATH"); 466 else if (Lang.CPlusPlus) 467 AddEnvVarPaths("CPLUS_INCLUDE_PATH"); 468 else if (Lang.ObjC1) 469 AddEnvVarPaths("OBJC_INCLUDE_PATH"); 470 else 471 AddEnvVarPaths("C_INCLUDE_PATH"); 472} 473 474 475/// RemoveDuplicates - If there are duplicate directory entries in the specified 476/// search list, remove the later (dead) ones. 477static void RemoveDuplicates(std::vector<DirectoryLookup> &SearchList, 478 bool Verbose) { 479 llvm::SmallPtrSet<const DirectoryEntry *, 8> SeenDirs; 480 llvm::SmallPtrSet<const DirectoryEntry *, 8> SeenFrameworkDirs; 481 llvm::SmallPtrSet<const HeaderMap *, 8> SeenHeaderMaps; 482 for (unsigned i = 0; i != SearchList.size(); ++i) { 483 unsigned DirToRemove = i; 484 485 const DirectoryLookup &CurEntry = SearchList[i]; 486 487 if (CurEntry.isNormalDir()) { 488 // If this isn't the first time we've seen this dir, remove it. 489 if (SeenDirs.insert(CurEntry.getDir())) 490 continue; 491 } else if (CurEntry.isFramework()) { 492 // If this isn't the first time we've seen this framework dir, remove it. 493 if (SeenFrameworkDirs.insert(CurEntry.getFrameworkDir())) 494 continue; 495 } else { 496 assert(CurEntry.isHeaderMap() && "Not a headermap or normal dir?"); 497 // If this isn't the first time we've seen this headermap, remove it. 498 if (SeenHeaderMaps.insert(CurEntry.getHeaderMap())) 499 continue; 500 } 501 502 // If we have a normal #include dir/framework/headermap that is shadowed 503 // later in the chain by a system include location, we actually want to 504 // ignore the user's request and drop the user dir... keeping the system 505 // dir. This is weird, but required to emulate GCC's search path correctly. 506 // 507 // Since dupes of system dirs are rare, just rescan to find the original 508 // that we're nuking instead of using a DenseMap. 509 if (CurEntry.getDirCharacteristic() != SrcMgr::C_User) { 510 // Find the dir that this is the same of. 511 unsigned FirstDir; 512 for (FirstDir = 0; ; ++FirstDir) { 513 assert(FirstDir != i && "Didn't find dupe?"); 514 515 const DirectoryLookup &SearchEntry = SearchList[FirstDir]; 516 517 // If these are different lookup types, then they can't be the dupe. 518 if (SearchEntry.getLookupType() != CurEntry.getLookupType()) 519 continue; 520 521 bool isSame; 522 if (CurEntry.isNormalDir()) 523 isSame = SearchEntry.getDir() == CurEntry.getDir(); 524 else if (CurEntry.isFramework()) 525 isSame = SearchEntry.getFrameworkDir() == CurEntry.getFrameworkDir(); 526 else { 527 assert(CurEntry.isHeaderMap() && "Not a headermap or normal dir?"); 528 isSame = SearchEntry.getHeaderMap() == CurEntry.getHeaderMap(); 529 } 530 531 if (isSame) 532 break; 533 } 534 535 // If the first dir in the search path is a non-system dir, zap it 536 // instead of the system one. 537 if (SearchList[FirstDir].getDirCharacteristic() == SrcMgr::C_User) 538 DirToRemove = FirstDir; 539 } 540 541 if (Verbose) { 542 fprintf(stderr, "ignoring duplicate directory \"%s\"\n", 543 CurEntry.getName()); 544 if (DirToRemove != i) 545 fprintf(stderr, " as it is a non-system directory that duplicates" 546 " a system directory\n"); 547 } 548 549 // This is reached if the current entry is a duplicate. Remove the 550 // DirToRemove (usually the current dir). 551 SearchList.erase(SearchList.begin()+DirToRemove); 552 --i; 553 } 554} 555 556 557void InitHeaderSearch::Realize() { 558 // Concatenate ANGLE+SYSTEM+AFTER chains together into SearchList. 559 std::vector<DirectoryLookup> SearchList; 560 SearchList = IncludeGroup[Angled]; 561 SearchList.insert(SearchList.end(), IncludeGroup[System].begin(), 562 IncludeGroup[System].end()); 563 SearchList.insert(SearchList.end(), IncludeGroup[After].begin(), 564 IncludeGroup[After].end()); 565 RemoveDuplicates(SearchList, Verbose); 566 RemoveDuplicates(IncludeGroup[Quoted], Verbose); 567 568 // Prepend QUOTED list on the search list. 569 SearchList.insert(SearchList.begin(), IncludeGroup[Quoted].begin(), 570 IncludeGroup[Quoted].end()); 571 572 573 bool DontSearchCurDir = false; // TODO: set to true if -I- is set? 574 Headers.SetSearchPaths(SearchList, IncludeGroup[Quoted].size(), 575 DontSearchCurDir); 576 577 // If verbose, print the list of directories that will be searched. 578 if (Verbose) { 579 fprintf(stderr, "#include \"...\" search starts here:\n"); 580 unsigned QuotedIdx = IncludeGroup[Quoted].size(); 581 for (unsigned i = 0, e = SearchList.size(); i != e; ++i) { 582 if (i == QuotedIdx) 583 fprintf(stderr, "#include <...> search starts here:\n"); 584 const char *Name = SearchList[i].getName(); 585 const char *Suffix; 586 if (SearchList[i].isNormalDir()) 587 Suffix = ""; 588 else if (SearchList[i].isFramework()) 589 Suffix = " (framework directory)"; 590 else { 591 assert(SearchList[i].isHeaderMap() && "Unknown DirectoryLookup"); 592 Suffix = " (headermap)"; 593 } 594 fprintf(stderr, " %s%s\n", Name, Suffix); 595 } 596 fprintf(stderr, "End of search list.\n"); 597 } 598} 599