| OLD | NEW |
| 1 //===--- InitHeaderSearch.cpp - Initialize header search paths ------------===// | 1 //===--- InitHeaderSearch.cpp - Initialize header search paths ------------===// |
| 2 // | 2 // |
| 3 // The LLVM Compiler Infrastructure | 3 // The LLVM Compiler Infrastructure |
| 4 // | 4 // |
| 5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
| 6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
| 7 // | 7 // |
| 8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
| 9 // | 9 // |
| 10 // This file implements the InitHeaderSearch class. | 10 // This file implements the InitHeaderSearch class. |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 void InitHeaderSearch::AddDefaultCIncludePaths(const llvm::Triple &triple, | 224 void InitHeaderSearch::AddDefaultCIncludePaths(const llvm::Triple &triple, |
| 225 const HeaderSearchOptions &HSOpts) { | 225 const HeaderSearchOptions &HSOpts) { |
| 226 llvm::Triple::OSType os = triple.getOS(); | 226 llvm::Triple::OSType os = triple.getOS(); |
| 227 | 227 |
| 228 if (HSOpts.UseStandardSystemIncludes) { | 228 if (HSOpts.UseStandardSystemIncludes) { |
| 229 switch (os) { | 229 switch (os) { |
| 230 case llvm::Triple::FreeBSD: | 230 case llvm::Triple::FreeBSD: |
| 231 case llvm::Triple::NetBSD: | 231 case llvm::Triple::NetBSD: |
| 232 case llvm::Triple::OpenBSD: | 232 case llvm::Triple::OpenBSD: |
| 233 case llvm::Triple::Bitrig: | 233 case llvm::Triple::Bitrig: |
| 234 case llvm::Triple::NaCl: // @LOCALMOD |
| 235 |
| 234 break; | 236 break; |
| 235 default: | 237 default: |
| 236 // FIXME: temporary hack: hard-coded paths. | 238 // FIXME: temporary hack: hard-coded paths. |
| 237 AddPath("/usr/local/include", System, false); | 239 AddPath("/usr/local/include", System, false); |
| 238 break; | 240 break; |
| 239 } | 241 } |
| 240 } | 242 } |
| 241 | 243 |
| 242 // Builtin includes use #include_next directives and should be positioned | 244 // Builtin includes use #include_next directives and should be positioned |
| 243 // just prior C include dirs. | 245 // just prior C include dirs. |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 #if defined(LLVM_ON_WIN32) | 335 #if defined(LLVM_ON_WIN32) |
| 334 AddPath("c:/mingw/include", System, false); | 336 AddPath("c:/mingw/include", System, false); |
| 335 #endif | 337 #endif |
| 336 break; | 338 break; |
| 337 } | 339 } |
| 338 break; | 340 break; |
| 339 default: | 341 default: |
| 340 break; | 342 break; |
| 341 } | 343 } |
| 342 | 344 |
| 343 if ( os != llvm::Triple::RTEMS ) | 345 // @LOCALMOD-BEGIN |
| 346 // NaCl only uses toolchain provided headers. |
| 347 if ( os != llvm::Triple::RTEMS && os != llvm::Triple::NaCl) |
| 348 // @LOCALMOD-END |
| 344 AddPath("/usr/include", ExternCSystem, false); | 349 AddPath("/usr/include", ExternCSystem, false); |
| 345 } | 350 } |
| 346 | 351 |
| 347 void InitHeaderSearch:: | 352 void InitHeaderSearch:: |
| 348 AddDefaultCPlusPlusIncludePaths(const llvm::Triple &triple, const HeaderSearchOp
tions &HSOpts) { | 353 AddDefaultCPlusPlusIncludePaths(const llvm::Triple &triple, const HeaderSearchOp
tions &HSOpts) { |
| 349 llvm::Triple::OSType os = triple.getOS(); | 354 llvm::Triple::OSType os = triple.getOS(); |
| 350 // FIXME: temporary hack: hard-coded paths. | 355 // FIXME: temporary hack: hard-coded paths. |
| 351 | 356 |
| 352 if (triple.isOSDarwin()) { | 357 if (triple.isOSDarwin()) { |
| 353 switch (triple.getArch()) { | 358 switch (triple.getArch()) { |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 698 if (HSOpts.UseBuiltinIncludes) { | 703 if (HSOpts.UseBuiltinIncludes) { |
| 699 // Set up the builtin include directory in the module map. | 704 // Set up the builtin include directory in the module map. |
| 700 SmallString<128> P = StringRef(HSOpts.ResourceDir); | 705 SmallString<128> P = StringRef(HSOpts.ResourceDir); |
| 701 llvm::sys::path::append(P, "include"); | 706 llvm::sys::path::append(P, "include"); |
| 702 if (const DirectoryEntry *Dir = HS.getFileMgr().getDirectory(P.str())) | 707 if (const DirectoryEntry *Dir = HS.getFileMgr().getDirectory(P.str())) |
| 703 HS.getModuleMap().setBuiltinIncludeDir(Dir); | 708 HS.getModuleMap().setBuiltinIncludeDir(Dir); |
| 704 } | 709 } |
| 705 | 710 |
| 706 Init.Realize(Lang); | 711 Init.Realize(Lang); |
| 707 } | 712 } |
| OLD | NEW |