InitHeaderSearch.cpp revision c12bbe5cbee8936204d286e17d8e0511dd67ddb4
1df22c2cc7703c7df04eadd2e6e59c61f545a5741Nick Lewycky//===--- InitHeaderSearch.cpp - Initialize header search paths ------------===// 20fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber// 30fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber// The LLVM Compiler Infrastructure 40fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber// 50fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber// This file is distributed under the University of Illinois Open Source 60fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber// License. See LICENSE.TXT for details. 70fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber// 80fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber//===----------------------------------------------------------------------===// 90fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber// 100fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber// This file implements the InitHeaderSearch class. 110fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber// 120fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber//===----------------------------------------------------------------------===// 130fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber 142100fe952a644134b1dca462f2e6330cf14ef47cOscar Fuentes#ifdef HAVE_CLANG_CONFIG_H 152100fe952a644134b1dca462f2e6330cf14ef47cOscar Fuentes# include "clang/Config/config.h" 162100fe952a644134b1dca462f2e6330cf14ef47cOscar Fuentes#endif 172100fe952a644134b1dca462f2e6330cf14ef47cOscar Fuentes 182cdafa8001ee69b75d2906cbb36f16cf8e1dc60aDaniel Dunbar#include "clang/Frontend/Utils.h" 190fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber#include "clang/Basic/FileManager.h" 200fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber#include "clang/Basic/LangOptions.h" 2163c8b77334f90472260d2f48df2742ed5067261eDaniel Dunbar#include "clang/Frontend/HeaderSearchOptions.h" 2263c8b77334f90472260d2f48df2742ed5067261eDaniel Dunbar#include "clang/Lex/HeaderSearch.h" 230fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber#include "llvm/ADT/SmallString.h" 240fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber#include "llvm/ADT/SmallPtrSet.h" 25aadd7a48453b4f58bd8e1e9eb670918ee7d6a711Rafael Espindola#include "llvm/ADT/SmallVector.h" 26f0a2f51be576089e1a84cd677c09156dae067b6aRafael Espindola#include "llvm/ADT/StringExtras.h" 272cdafa8001ee69b75d2906cbb36f16cf8e1dc60aDaniel Dunbar#include "llvm/ADT/Triple.h" 28e89ba59005479529f5567f12b436617a2ca73ec2Benjamin Kramer#include "llvm/ADT/Twine.h" 29d57a7ef9252964bc6c8471451d7bd395b0520cb8Chris Lattner#include "llvm/Support/raw_ostream.h" 3003013fa9a0bf1ef4b907f5fec006c8f4000fdd21Michael J. Spencer#include "llvm/Support/Path.h" 31121e3c207415fb4c105d690de384d8f3d49b0f2dArgyrios Kyrtzidis#include "llvm/Config/config.h" 32620d57a293143e3f07d6e4f5ba50020a80f45564Mike Stump#ifdef _MSC_VER 33620d57a293143e3f07d6e4f5ba50020a80f45564Mike Stump #define WIN32_LEAN_AND_MEAN 1 34620d57a293143e3f07d6e4f5ba50020a80f45564Mike Stump #include <windows.h> 35620d57a293143e3f07d6e4f5ba50020a80f45564Mike Stump#endif 360fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weberusing namespace clang; 372cdafa8001ee69b75d2906cbb36f16cf8e1dc60aDaniel Dunbarusing namespace clang::frontend; 382cdafa8001ee69b75d2906cbb36f16cf8e1dc60aDaniel Dunbar 392cdafa8001ee69b75d2906cbb36f16cf8e1dc60aDaniel Dunbarnamespace { 402cdafa8001ee69b75d2906cbb36f16cf8e1dc60aDaniel Dunbar 412cdafa8001ee69b75d2906cbb36f16cf8e1dc60aDaniel Dunbar/// InitHeaderSearch - This class makes it easier to set the search paths of 422cdafa8001ee69b75d2906cbb36f16cf8e1dc60aDaniel Dunbar/// a HeaderSearch object. InitHeaderSearch stores several search path lists 432cdafa8001ee69b75d2906cbb36f16cf8e1dc60aDaniel Dunbar/// internally, which can be sent to a HeaderSearch object in one swoop. 442cdafa8001ee69b75d2906cbb36f16cf8e1dc60aDaniel Dunbarclass InitHeaderSearch { 452cdafa8001ee69b75d2906cbb36f16cf8e1dc60aDaniel Dunbar std::vector<DirectoryLookup> IncludeGroup[4]; 462cdafa8001ee69b75d2906cbb36f16cf8e1dc60aDaniel Dunbar HeaderSearch& Headers; 472cdafa8001ee69b75d2906cbb36f16cf8e1dc60aDaniel Dunbar bool Verbose; 48af6530c938bfc60902f0dfec1c0808aedbee1663Michael J. Spencer std::string IncludeSysroot; 49af6530c938bfc60902f0dfec1c0808aedbee1663Michael J. Spencer bool IsNotEmptyOrRoot; 502cdafa8001ee69b75d2906cbb36f16cf8e1dc60aDaniel Dunbar 512cdafa8001ee69b75d2906cbb36f16cf8e1dc60aDaniel Dunbarpublic: 522cdafa8001ee69b75d2906cbb36f16cf8e1dc60aDaniel Dunbar 53c09265a5fd94af5dcfd7325d0cb4f04197d65afcChandler Carruth InitHeaderSearch(HeaderSearch &HS, bool verbose, llvm::StringRef sysroot) 54af6530c938bfc60902f0dfec1c0808aedbee1663Michael J. Spencer : Headers(HS), Verbose(verbose), IncludeSysroot(sysroot), 55af6530c938bfc60902f0dfec1c0808aedbee1663Michael J. Spencer IsNotEmptyOrRoot(!(sysroot.empty() || sysroot == "/")) { 56c09265a5fd94af5dcfd7325d0cb4f04197d65afcChandler Carruth } 572cdafa8001ee69b75d2906cbb36f16cf8e1dc60aDaniel Dunbar 582cdafa8001ee69b75d2906cbb36f16cf8e1dc60aDaniel Dunbar /// AddPath - Add the specified path to the specified group list. 59e89ba59005479529f5567f12b436617a2ca73ec2Benjamin Kramer void AddPath(const llvm::Twine &Path, IncludeDirGroup Group, 602cdafa8001ee69b75d2906cbb36f16cf8e1dc60aDaniel Dunbar bool isCXXAware, bool isUserSupplied, 612cdafa8001ee69b75d2906cbb36f16cf8e1dc60aDaniel Dunbar bool isFramework, bool IgnoreSysRoot = false); 622cdafa8001ee69b75d2906cbb36f16cf8e1dc60aDaniel Dunbar 63a608737659d4330d9ae7622bf1a87c33b9d97072mike-m /// AddGnuCPlusPlusIncludePaths - Add the necessary paths to support a gnu 642cdafa8001ee69b75d2906cbb36f16cf8e1dc60aDaniel Dunbar /// libstdc++. 65e89ba59005479529f5567f12b436617a2ca73ec2Benjamin Kramer void AddGnuCPlusPlusIncludePaths(llvm::StringRef Base, 66e89ba59005479529f5567f12b436617a2ca73ec2Benjamin Kramer llvm::StringRef ArchDir, 67e89ba59005479529f5567f12b436617a2ca73ec2Benjamin Kramer llvm::StringRef Dir32, 68e89ba59005479529f5567f12b436617a2ca73ec2Benjamin Kramer llvm::StringRef Dir64, 692cdafa8001ee69b75d2906cbb36f16cf8e1dc60aDaniel Dunbar const llvm::Triple &triple); 702cdafa8001ee69b75d2906cbb36f16cf8e1dc60aDaniel Dunbar 7106a8dc616ec8324694d45cd4d724634a899be9a3Michael J. Spencer /// AddMinGWCPlusPlusIncludePaths - Add the necessary paths to support a MinGW 722cdafa8001ee69b75d2906cbb36f16cf8e1dc60aDaniel Dunbar /// libstdc++. 73e89ba59005479529f5567f12b436617a2ca73ec2Benjamin Kramer void AddMinGWCPlusPlusIncludePaths(llvm::StringRef Base, 74e89ba59005479529f5567f12b436617a2ca73ec2Benjamin Kramer llvm::StringRef Arch, 75e89ba59005479529f5567f12b436617a2ca73ec2Benjamin Kramer llvm::StringRef Version); 762cdafa8001ee69b75d2906cbb36f16cf8e1dc60aDaniel Dunbar 772cdafa8001ee69b75d2906cbb36f16cf8e1dc60aDaniel Dunbar /// AddDelimitedPaths - Add a list of paths delimited by the system PATH 782cdafa8001ee69b75d2906cbb36f16cf8e1dc60aDaniel Dunbar /// separator. The processing follows that of the CPATH variable for gcc. 799e9ddf6100fd50ca2f9f9d0106b856e20b43300fBenjamin Kramer void AddDelimitedPaths(llvm::StringRef String); 802cdafa8001ee69b75d2906cbb36f16cf8e1dc60aDaniel Dunbar 812cdafa8001ee69b75d2906cbb36f16cf8e1dc60aDaniel Dunbar // AddDefaultCIncludePaths - Add paths that should always be searched. 8279bc57c074cb91f574fba19215f95b63dcf6b04bmike-m void AddDefaultCIncludePaths(const llvm::Triple &triple, 8379bc57c074cb91f574fba19215f95b63dcf6b04bmike-m const HeaderSearchOptions &HSOpts); 842cdafa8001ee69b75d2906cbb36f16cf8e1dc60aDaniel Dunbar 852cdafa8001ee69b75d2906cbb36f16cf8e1dc60aDaniel Dunbar // AddDefaultCPlusPlusIncludePaths - Add paths that should be searched when 862cdafa8001ee69b75d2906cbb36f16cf8e1dc60aDaniel Dunbar // compiling c++. 872cdafa8001ee69b75d2906cbb36f16cf8e1dc60aDaniel Dunbar void AddDefaultCPlusPlusIncludePaths(const llvm::Triple &triple); 882cdafa8001ee69b75d2906cbb36f16cf8e1dc60aDaniel Dunbar 892cdafa8001ee69b75d2906cbb36f16cf8e1dc60aDaniel Dunbar /// AddDefaultSystemIncludePaths - Adds the default system include paths so 902cdafa8001ee69b75d2906cbb36f16cf8e1dc60aDaniel Dunbar /// that e.g. stdio.h is found. 912cdafa8001ee69b75d2906cbb36f16cf8e1dc60aDaniel Dunbar void AddDefaultSystemIncludePaths(const LangOptions &Lang, 924c2bcad7b843c10fd4a2ffd43da40bfefb4dc8baDouglas Gregor const llvm::Triple &triple, 9379bc57c074cb91f574fba19215f95b63dcf6b04bmike-m const HeaderSearchOptions &HSOpts); 942cdafa8001ee69b75d2906cbb36f16cf8e1dc60aDaniel Dunbar 952cdafa8001ee69b75d2906cbb36f16cf8e1dc60aDaniel Dunbar /// Realize - Merges all search path lists into one list and send it to 962cdafa8001ee69b75d2906cbb36f16cf8e1dc60aDaniel Dunbar /// HeaderSearch. 972cdafa8001ee69b75d2906cbb36f16cf8e1dc60aDaniel Dunbar void Realize(); 982cdafa8001ee69b75d2906cbb36f16cf8e1dc60aDaniel Dunbar}; 992cdafa8001ee69b75d2906cbb36f16cf8e1dc60aDaniel Dunbar 1002cdafa8001ee69b75d2906cbb36f16cf8e1dc60aDaniel Dunbar} 1010fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber 102e89ba59005479529f5567f12b436617a2ca73ec2Benjamin Kramervoid InitHeaderSearch::AddPath(const llvm::Twine &Path, 103458fb10ef5ba2d7b375c6c64095c1458af0a5be3Benjamin Kramer IncludeDirGroup Group, bool isCXXAware, 104458fb10ef5ba2d7b375c6c64095c1458af0a5be3Benjamin Kramer bool isUserSupplied, bool isFramework, 105458fb10ef5ba2d7b375c6c64095c1458af0a5be3Benjamin Kramer bool IgnoreSysRoot) { 106e89ba59005479529f5567f12b436617a2ca73ec2Benjamin Kramer assert(!Path.isTriviallyEmpty() && "can't handle empty path here"); 1070fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber FileManager &FM = Headers.getFileMgr(); 1081eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump 1090fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber // Compute the actual path, taking into consideration -isysroot. 1105853b0f117ee811388219bce738b24835b8d7fb2Chandler Carruth llvm::SmallString<256> MappedPathStorage; 111f3721457cd9f364f262e7a2d61edcdad05996e61Chandler Carruth llvm::StringRef MappedPathStr = Path.toStringRef(MappedPathStorage); 1121eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump 1130fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber // Handle isysroot. 114256053b31e697fdf0cc48f17d621c82fc3b8dff0Michael J. Spencer if (Group == System && !IgnoreSysRoot && 115256053b31e697fdf0cc48f17d621c82fc3b8dff0Michael J. Spencer llvm::sys::path::is_absolute(MappedPathStr) && 116af6530c938bfc60902f0dfec1c0808aedbee1663Michael J. Spencer IsNotEmptyOrRoot) { 1175619ae5d25dc77410a444c86606d4ec9bae8b921Chandler Carruth MappedPathStorage.clear(); 118c09265a5fd94af5dcfd7325d0cb4f04197d65afcChandler Carruth MappedPathStr = 119af6530c938bfc60902f0dfec1c0808aedbee1663Michael J. Spencer (IncludeSysroot + Path).toStringRef(MappedPathStorage); 1200fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber } 1211eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump 1220fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber // Compute the DirectoryLookup type. 1239d72851fec9e9c62570a027d42701562bbf29751Chris Lattner SrcMgr::CharacteristicKind Type; 1240fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber if (Group == Quoted || Group == Angled) 1250b9e736308af5397f558ffc8e780c438c2fdb563Chris Lattner Type = SrcMgr::C_User; 1260fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber else if (isCXXAware) 1270b9e736308af5397f558ffc8e780c438c2fdb563Chris Lattner Type = SrcMgr::C_System; 1280fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber else 1290b9e736308af5397f558ffc8e780c438c2fdb563Chris Lattner Type = SrcMgr::C_ExternCSystem; 1301eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump 1311eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump 1320fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber // If the directory exists, add it. 13339b49bcaaddb1049234fca9500c0ac02c088e23dChris Lattner if (const DirectoryEntry *DE = FM.getDirectory(MappedPathStr)) { 1340fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber IncludeGroup[Group].push_back(DirectoryLookup(DE, Type, isUserSupplied, 1350fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber isFramework)); 1360fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber return; 1370fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber } 1381eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump 1390fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber // Check to see if this is an apple-style headermap (which are not allowed to 1400fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber // be frameworks). 1410fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber if (!isFramework) { 14239b49bcaaddb1049234fca9500c0ac02c088e23dChris Lattner if (const FileEntry *FE = FM.getFile(MappedPathStr)) { 1430fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber if (const HeaderMap *HM = Headers.CreateHeaderMap(FE)) { 1440fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber // It is a headermap, add it to the search path. 1450fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber IncludeGroup[Group].push_back(DirectoryLookup(HM, Type,isUserSupplied)); 1460fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber return; 1470fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber } 1480fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber } 1490fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber } 1501eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump 1510fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber if (Verbose) 152f3721457cd9f364f262e7a2d61edcdad05996e61Chandler Carruth llvm::errs() << "ignoring nonexistent directory \"" 153f3721457cd9f364f262e7a2d61edcdad05996e61Chandler Carruth << MappedPathStr << "\"\n"; 1540fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber} 1550fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber 1560fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber 1579e9ddf6100fd50ca2f9f9d0106b856e20b43300fBenjamin Kramervoid InitHeaderSearch::AddDelimitedPaths(llvm::StringRef at) { 1589e9ddf6100fd50ca2f9f9d0106b856e20b43300fBenjamin Kramer if (at.empty()) // Empty string should not add '.' path. 1590fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber return; 1600fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber 1619e9ddf6100fd50ca2f9f9d0106b856e20b43300fBenjamin Kramer llvm::StringRef::size_type delim; 1629e9ddf6100fd50ca2f9f9d0106b856e20b43300fBenjamin Kramer while ((delim = at.find(llvm::sys::PathSeparator)) != llvm::StringRef::npos) { 1639e9ddf6100fd50ca2f9f9d0106b856e20b43300fBenjamin Kramer if (delim == 0) 1640fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber AddPath(".", Angled, false, true, false); 1650fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber else 1669e9ddf6100fd50ca2f9f9d0106b856e20b43300fBenjamin Kramer AddPath(at.substr(0, delim), Angled, false, true, false); 1679e9ddf6100fd50ca2f9f9d0106b856e20b43300fBenjamin Kramer at = at.substr(delim + 1); 1680fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber } 1699e9ddf6100fd50ca2f9f9d0106b856e20b43300fBenjamin Kramer 1709e9ddf6100fd50ca2f9f9d0106b856e20b43300fBenjamin Kramer if (at.empty()) 1710fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber AddPath(".", Angled, false, true, false); 1720fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber else 1730fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber AddPath(at, Angled, false, true, false); 1740fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber} 1750fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber 176e89ba59005479529f5567f12b436617a2ca73ec2Benjamin Kramervoid InitHeaderSearch::AddGnuCPlusPlusIncludePaths(llvm::StringRef Base, 177e89ba59005479529f5567f12b436617a2ca73ec2Benjamin Kramer llvm::StringRef ArchDir, 178e89ba59005479529f5567f12b436617a2ca73ec2Benjamin Kramer llvm::StringRef Dir32, 179e89ba59005479529f5567f12b436617a2ca73ec2Benjamin Kramer llvm::StringRef Dir64, 18031b63beefa058aa42a12a1c2b72b43a4ba21f7f1Rafael Espindola const llvm::Triple &triple) { 1816ec18a3f86c702004af66cce6ff979999a736898Rafael Espindola // Add the base dir 182ab7ae95c46f288ac52974aa60334a9575f9a850cRafael Espindola AddPath(Base, System, true, false, false); 183ab7ae95c46f288ac52974aa60334a9575f9a850cRafael Espindola 184ab7ae95c46f288ac52974aa60334a9575f9a850cRafael Espindola // Add the multilib dirs 18531b63beefa058aa42a12a1c2b72b43a4ba21f7f1Rafael Espindola llvm::Triple::ArchType arch = triple.getArch(); 18631b63beefa058aa42a12a1c2b72b43a4ba21f7f1Rafael Espindola bool is64bit = arch == llvm::Triple::ppc64 || arch == llvm::Triple::x86_64; 18731b63beefa058aa42a12a1c2b72b43a4ba21f7f1Rafael Espindola if (is64bit) 188ab7ae95c46f288ac52974aa60334a9575f9a850cRafael Espindola AddPath(Base + "/" + ArchDir + "/" + Dir64, System, true, false, false); 18931b63beefa058aa42a12a1c2b72b43a4ba21f7f1Rafael Espindola else 190ab7ae95c46f288ac52974aa60334a9575f9a850cRafael Espindola AddPath(Base + "/" + ArchDir + "/" + Dir32, System, true, false, false); 1916ec18a3f86c702004af66cce6ff979999a736898Rafael Espindola 1926ec18a3f86c702004af66cce6ff979999a736898Rafael Espindola // Add the backward dir 1936ec18a3f86c702004af66cce6ff979999a736898Rafael Espindola AddPath(Base + "/backward", System, true, false, false); 1942e9f652d53346bf7e64c8a12a9ff06b004a3e489Rafael Espindola} 1950fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber 196e89ba59005479529f5567f12b436617a2ca73ec2Benjamin Kramervoid InitHeaderSearch::AddMinGWCPlusPlusIncludePaths(llvm::StringRef Base, 197e89ba59005479529f5567f12b436617a2ca73ec2Benjamin Kramer llvm::StringRef Arch, 198e89ba59005479529f5567f12b436617a2ca73ec2Benjamin Kramer llvm::StringRef Version) { 199ab8ae19ea4285a15ca43123e8e218e401dc5cb5aBenjamin Kramer AddPath(Base + "/" + Arch + "/" + Version + "/include/c++", 200ab8ae19ea4285a15ca43123e8e218e401dc5cb5aBenjamin Kramer System, true, false, false); 2018e9006bb31184a38b7c4c9d3d3040394652cbd9bChris Lattner AddPath(Base + "/" + Arch + "/" + Version + "/include/c++/" + Arch, 2028e9006bb31184a38b7c4c9d3d3040394652cbd9bChris Lattner System, true, false, false); 203ab8ae19ea4285a15ca43123e8e218e401dc5cb5aBenjamin Kramer AddPath(Base + "/" + Arch + "/" + Version + "/include/c++/backward", 204ab8ae19ea4285a15ca43123e8e218e401dc5cb5aBenjamin Kramer System, true, false, false); 205620d57a293143e3f07d6e4f5ba50020a80f45564Mike Stump} 20643d8176d2e8e304b2d419fb0fe139cc07af80deaMike Stump 207620d57a293143e3f07d6e4f5ba50020a80f45564Mike Stump // FIXME: This probably should goto to some platform utils place. 208620d57a293143e3f07d6e4f5ba50020a80f45564Mike Stump#ifdef _MSC_VER 20975ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson 210620d57a293143e3f07d6e4f5ba50020a80f45564Mike Stump // Read registry string. 21175ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson // This also supports a means to look for high-versioned keys by use 21275ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson // of a $VERSION placeholder in the key path. 21375ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson // $VERSION in the key path is a placeholder for the version number, 21475ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson // causing the highest value path to be searched for and used. 21575ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson // I.e. "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\$VERSION". 21675ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson // There can be additional characters in the component. Only the numberic 21775ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson // characters are compared. 2186cd5216bb61e6165d8f6e8fb781d45c035bd4e00Benjamin Kramerstatic bool getSystemRegistryString(const char *keyPath, const char *valueName, 2196cd5216bb61e6165d8f6e8fb781d45c035bd4e00Benjamin Kramer char *value, size_t maxLength) { 22043d8176d2e8e304b2d419fb0fe139cc07af80deaMike Stump HKEY hRootKey = NULL; 22143d8176d2e8e304b2d419fb0fe139cc07af80deaMike Stump HKEY hKey = NULL; 22243d8176d2e8e304b2d419fb0fe139cc07af80deaMike Stump const char* subKey = NULL; 22343d8176d2e8e304b2d419fb0fe139cc07af80deaMike Stump DWORD valueType; 22443d8176d2e8e304b2d419fb0fe139cc07af80deaMike Stump DWORD valueSize = maxLength - 1; 22575ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson long lResult; 22643d8176d2e8e304b2d419fb0fe139cc07af80deaMike Stump bool returnValue = false; 22743d8176d2e8e304b2d419fb0fe139cc07af80deaMike Stump if (strncmp(keyPath, "HKEY_CLASSES_ROOT\\", 18) == 0) { 22843d8176d2e8e304b2d419fb0fe139cc07af80deaMike Stump hRootKey = HKEY_CLASSES_ROOT; 22943d8176d2e8e304b2d419fb0fe139cc07af80deaMike Stump subKey = keyPath + 18; 23043d8176d2e8e304b2d419fb0fe139cc07af80deaMike Stump } 23143d8176d2e8e304b2d419fb0fe139cc07af80deaMike Stump else if (strncmp(keyPath, "HKEY_USERS\\", 11) == 0) { 23243d8176d2e8e304b2d419fb0fe139cc07af80deaMike Stump hRootKey = HKEY_USERS; 23343d8176d2e8e304b2d419fb0fe139cc07af80deaMike Stump subKey = keyPath + 11; 23443d8176d2e8e304b2d419fb0fe139cc07af80deaMike Stump } 23543d8176d2e8e304b2d419fb0fe139cc07af80deaMike Stump else if (strncmp(keyPath, "HKEY_LOCAL_MACHINE\\", 19) == 0) { 23643d8176d2e8e304b2d419fb0fe139cc07af80deaMike Stump hRootKey = HKEY_LOCAL_MACHINE; 23743d8176d2e8e304b2d419fb0fe139cc07af80deaMike Stump subKey = keyPath + 19; 238121e3c207415fb4c105d690de384d8f3d49b0f2dArgyrios Kyrtzidis } 23943d8176d2e8e304b2d419fb0fe139cc07af80deaMike Stump else if (strncmp(keyPath, "HKEY_CURRENT_USER\\", 18) == 0) { 24043d8176d2e8e304b2d419fb0fe139cc07af80deaMike Stump hRootKey = HKEY_CURRENT_USER; 24143d8176d2e8e304b2d419fb0fe139cc07af80deaMike Stump subKey = keyPath + 18; 24243d8176d2e8e304b2d419fb0fe139cc07af80deaMike Stump } 24343d8176d2e8e304b2d419fb0fe139cc07af80deaMike Stump else 24443d8176d2e8e304b2d419fb0fe139cc07af80deaMike Stump return(false); 24575ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson const char *placeHolder = strstr(subKey, "$VERSION"); 24675ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson char bestName[256]; 24775ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson bestName[0] = '\0'; 24875ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson // If we have a $VERSION placeholder, do the highest-version search. 24975ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson if (placeHolder) { 25075ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson const char *keyEnd = placeHolder - 1; 25175ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson const char *nextKey = placeHolder; 25275ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson // Find end of previous key. 25375ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson while ((keyEnd > subKey) && (*keyEnd != '\\')) 25475ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson keyEnd--; 25575ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson // Find end of key containing $VERSION. 25675ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson while (*nextKey && (*nextKey != '\\')) 25775ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson nextKey++; 25875ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson size_t partialKeyLength = keyEnd - subKey; 25975ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson char partialKey[256]; 26075ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson if (partialKeyLength > sizeof(partialKey)) 26175ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson partialKeyLength = sizeof(partialKey); 26275ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson strncpy(partialKey, subKey, partialKeyLength); 26375ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson partialKey[partialKeyLength] = '\0'; 26475ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson HKEY hTopKey = NULL; 26575ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson lResult = RegOpenKeyEx(hRootKey, partialKey, 0, KEY_READ, &hTopKey); 26675ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson if (lResult == ERROR_SUCCESS) { 26775ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson char keyName[256]; 26875ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson int bestIndex = -1; 26975ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson double bestValue = 0.0; 27075ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson DWORD index, size = sizeof(keyName) - 1; 27133cc2437ae3a609cdc44179931a2909eb48a8200Nuno Lopes for (index = 0; RegEnumKeyEx(hTopKey, index, keyName, &size, NULL, 27233cc2437ae3a609cdc44179931a2909eb48a8200Nuno Lopes NULL, NULL, NULL) == ERROR_SUCCESS; index++) { 27333cc2437ae3a609cdc44179931a2909eb48a8200Nuno Lopes const char *sp = keyName; 27433cc2437ae3a609cdc44179931a2909eb48a8200Nuno Lopes while (*sp && !isdigit(*sp)) 27533cc2437ae3a609cdc44179931a2909eb48a8200Nuno Lopes sp++; 27633cc2437ae3a609cdc44179931a2909eb48a8200Nuno Lopes if (!*sp) 27733cc2437ae3a609cdc44179931a2909eb48a8200Nuno Lopes continue; 27833cc2437ae3a609cdc44179931a2909eb48a8200Nuno Lopes const char *ep = sp + 1; 27933cc2437ae3a609cdc44179931a2909eb48a8200Nuno Lopes while (*ep && (isdigit(*ep) || (*ep == '.'))) 28033cc2437ae3a609cdc44179931a2909eb48a8200Nuno Lopes ep++; 28133cc2437ae3a609cdc44179931a2909eb48a8200Nuno Lopes char numBuf[32]; 28233cc2437ae3a609cdc44179931a2909eb48a8200Nuno Lopes strncpy(numBuf, sp, sizeof(numBuf) - 1); 28333cc2437ae3a609cdc44179931a2909eb48a8200Nuno Lopes numBuf[sizeof(numBuf) - 1] = '\0'; 28433cc2437ae3a609cdc44179931a2909eb48a8200Nuno Lopes double value = strtod(numBuf, NULL); 28533cc2437ae3a609cdc44179931a2909eb48a8200Nuno Lopes if (value > bestValue) { 28633cc2437ae3a609cdc44179931a2909eb48a8200Nuno Lopes bestIndex = (int)index; 28733cc2437ae3a609cdc44179931a2909eb48a8200Nuno Lopes bestValue = value; 28833cc2437ae3a609cdc44179931a2909eb48a8200Nuno Lopes strcpy(bestName, keyName); 28933cc2437ae3a609cdc44179931a2909eb48a8200Nuno Lopes } 29075ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson size = sizeof(keyName) - 1; 29175ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson } 29275ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson // If we found the highest versioned key, open the key and get the value. 29375ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson if (bestIndex != -1) { 29475ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson // Append rest of key. 29575ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson strncat(bestName, nextKey, sizeof(bestName) - 1); 29675ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson bestName[sizeof(bestName) - 1] = '\0'; 29775ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson // Open the chosen key path remainder. 29875ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson lResult = RegOpenKeyEx(hTopKey, bestName, 0, KEY_READ, &hKey); 29975ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson if (lResult == ERROR_SUCCESS) { 30075ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson lResult = RegQueryValueEx(hKey, valueName, NULL, &valueType, 30175ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson (LPBYTE)value, &valueSize); 30275ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson if (lResult == ERROR_SUCCESS) 30375ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson returnValue = true; 30475ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson RegCloseKey(hKey); 30575ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson } 30675ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson } 30775ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson RegCloseKey(hTopKey); 30875ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson } 30975ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson } 31075ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson else { 31175ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson lResult = RegOpenKeyEx(hRootKey, subKey, 0, KEY_READ, &hKey); 31275ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson if (lResult == ERROR_SUCCESS) { 31375ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson lResult = RegQueryValueEx(hKey, valueName, NULL, &valueType, 31475ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson (LPBYTE)value, &valueSize); 31575ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson if (lResult == ERROR_SUCCESS) 31675ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson returnValue = true; 31775ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson RegCloseKey(hKey); 31875ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson } 31943d8176d2e8e304b2d419fb0fe139cc07af80deaMike Stump } 32043d8176d2e8e304b2d419fb0fe139cc07af80deaMike Stump return(returnValue); 32143d8176d2e8e304b2d419fb0fe139cc07af80deaMike Stump} 322620d57a293143e3f07d6e4f5ba50020a80f45564Mike Stump#else // _MSC_VER 323620d57a293143e3f07d6e4f5ba50020a80f45564Mike Stump // Read registry string. 3246cd5216bb61e6165d8f6e8fb781d45c035bd4e00Benjamin Kramerstatic bool getSystemRegistryString(const char*, const char*, char*, size_t) { 325620d57a293143e3f07d6e4f5ba50020a80f45564Mike Stump return(false); 326620d57a293143e3f07d6e4f5ba50020a80f45564Mike Stump} 327620d57a293143e3f07d6e4f5ba50020a80f45564Mike Stump#endif // _MSC_VER 328121e3c207415fb4c105d690de384d8f3d49b0f2dArgyrios Kyrtzidis 32943d8176d2e8e304b2d419fb0fe139cc07af80deaMike Stump // Get Visual Studio installation directory. 3306cd5216bb61e6165d8f6e8fb781d45c035bd4e00Benjamin Kramerstatic bool getVisualStudioDir(std::string &path) { 331ff58e3610f4e12094def69eb2d6dcb4330378d8fMichael J. Spencer // First check the environment variables that vsvars32.bat sets. 332ff58e3610f4e12094def69eb2d6dcb4330378d8fMichael J. Spencer const char* vcinstalldir = getenv("VCINSTALLDIR"); 333ff58e3610f4e12094def69eb2d6dcb4330378d8fMichael J. Spencer if(vcinstalldir) { 334ff58e3610f4e12094def69eb2d6dcb4330378d8fMichael J. Spencer char *p = const_cast<char *>(strstr(vcinstalldir, "\\VC")); 335ff58e3610f4e12094def69eb2d6dcb4330378d8fMichael J. Spencer if (p) 336ff58e3610f4e12094def69eb2d6dcb4330378d8fMichael J. Spencer *p = '\0'; 337ff58e3610f4e12094def69eb2d6dcb4330378d8fMichael J. Spencer path = vcinstalldir; 338ff58e3610f4e12094def69eb2d6dcb4330378d8fMichael J. Spencer return(true); 339ff58e3610f4e12094def69eb2d6dcb4330378d8fMichael J. Spencer } 340ff58e3610f4e12094def69eb2d6dcb4330378d8fMichael J. Spencer 34175ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson char vsIDEInstallDir[256]; 34280f93d9fe82ebe7e58913646248240de838283beDouglas Gregor char vsExpressIDEInstallDir[256]; 343ff58e3610f4e12094def69eb2d6dcb4330378d8fMichael J. Spencer // Then try the windows registry. 34475ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson bool hasVCDir = getSystemRegistryString( 34575ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\$VERSION", 34675ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson "InstallDir", vsIDEInstallDir, sizeof(vsIDEInstallDir) - 1); 34780f93d9fe82ebe7e58913646248240de838283beDouglas Gregor bool hasVCExpressDir = getSystemRegistryString( 34880f93d9fe82ebe7e58913646248240de838283beDouglas Gregor "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\$VERSION", 34980f93d9fe82ebe7e58913646248240de838283beDouglas Gregor "InstallDir", vsExpressIDEInstallDir, sizeof(vsExpressIDEInstallDir) - 1); 35043d8176d2e8e304b2d419fb0fe139cc07af80deaMike Stump // If we have both vc80 and vc90, pick version we were compiled with. 35175ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson if (hasVCDir && vsIDEInstallDir[0]) { 352620d57a293143e3f07d6e4f5ba50020a80f45564Mike Stump char *p = (char*)strstr(vsIDEInstallDir, "\\Common7\\IDE"); 353620d57a293143e3f07d6e4f5ba50020a80f45564Mike Stump if (p) 354620d57a293143e3f07d6e4f5ba50020a80f45564Mike Stump *p = '\0'; 355620d57a293143e3f07d6e4f5ba50020a80f45564Mike Stump path = vsIDEInstallDir; 356620d57a293143e3f07d6e4f5ba50020a80f45564Mike Stump return(true); 35743d8176d2e8e304b2d419fb0fe139cc07af80deaMike Stump } 35880f93d9fe82ebe7e58913646248240de838283beDouglas Gregor else if (hasVCExpressDir && vsExpressIDEInstallDir[0]) { 35980f93d9fe82ebe7e58913646248240de838283beDouglas Gregor char *p = (char*)strstr(vsExpressIDEInstallDir, "\\Common7\\IDE"); 36080f93d9fe82ebe7e58913646248240de838283beDouglas Gregor if (p) 36180f93d9fe82ebe7e58913646248240de838283beDouglas Gregor *p = '\0'; 36280f93d9fe82ebe7e58913646248240de838283beDouglas Gregor path = vsExpressIDEInstallDir; 36380f93d9fe82ebe7e58913646248240de838283beDouglas Gregor return(true); 36480f93d9fe82ebe7e58913646248240de838283beDouglas Gregor } 365620d57a293143e3f07d6e4f5ba50020a80f45564Mike Stump else { 366620d57a293143e3f07d6e4f5ba50020a80f45564Mike Stump // Try the environment. 36780f93d9fe82ebe7e58913646248240de838283beDouglas Gregor const char* vs100comntools = getenv("VS100COMNTOOLS"); 368620d57a293143e3f07d6e4f5ba50020a80f45564Mike Stump const char* vs90comntools = getenv("VS90COMNTOOLS"); 369620d57a293143e3f07d6e4f5ba50020a80f45564Mike Stump const char* vs80comntools = getenv("VS80COMNTOOLS"); 370620d57a293143e3f07d6e4f5ba50020a80f45564Mike Stump const char* vscomntools = NULL; 37180f93d9fe82ebe7e58913646248240de838283beDouglas Gregor 37280f93d9fe82ebe7e58913646248240de838283beDouglas Gregor // Try to find the version that we were compiled with 37380f93d9fe82ebe7e58913646248240de838283beDouglas Gregor if(false) {} 37480f93d9fe82ebe7e58913646248240de838283beDouglas Gregor #if (_MSC_VER >= 1600) // VC100 37580f93d9fe82ebe7e58913646248240de838283beDouglas Gregor else if(vs100comntools) { 37680f93d9fe82ebe7e58913646248240de838283beDouglas Gregor vscomntools = vs100comntools; 377620d57a293143e3f07d6e4f5ba50020a80f45564Mike Stump } 37880f93d9fe82ebe7e58913646248240de838283beDouglas Gregor #elif (_MSC_VER == 1500) // VC80 37980f93d9fe82ebe7e58913646248240de838283beDouglas Gregor else if(vs90comntools) { 38080f93d9fe82ebe7e58913646248240de838283beDouglas Gregor vscomntools = vs90comntools; 38180f93d9fe82ebe7e58913646248240de838283beDouglas Gregor } 38280f93d9fe82ebe7e58913646248240de838283beDouglas Gregor #elif (_MSC_VER == 1400) // VC80 38380f93d9fe82ebe7e58913646248240de838283beDouglas Gregor else if(vs80comntools) { 38480f93d9fe82ebe7e58913646248240de838283beDouglas Gregor vscomntools = vs80comntools; 38580f93d9fe82ebe7e58913646248240de838283beDouglas Gregor } 38680f93d9fe82ebe7e58913646248240de838283beDouglas Gregor #endif 38780f93d9fe82ebe7e58913646248240de838283beDouglas Gregor // Otherwise find any version we can 38880f93d9fe82ebe7e58913646248240de838283beDouglas Gregor else if (vs100comntools) 38980f93d9fe82ebe7e58913646248240de838283beDouglas Gregor vscomntools = vs100comntools; 390620d57a293143e3f07d6e4f5ba50020a80f45564Mike Stump else if (vs90comntools) 391620d57a293143e3f07d6e4f5ba50020a80f45564Mike Stump vscomntools = vs90comntools; 392620d57a293143e3f07d6e4f5ba50020a80f45564Mike Stump else if (vs80comntools) 393620d57a293143e3f07d6e4f5ba50020a80f45564Mike Stump vscomntools = vs80comntools; 39480f93d9fe82ebe7e58913646248240de838283beDouglas Gregor 395620d57a293143e3f07d6e4f5ba50020a80f45564Mike Stump if (vscomntools && *vscomntools) { 396cb421fa690da545b58a720abe5f1c49b166dbde7Dan Gohman char *p = const_cast<char *>(strstr(vscomntools, "\\Common7\\Tools")); 397620d57a293143e3f07d6e4f5ba50020a80f45564Mike Stump if (p) 398620d57a293143e3f07d6e4f5ba50020a80f45564Mike Stump *p = '\0'; 399620d57a293143e3f07d6e4f5ba50020a80f45564Mike Stump path = vscomntools; 400620d57a293143e3f07d6e4f5ba50020a80f45564Mike Stump return(true); 401620d57a293143e3f07d6e4f5ba50020a80f45564Mike Stump } 402620d57a293143e3f07d6e4f5ba50020a80f45564Mike Stump else 403620d57a293143e3f07d6e4f5ba50020a80f45564Mike Stump return(false); 404620d57a293143e3f07d6e4f5ba50020a80f45564Mike Stump } 405620d57a293143e3f07d6e4f5ba50020a80f45564Mike Stump return(false); 40643d8176d2e8e304b2d419fb0fe139cc07af80deaMike Stump} 4074d374d4a4832a01d5d3b75c59cb1567e60df41e7Sebastian Redl 40875ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson // Get Windows SDK installation directory. 4096cd5216bb61e6165d8f6e8fb781d45c035bd4e00Benjamin Kramerstatic bool getWindowsSDKDir(std::string &path) { 41075ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson char windowsSDKInstallDir[256]; 41175ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson // Try the Windows registry. 41275ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson bool hasSDKDir = getSystemRegistryString( 41375ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\$VERSION", 41475ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson "InstallationFolder", windowsSDKInstallDir, sizeof(windowsSDKInstallDir) - 1); 41575ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson // If we have both vc80 and vc90, pick version we were compiled with. 41675ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson if (hasSDKDir && windowsSDKInstallDir[0]) { 41775ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson path = windowsSDKInstallDir; 41875ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson return(true); 41975ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson } 42075ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson return(false); 42175ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson} 42275ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9John Thompson 42379bc57c074cb91f574fba19215f95b63dcf6b04bmike-mvoid InitHeaderSearch::AddDefaultCIncludePaths(const llvm::Triple &triple, 42479bc57c074cb91f574fba19215f95b63dcf6b04bmike-m const HeaderSearchOptions &HSOpts) { 4258e50a96b387dca7525caa8a6add31420dd82a2cdBenjamin Kramer llvm::Triple::OSType os = triple.getOS(); 4268e50a96b387dca7525caa8a6add31420dd82a2cdBenjamin Kramer 4278e50a96b387dca7525caa8a6add31420dd82a2cdBenjamin Kramer switch (os) { 4288e50a96b387dca7525caa8a6add31420dd82a2cdBenjamin Kramer case llvm::Triple::NetBSD: 4298e50a96b387dca7525caa8a6add31420dd82a2cdBenjamin Kramer break; 4308e50a96b387dca7525caa8a6add31420dd82a2cdBenjamin Kramer default: 4318e50a96b387dca7525caa8a6add31420dd82a2cdBenjamin Kramer // FIXME: temporary hack: hard-coded paths. 4328e50a96b387dca7525caa8a6add31420dd82a2cdBenjamin Kramer AddPath("/usr/local/include", System, true, false, false); 4338e50a96b387dca7525caa8a6add31420dd82a2cdBenjamin Kramer break; 4348e50a96b387dca7525caa8a6add31420dd82a2cdBenjamin Kramer } 43579bc57c074cb91f574fba19215f95b63dcf6b04bmike-m 43679bc57c074cb91f574fba19215f95b63dcf6b04bmike-m // Builtin includes use #include_next directives and should be positioned 43779bc57c074cb91f574fba19215f95b63dcf6b04bmike-m // just prior C include dirs. 43879bc57c074cb91f574fba19215f95b63dcf6b04bmike-m if (HSOpts.UseBuiltinIncludes) { 43979bc57c074cb91f574fba19215f95b63dcf6b04bmike-m // Ignore the sys root, we *always* look for clang headers relative to 44079bc57c074cb91f574fba19215f95b63dcf6b04bmike-m // supplied path. 44179bc57c074cb91f574fba19215f95b63dcf6b04bmike-m llvm::sys::Path P(HSOpts.ResourceDir); 44279bc57c074cb91f574fba19215f95b63dcf6b04bmike-m P.appendComponent("include"); 44379bc57c074cb91f574fba19215f95b63dcf6b04bmike-m AddPath(P.str(), System, false, false, false, /*IgnoreSysRoot=*/ true); 44479bc57c074cb91f574fba19215f95b63dcf6b04bmike-m } 44579bc57c074cb91f574fba19215f95b63dcf6b04bmike-m 44679bc57c074cb91f574fba19215f95b63dcf6b04bmike-m // Add dirs specified via 'configure --with-c-include-dirs'. 447c706468b1e00bab49ca92eb500a39657f530f828Daniel Dunbar llvm::StringRef CIncludeDirs(C_INCLUDE_DIRS); 448c706468b1e00bab49ca92eb500a39657f530f828Daniel Dunbar if (CIncludeDirs != "") { 449aadd7a48453b4f58bd8e1e9eb670918ee7d6a711Rafael Espindola llvm::SmallVector<llvm::StringRef, 5> dirs; 450aadd7a48453b4f58bd8e1e9eb670918ee7d6a711Rafael Espindola CIncludeDirs.split(dirs, ":"); 451aadd7a48453b4f58bd8e1e9eb670918ee7d6a711Rafael Espindola for (llvm::SmallVectorImpl<llvm::StringRef>::iterator i = dirs.begin(); 452aadd7a48453b4f58bd8e1e9eb670918ee7d6a711Rafael Espindola i != dirs.end(); 453aadd7a48453b4f58bd8e1e9eb670918ee7d6a711Rafael Espindola ++i) 454f0a2f51be576089e1a84cd677c09156dae067b6aRafael Espindola AddPath(*i, System, false, false, false); 455f0a2f51be576089e1a84cd677c09156dae067b6aRafael Espindola return; 456f0a2f51be576089e1a84cd677c09156dae067b6aRafael Espindola } 4578e50a96b387dca7525caa8a6add31420dd82a2cdBenjamin Kramer 45843d8176d2e8e304b2d419fb0fe139cc07af80deaMike Stump switch (os) { 459d11ee7f66213bc418df192b7724d3aed349a642cDaniel Dunbar case llvm::Triple::Win32: { 460d11ee7f66213bc418df192b7724d3aed349a642cDaniel Dunbar std::string VSDir; 461d11ee7f66213bc418df192b7724d3aed349a642cDaniel Dunbar std::string WindowsSDKDir; 462d11ee7f66213bc418df192b7724d3aed349a642cDaniel Dunbar if (getVisualStudioDir(VSDir)) { 463d11ee7f66213bc418df192b7724d3aed349a642cDaniel Dunbar AddPath(VSDir + "\\VC\\include", System, false, false, false); 464d11ee7f66213bc418df192b7724d3aed349a642cDaniel Dunbar if (getWindowsSDKDir(WindowsSDKDir)) 465d11ee7f66213bc418df192b7724d3aed349a642cDaniel Dunbar AddPath(WindowsSDKDir + "\\include", System, false, false, false); 466d11ee7f66213bc418df192b7724d3aed349a642cDaniel Dunbar else 467d11ee7f66213bc418df192b7724d3aed349a642cDaniel Dunbar AddPath(VSDir + "\\VC\\PlatformSDK\\Include", 468d11ee7f66213bc418df192b7724d3aed349a642cDaniel Dunbar System, false, false, false); 469d11ee7f66213bc418df192b7724d3aed349a642cDaniel Dunbar } else { 470d11ee7f66213bc418df192b7724d3aed349a642cDaniel Dunbar // Default install paths. 471d11ee7f66213bc418df192b7724d3aed349a642cDaniel Dunbar AddPath("C:/Program Files/Microsoft Visual Studio 10.0/VC/include", 472d11ee7f66213bc418df192b7724d3aed349a642cDaniel Dunbar System, false, false, false); 473d11ee7f66213bc418df192b7724d3aed349a642cDaniel Dunbar AddPath("C:/Program Files/Microsoft Visual Studio 9.0/VC/include", 474d11ee7f66213bc418df192b7724d3aed349a642cDaniel Dunbar System, false, false, false); 475d11ee7f66213bc418df192b7724d3aed349a642cDaniel Dunbar AddPath( 4769319f02dea2449caf5c7a0d07c596ca324e43574John Thompson "C:/Program Files/Microsoft Visual Studio 9.0/VC/PlatformSDK/Include", 477d11ee7f66213bc418df192b7724d3aed349a642cDaniel Dunbar System, false, false, false); 478d11ee7f66213bc418df192b7724d3aed349a642cDaniel Dunbar AddPath("C:/Program Files/Microsoft Visual Studio 8/VC/include", 479d11ee7f66213bc418df192b7724d3aed349a642cDaniel Dunbar System, false, false, false); 480d11ee7f66213bc418df192b7724d3aed349a642cDaniel Dunbar AddPath( 4819319f02dea2449caf5c7a0d07c596ca324e43574John Thompson "C:/Program Files/Microsoft Visual Studio 8/VC/PlatformSDK/Include", 482d11ee7f66213bc418df192b7724d3aed349a642cDaniel Dunbar System, false, false, false); 48343d8176d2e8e304b2d419fb0fe139cc07af80deaMike Stump } 48443d8176d2e8e304b2d419fb0fe139cc07af80deaMike Stump break; 485d11ee7f66213bc418df192b7724d3aed349a642cDaniel Dunbar } 48686ed3a326342fa2a8c9d9b5d1d7280c9bad2b007Chris Lattner case llvm::Triple::Haiku: 48786ed3a326342fa2a8c9d9b5d1d7280c9bad2b007Chris Lattner AddPath("/boot/common/include", System, true, false, false); 48886ed3a326342fa2a8c9d9b5d1d7280c9bad2b007Chris Lattner AddPath("/boot/develop/headers/os", System, true, false, false); 48986ed3a326342fa2a8c9d9b5d1d7280c9bad2b007Chris Lattner AddPath("/boot/develop/headers/os/app", System, true, false, false); 49086ed3a326342fa2a8c9d9b5d1d7280c9bad2b007Chris Lattner AddPath("/boot/develop/headers/os/arch", System, true, false, false); 49186ed3a326342fa2a8c9d9b5d1d7280c9bad2b007Chris Lattner AddPath("/boot/develop/headers/os/device", System, true, false, false); 49286ed3a326342fa2a8c9d9b5d1d7280c9bad2b007Chris Lattner AddPath("/boot/develop/headers/os/drivers", System, true, false, false); 49386ed3a326342fa2a8c9d9b5d1d7280c9bad2b007Chris Lattner AddPath("/boot/develop/headers/os/game", System, true, false, false); 49486ed3a326342fa2a8c9d9b5d1d7280c9bad2b007Chris Lattner AddPath("/boot/develop/headers/os/interface", System, true, false, false); 49586ed3a326342fa2a8c9d9b5d1d7280c9bad2b007Chris Lattner AddPath("/boot/develop/headers/os/kernel", System, true, false, false); 49686ed3a326342fa2a8c9d9b5d1d7280c9bad2b007Chris Lattner AddPath("/boot/develop/headers/os/locale", System, true, false, false); 49786ed3a326342fa2a8c9d9b5d1d7280c9bad2b007Chris Lattner AddPath("/boot/develop/headers/os/mail", System, true, false, false); 49886ed3a326342fa2a8c9d9b5d1d7280c9bad2b007Chris Lattner AddPath("/boot/develop/headers/os/media", System, true, false, false); 49986ed3a326342fa2a8c9d9b5d1d7280c9bad2b007Chris Lattner AddPath("/boot/develop/headers/os/midi", System, true, false, false); 50086ed3a326342fa2a8c9d9b5d1d7280c9bad2b007Chris Lattner AddPath("/boot/develop/headers/os/midi2", System, true, false, false); 50186ed3a326342fa2a8c9d9b5d1d7280c9bad2b007Chris Lattner AddPath("/boot/develop/headers/os/net", System, true, false, false); 50286ed3a326342fa2a8c9d9b5d1d7280c9bad2b007Chris Lattner AddPath("/boot/develop/headers/os/storage", System, true, false, false); 50386ed3a326342fa2a8c9d9b5d1d7280c9bad2b007Chris Lattner AddPath("/boot/develop/headers/os/support", System, true, false, false); 50486ed3a326342fa2a8c9d9b5d1d7280c9bad2b007Chris Lattner AddPath("/boot/develop/headers/os/translation", 50586ed3a326342fa2a8c9d9b5d1d7280c9bad2b007Chris Lattner System, true, false, false); 50686ed3a326342fa2a8c9d9b5d1d7280c9bad2b007Chris Lattner AddPath("/boot/develop/headers/os/add-ons/graphics", 50786ed3a326342fa2a8c9d9b5d1d7280c9bad2b007Chris Lattner System, true, false, false); 50886ed3a326342fa2a8c9d9b5d1d7280c9bad2b007Chris Lattner AddPath("/boot/develop/headers/os/add-ons/input_server", 50986ed3a326342fa2a8c9d9b5d1d7280c9bad2b007Chris Lattner System, true, false, false); 51086ed3a326342fa2a8c9d9b5d1d7280c9bad2b007Chris Lattner AddPath("/boot/develop/headers/os/add-ons/screen_saver", 51186ed3a326342fa2a8c9d9b5d1d7280c9bad2b007Chris Lattner System, true, false, false); 51286ed3a326342fa2a8c9d9b5d1d7280c9bad2b007Chris Lattner AddPath("/boot/develop/headers/os/add-ons/tracker", 51386ed3a326342fa2a8c9d9b5d1d7280c9bad2b007Chris Lattner System, true, false, false); 51486ed3a326342fa2a8c9d9b5d1d7280c9bad2b007Chris Lattner AddPath("/boot/develop/headers/os/be_apps/Deskbar", 51586ed3a326342fa2a8c9d9b5d1d7280c9bad2b007Chris Lattner System, true, false, false); 51686ed3a326342fa2a8c9d9b5d1d7280c9bad2b007Chris Lattner AddPath("/boot/develop/headers/os/be_apps/NetPositive", 51786ed3a326342fa2a8c9d9b5d1d7280c9bad2b007Chris Lattner System, true, false, false); 51886ed3a326342fa2a8c9d9b5d1d7280c9bad2b007Chris Lattner AddPath("/boot/develop/headers/os/be_apps/Tracker", 51986ed3a326342fa2a8c9d9b5d1d7280c9bad2b007Chris Lattner System, true, false, false); 52086ed3a326342fa2a8c9d9b5d1d7280c9bad2b007Chris Lattner AddPath("/boot/develop/headers/cpp", System, true, false, false); 52186ed3a326342fa2a8c9d9b5d1d7280c9bad2b007Chris Lattner AddPath("/boot/develop/headers/cpp/i586-pc-haiku", 52286ed3a326342fa2a8c9d9b5d1d7280c9bad2b007Chris Lattner System, true, false, false); 52386ed3a326342fa2a8c9d9b5d1d7280c9bad2b007Chris Lattner AddPath("/boot/develop/headers/3rdparty", System, true, false, false); 52486ed3a326342fa2a8c9d9b5d1d7280c9bad2b007Chris Lattner AddPath("/boot/develop/headers/bsd", System, true, false, false); 52586ed3a326342fa2a8c9d9b5d1d7280c9bad2b007Chris Lattner AddPath("/boot/develop/headers/glibc", System, true, false, false); 52686ed3a326342fa2a8c9d9b5d1d7280c9bad2b007Chris Lattner AddPath("/boot/develop/headers/posix", System, true, false, false); 52786ed3a326342fa2a8c9d9b5d1d7280c9bad2b007Chris Lattner AddPath("/boot/develop/headers", System, true, false, false); 528a7e6845660f91ec611427e1db842780e1ec12bdbEli Friedman break; 52932df002017e3e8d86bfd3f7090b341d265676fc9NAKAMURA Takumi case llvm::Triple::Cygwin: 53032df002017e3e8d86bfd3f7090b341d265676fc9NAKAMURA Takumi AddPath("/usr/include/w32api", System, true, false, false); 53132df002017e3e8d86bfd3f7090b341d265676fc9NAKAMURA Takumi break; 53243d8176d2e8e304b2d419fb0fe139cc07af80deaMike Stump case llvm::Triple::MinGW64: 533620d57a293143e3f07d6e4f5ba50020a80f45564Mike Stump case llvm::Triple::MinGW32: 53443d8176d2e8e304b2d419fb0fe139cc07af80deaMike Stump AddPath("c:/mingw/include", System, true, false, false); 53543d8176d2e8e304b2d419fb0fe139cc07af80deaMike Stump break; 53643d8176d2e8e304b2d419fb0fe139cc07af80deaMike Stump default: 53743d8176d2e8e304b2d419fb0fe139cc07af80deaMike Stump break; 5380fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber } 539d3f88343af2dec3459493fafa22532317321eaf0John Thompson 540d3f88343af2dec3459493fafa22532317321eaf0John Thompson AddPath("/usr/include", System, false, false, false); 541e4b255c80a786c6f16d3f0362ecb7e1b1e959f63Rafael Espindola} 542e4b255c80a786c6f16d3f0362ecb7e1b1e959f63Rafael Espindola 5430e3cc05542e62fe89345ce94a73494525ee463e0Chris Lattnervoid InitHeaderSearch:: 5440e3cc05542e62fe89345ce94a73494525ee463e0Chris LattnerAddDefaultCPlusPlusIncludePaths(const llvm::Triple &triple) { 545e4b255c80a786c6f16d3f0362ecb7e1b1e959f63Rafael Espindola llvm::Triple::OSType os = triple.getOS(); 546ab7ae95c46f288ac52974aa60334a9575f9a850cRafael Espindola llvm::StringRef CxxIncludeRoot(CXX_INCLUDE_ROOT); 547ab7ae95c46f288ac52974aa60334a9575f9a850cRafael Espindola if (CxxIncludeRoot != "") { 548ab7ae95c46f288ac52974aa60334a9575f9a850cRafael Espindola llvm::StringRef CxxIncludeArch(CXX_INCLUDE_ARCH); 549ab7ae95c46f288ac52974aa60334a9575f9a850cRafael Espindola if (CxxIncludeArch == "") 550ab7ae95c46f288ac52974aa60334a9575f9a850cRafael Espindola AddGnuCPlusPlusIncludePaths(CxxIncludeRoot, triple.str().c_str(), 5510e3cc05542e62fe89345ce94a73494525ee463e0Chris Lattner CXX_INCLUDE_32BIT_DIR, CXX_INCLUDE_64BIT_DIR, 5520e3cc05542e62fe89345ce94a73494525ee463e0Chris Lattner triple); 553ab7ae95c46f288ac52974aa60334a9575f9a850cRafael Espindola else 554ab7ae95c46f288ac52974aa60334a9575f9a850cRafael Espindola AddGnuCPlusPlusIncludePaths(CxxIncludeRoot, CXX_INCLUDE_ARCH, 5550e3cc05542e62fe89345ce94a73494525ee463e0Chris Lattner CXX_INCLUDE_32BIT_DIR, CXX_INCLUDE_64BIT_DIR, 5560e3cc05542e62fe89345ce94a73494525ee463e0Chris Lattner triple); 557ab7ae95c46f288ac52974aa60334a9575f9a850cRafael Espindola return; 558ab7ae95c46f288ac52974aa60334a9575f9a850cRafael Espindola } 559e4b255c80a786c6f16d3f0362ecb7e1b1e959f63Rafael Espindola // FIXME: temporary hack: hard-coded paths. 560e4b255c80a786c6f16d3f0362ecb7e1b1e959f63Rafael Espindola switch (os) { 561e4b255c80a786c6f16d3f0362ecb7e1b1e959f63Rafael Espindola case llvm::Triple::Cygwin: 56232df002017e3e8d86bfd3f7090b341d265676fc9NAKAMURA Takumi // Cygwin-1.7 56332df002017e3e8d86bfd3f7090b341d265676fc9NAKAMURA Takumi AddMinGWCPlusPlusIncludePaths("/usr/lib/gcc", "i686-pc-cygwin", "4.3.4"); 56432df002017e3e8d86bfd3f7090b341d265676fc9NAKAMURA Takumi // g++-4 / Cygwin-1.5 56532df002017e3e8d86bfd3f7090b341d265676fc9NAKAMURA Takumi AddMinGWCPlusPlusIncludePaths("/usr/lib/gcc", "i686-pc-cygwin", "4.3.2"); 56632df002017e3e8d86bfd3f7090b341d265676fc9NAKAMURA Takumi // FIXME: Do we support g++-3.4.4? 56732df002017e3e8d86bfd3f7090b341d265676fc9NAKAMURA Takumi AddMinGWCPlusPlusIncludePaths("/usr/lib/gcc", "i686-pc-cygwin", "3.4.4"); 568e4b255c80a786c6f16d3f0362ecb7e1b1e959f63Rafael Espindola break; 569e4b255c80a786c6f16d3f0362ecb7e1b1e959f63Rafael Espindola case llvm::Triple::MinGW64: 5706a081405e3c8cd41ac68db9e961fe7016900ccd8Chris Lattner // Try gcc 4.5.0 5716a081405e3c8cd41ac68db9e961fe7016900ccd8Chris Lattner AddMinGWCPlusPlusIncludePaths("c:/MinGW/lib/gcc", "mingw64", "4.5.0"); 572e4b255c80a786c6f16d3f0362ecb7e1b1e959f63Rafael Espindola // Try gcc 4.4.0 573e4b255c80a786c6f16d3f0362ecb7e1b1e959f63Rafael Espindola AddMinGWCPlusPlusIncludePaths("c:/MinGW/lib/gcc", "mingw64", "4.4.0"); 574e4b255c80a786c6f16d3f0362ecb7e1b1e959f63Rafael Espindola // Try gcc 4.3.0 575e4b255c80a786c6f16d3f0362ecb7e1b1e959f63Rafael Espindola AddMinGWCPlusPlusIncludePaths("c:/MinGW/lib/gcc", "mingw64", "4.3.0"); 576e4b255c80a786c6f16d3f0362ecb7e1b1e959f63Rafael Espindola // Fall through. 577e4b255c80a786c6f16d3f0362ecb7e1b1e959f63Rafael Espindola case llvm::Triple::MinGW32: 5786a081405e3c8cd41ac68db9e961fe7016900ccd8Chris Lattner // Try gcc 4.5.0 5796a081405e3c8cd41ac68db9e961fe7016900ccd8Chris Lattner AddMinGWCPlusPlusIncludePaths("c:/MinGW/lib/gcc", "mingw32", "4.5.0"); 580e4b255c80a786c6f16d3f0362ecb7e1b1e959f63Rafael Espindola // Try gcc 4.4.0 581e4b255c80a786c6f16d3f0362ecb7e1b1e959f63Rafael Espindola AddMinGWCPlusPlusIncludePaths("c:/MinGW/lib/gcc", "mingw32", "4.4.0"); 582e4b255c80a786c6f16d3f0362ecb7e1b1e959f63Rafael Espindola // Try gcc 4.3.0 583e4b255c80a786c6f16d3f0362ecb7e1b1e959f63Rafael Espindola AddMinGWCPlusPlusIncludePaths("c:/MinGW/lib/gcc", "mingw32", "4.3.0"); 584e4b255c80a786c6f16d3f0362ecb7e1b1e959f63Rafael Espindola break; 585e4b255c80a786c6f16d3f0362ecb7e1b1e959f63Rafael Espindola case llvm::Triple::Darwin: 586f2070b374c1d6fc72aa6bdb2f49c1efdc4f6d963Daniel Dunbar switch (triple.getArch()) { 587f2070b374c1d6fc72aa6bdb2f49c1efdc4f6d963Daniel Dunbar default: break; 588f2070b374c1d6fc72aa6bdb2f49c1efdc4f6d963Daniel Dunbar 589582c30135dce1857db62e58b916ab0fa5edfb1d6Douglas Gregor case llvm::Triple::ppc: 590582c30135dce1857db62e58b916ab0fa5edfb1d6Douglas Gregor case llvm::Triple::ppc64: 591616d4362f01a8f819f9351372c3c4368777d4480Douglas Gregor AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.2.1", 592616d4362f01a8f819f9351372c3c4368777d4480Douglas Gregor "powerpc-apple-darwin10", "", "ppc64", 593616d4362f01a8f819f9351372c3c4368777d4480Douglas Gregor triple); 594582c30135dce1857db62e58b916ab0fa5edfb1d6Douglas Gregor AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.0.0", 595582c30135dce1857db62e58b916ab0fa5edfb1d6Douglas Gregor "powerpc-apple-darwin10", "", "ppc64", 596582c30135dce1857db62e58b916ab0fa5edfb1d6Douglas Gregor triple); 597582c30135dce1857db62e58b916ab0fa5edfb1d6Douglas Gregor break; 598582c30135dce1857db62e58b916ab0fa5edfb1d6Douglas Gregor 599f2070b374c1d6fc72aa6bdb2f49c1efdc4f6d963Daniel Dunbar case llvm::Triple::x86: 600f2070b374c1d6fc72aa6bdb2f49c1efdc4f6d963Daniel Dunbar case llvm::Triple::x86_64: 601f2070b374c1d6fc72aa6bdb2f49c1efdc4f6d963Daniel Dunbar AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.2.1", 602f2070b374c1d6fc72aa6bdb2f49c1efdc4f6d963Daniel Dunbar "i686-apple-darwin10", "", "x86_64", triple); 603f2070b374c1d6fc72aa6bdb2f49c1efdc4f6d963Daniel Dunbar AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.0.0", 604f2070b374c1d6fc72aa6bdb2f49c1efdc4f6d963Daniel Dunbar "i686-apple-darwin8", "", "", triple); 605f2070b374c1d6fc72aa6bdb2f49c1efdc4f6d963Daniel Dunbar break; 606f2070b374c1d6fc72aa6bdb2f49c1efdc4f6d963Daniel Dunbar 607f2070b374c1d6fc72aa6bdb2f49c1efdc4f6d963Daniel Dunbar case llvm::Triple::arm: 608f2070b374c1d6fc72aa6bdb2f49c1efdc4f6d963Daniel Dunbar case llvm::Triple::thumb: 609f2070b374c1d6fc72aa6bdb2f49c1efdc4f6d963Daniel Dunbar AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.2.1", 610f2070b374c1d6fc72aa6bdb2f49c1efdc4f6d963Daniel Dunbar "arm-apple-darwin10", "v7", "", triple); 611f2070b374c1d6fc72aa6bdb2f49c1efdc4f6d963Daniel Dunbar AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.2.1", 612f2070b374c1d6fc72aa6bdb2f49c1efdc4f6d963Daniel Dunbar "arm-apple-darwin10", "v6", "", triple); 613f2070b374c1d6fc72aa6bdb2f49c1efdc4f6d963Daniel Dunbar break; 614f2070b374c1d6fc72aa6bdb2f49c1efdc4f6d963Daniel Dunbar } 615e4b255c80a786c6f16d3f0362ecb7e1b1e959f63Rafael Espindola break; 6167a7ca281bcf50b34de1ce067d3c55879b81722aeChris Lattner case llvm::Triple::DragonFly: 6177a7ca281bcf50b34de1ce067d3c55879b81722aeChris Lattner AddPath("/usr/include/c++/4.1", System, true, false, false); 6187a7ca281bcf50b34de1ce067d3c55879b81722aeChris Lattner break; 619e4b255c80a786c6f16d3f0362ecb7e1b1e959f63Rafael Espindola case llvm::Triple::Linux: 620ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m //===------------------------------------------------------------------===// 621ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m // Debian based distros. 622ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m // Note: these distros symlink /usr/include/c++/X.Y.Z -> X.Y 623ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m //===------------------------------------------------------------------===// 624c12bbe5cbee8936204d286e17d8e0511dd67ddb4Rafael Espindola // Ubuntu 10.10 "Maverick Meerkat" -- gcc-4.4.5 625adafdbae908a8e798fa4940ed89f61597b3d7ca5Rafael Espindola AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.4", 626adafdbae908a8e798fa4940ed89f61597b3d7ca5Rafael Espindola "i686-linux-gnu", "", "64", triple); 627adafdbae908a8e798fa4940ed89f61597b3d7ca5Rafael Espindola // The rest of 10.10 is the same as previous versions. 628adafdbae908a8e798fa4940ed89f61597b3d7ca5Rafael Espindola 629ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m // Ubuntu 10.04 LTS "Lucid Lynx" -- gcc-4.4.3 630ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m // Ubuntu 9.10 "Karmic Koala" -- gcc-4.4.1 631ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m // Debian 6.0 "squeeze" -- gcc-4.4.2 632e69f047a6c882ce36bd260a8fed0ae31114a5a7eNick Lewycky AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.4", 633331e8010aed1c2175328ed470aea75e93ff70b32Torok Edwin "x86_64-linux-gnu", "32", "", triple); 634e69f047a6c882ce36bd260a8fed0ae31114a5a7eNick Lewycky AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.4", 635ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m "i486-linux-gnu", "", "64", triple); 636db0835552ff4b640bc908a50ccd075ab63cf6fffNick Lewycky AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.4", 637db0835552ff4b640bc908a50ccd075ab63cf6fffNick Lewycky "arm-linux-gnueabi", "", "", triple); 638ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m // Ubuntu 9.04 "Jaunty Jackalope" -- gcc-4.3.3 639ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m // Ubuntu 8.10 "Intrepid Ibex" -- gcc-4.3.2 640ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m // Debian 5.0 "lenny" -- gcc-4.3.2 641ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.3", 642ab7ae95c46f288ac52974aa60334a9575f9a850cRafael Espindola "x86_64-linux-gnu", "32", "", triple); 643ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.3", 644ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m "i486-linux-gnu", "", "64", triple); 645e7d6c2cae6a9b9985db02cfc8bb4e7b714630ed5Rafael Espindola AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.3", 646e7d6c2cae6a9b9985db02cfc8bb4e7b714630ed5Rafael Espindola "arm-linux-gnueabi", "", "", triple); 647ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m // Ubuntu 8.04.4 LTS "Hardy Heron" -- gcc-4.2.4 648ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m // Ubuntu 8.04.[0-3] LTS "Hardy Heron" -- gcc-4.2.3 649ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.2", 650ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m "x86_64-linux-gnu", "32", "", triple); 651ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.2", 652ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m "i486-linux-gnu", "", "64", triple); 653ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m // Ubuntu 7.10 "Gutsy Gibbon" -- gcc-4.1.3 654ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.1", 655ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m "x86_64-linux-gnu", "32", "", triple); 656ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.1", 657ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m "i486-linux-gnu", "", "64", triple); 658189a14869a36ecf8bd5edc94255a34061044efe2Nuno Lopes 659ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m //===------------------------------------------------------------------===// 660ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m // Redhat based distros. 661ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m //===------------------------------------------------------------------===// 6626638b3a15edea25c4b1fdf8046e71d82683d8efaRafael Espindola // Fedora 14 6636638b3a15edea25c4b1fdf8046e71d82683d8efaRafael Espindola AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.5.1", 6646638b3a15edea25c4b1fdf8046e71d82683d8efaRafael Espindola "x86_64-redhat-linux", "32", "", triple); 6656638b3a15edea25c4b1fdf8046e71d82683d8efaRafael Espindola AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.5.1", 6666638b3a15edea25c4b1fdf8046e71d82683d8efaRafael Espindola "i686-redhat-linux", "", "", triple); 667ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m // Fedora 13 6684336e191cc52aa1ef72f9a542f5a6d5f9f02a825Chris Lattner AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.4.4", 6694336e191cc52aa1ef72f9a542f5a6d5f9f02a825Chris Lattner "x86_64-redhat-linux", "32", "", triple); 6704336e191cc52aa1ef72f9a542f5a6d5f9f02a825Chris Lattner AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.4.4", 6714336e191cc52aa1ef72f9a542f5a6d5f9f02a825Chris Lattner "i686-redhat-linux","", "", triple); 672ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m // Fedora 12 673ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.4.3", 6740720b5159010479c08f8264a8a209037ecf55922Chris Lattner "x86_64-redhat-linux", "32", "", triple); 675ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.4.3", 676ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m "i686-redhat-linux","", "", triple); 677ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m // Fedora 12 (pre-FEB-2010) 678ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.4.2", 679ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m "x86_64-redhat-linux", "32", "", triple); 680ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.4.2", 681ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m "i686-redhat-linux","", "", triple); 682189a14869a36ecf8bd5edc94255a34061044efe2Nuno Lopes // Fedora 11 683189a14869a36ecf8bd5edc94255a34061044efe2Nuno Lopes AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.4.1", 684ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m "x86_64-redhat-linux", "32", "", triple); 685ea00f847a0e1771b1fcfe683d3506940dc2de1ecChris Lattner AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.4.1", 686ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m "i586-redhat-linux","", "", triple); 687ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m // Fedora 10 688ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.3.2", 689ea00f847a0e1771b1fcfe683d3506940dc2de1ecChris Lattner "x86_64-redhat-linux", "32", "", triple); 690ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.3.2", 691ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m "i386-redhat-linux","", "", triple); 692ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m // Fedora 9 693ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.3.0", 694ea00f847a0e1771b1fcfe683d3506940dc2de1ecChris Lattner "x86_64-redhat-linux", "32", "", triple); 695ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.3.0", 696ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m "i386-redhat-linux", "", "", triple); 697ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m // Fedora 8 698ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.1.2", 699ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m "x86_64-redhat-linux", "", "", triple); 700ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.1.2", 701ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m "i386-redhat-linux", "", "", triple); 702ea00f847a0e1771b1fcfe683d3506940dc2de1ecChris Lattner 703ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m //===------------------------------------------------------------------===// 704ea00f847a0e1771b1fcfe683d3506940dc2de1ecChris Lattner 705ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m // Exherbo (2010-01-25) 706ea00f847a0e1771b1fcfe683d3506940dc2de1ecChris Lattner AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.4.3", 707ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m "x86_64-pc-linux-gnu", "32", "", triple); 708ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.4.3", 709ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m "i686-pc-linux-gnu", "", "", triple); 710ea00f847a0e1771b1fcfe683d3506940dc2de1ecChris Lattner 711e4b255c80a786c6f16d3f0362ecb7e1b1e959f63Rafael Espindola // openSUSE 11.1 32 bit 712e4b255c80a786c6f16d3f0362ecb7e1b1e959f63Rafael Espindola AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.3", 713ab7ae95c46f288ac52974aa60334a9575f9a850cRafael Espindola "i586-suse-linux", "", "", triple); 714e4b255c80a786c6f16d3f0362ecb7e1b1e959f63Rafael Espindola // openSUSE 11.1 64 bit 715e4b255c80a786c6f16d3f0362ecb7e1b1e959f63Rafael Espindola AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.3", 716ab7ae95c46f288ac52974aa60334a9575f9a850cRafael Espindola "x86_64-suse-linux", "32", "", triple); 717e4b255c80a786c6f16d3f0362ecb7e1b1e959f63Rafael Espindola // openSUSE 11.2 718e4b255c80a786c6f16d3f0362ecb7e1b1e959f63Rafael Espindola AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.4", 719ab7ae95c46f288ac52974aa60334a9575f9a850cRafael Espindola "i586-suse-linux", "", "", triple); 720e4b255c80a786c6f16d3f0362ecb7e1b1e959f63Rafael Espindola AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.4", 721ab7ae95c46f288ac52974aa60334a9575f9a850cRafael Espindola "x86_64-suse-linux", "", "", triple); 7229d2c06001b0c09fdb0f973cd6f8fa5555aea1b5fRafael Espindola 7239d2c06001b0c09fdb0f973cd6f8fa5555aea1b5fRafael Espindola // openSUSE 11.4 7249d2c06001b0c09fdb0f973cd6f8fa5555aea1b5fRafael Espindola AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.5", 7259d2c06001b0c09fdb0f973cd6f8fa5555aea1b5fRafael Espindola "i586-suse-linux", "", "", triple); 7269d2c06001b0c09fdb0f973cd6f8fa5555aea1b5fRafael Espindola AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.5", 7279d2c06001b0c09fdb0f973cd6f8fa5555aea1b5fRafael Espindola "x86_64-suse-linux", "", "", triple); 7289d2c06001b0c09fdb0f973cd6f8fa5555aea1b5fRafael Espindola 729e4b255c80a786c6f16d3f0362ecb7e1b1e959f63Rafael Espindola // Arch Linux 2008-06-24 730e4b255c80a786c6f16d3f0362ecb7e1b1e959f63Rafael Espindola AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.3.1", 731ab7ae95c46f288ac52974aa60334a9575f9a850cRafael Espindola "i686-pc-linux-gnu", "", "", triple); 732e4b255c80a786c6f16d3f0362ecb7e1b1e959f63Rafael Espindola AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.3.1", 733ab7ae95c46f288ac52974aa60334a9575f9a850cRafael Espindola "x86_64-unknown-linux-gnu", "", "", triple); 7340d155a5e1d6406d27df5779d0c9fb98d49a713a0Nuno Lopes // Gentoo x86 2010.0 stable 7350d155a5e1d6406d27df5779d0c9fb98d49a713a0Nuno Lopes AddGnuCPlusPlusIncludePaths( 7360d155a5e1d6406d27df5779d0c9fb98d49a713a0Nuno Lopes "/usr/lib/gcc/i686-pc-linux-gnu/4.4.3/include/g++-v4", 7370d155a5e1d6406d27df5779d0c9fb98d49a713a0Nuno Lopes "i686-pc-linux-gnu", "", "", triple); 738e4b255c80a786c6f16d3f0362ecb7e1b1e959f63Rafael Espindola // Gentoo x86 2009.1 stable 739e4b255c80a786c6f16d3f0362ecb7e1b1e959f63Rafael Espindola AddGnuCPlusPlusIncludePaths( 74040d1bb6383c14d5f8249d0640e8088a91b694c66John Thompson "/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4", 741ab7ae95c46f288ac52974aa60334a9575f9a850cRafael Espindola "i686-pc-linux-gnu", "", "", triple); 742e4b255c80a786c6f16d3f0362ecb7e1b1e959f63Rafael Espindola // Gentoo x86 2009.0 stable 743e4b255c80a786c6f16d3f0362ecb7e1b1e959f63Rafael Espindola AddGnuCPlusPlusIncludePaths( 74440d1bb6383c14d5f8249d0640e8088a91b694c66John Thompson "/usr/lib/gcc/i686-pc-linux-gnu/4.3.2/include/g++-v4", 745ab7ae95c46f288ac52974aa60334a9575f9a850cRafael Espindola "i686-pc-linux-gnu", "", "", triple); 746e4b255c80a786c6f16d3f0362ecb7e1b1e959f63Rafael Espindola // Gentoo x86 2008.0 stable 747e4b255c80a786c6f16d3f0362ecb7e1b1e959f63Rafael Espindola AddGnuCPlusPlusIncludePaths( 74840d1bb6383c14d5f8249d0640e8088a91b694c66John Thompson "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/g++-v4", 749ab7ae95c46f288ac52974aa60334a9575f9a850cRafael Espindola "i686-pc-linux-gnu", "", "", triple); 750fbfdb202405df65e054db4ad2111393c1b581d2dChandler Carruth 751fbfdb202405df65e054db4ad2111393c1b581d2dChandler Carruth // Gentoo amd64 gcc 4.4.5 752e4b255c80a786c6f16d3f0362ecb7e1b1e959f63Rafael Espindola AddGnuCPlusPlusIncludePaths( 753fbfdb202405df65e054db4ad2111393c1b581d2dChandler Carruth "/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.5/include/g++-v4", 754fbfdb202405df65e054db4ad2111393c1b581d2dChandler Carruth "x86_64-pc-linux-gnu", "32", "", triple); 755fbfdb202405df65e054db4ad2111393c1b581d2dChandler Carruth // Gentoo amd64 gcc 4.4.4 75670d9d4196e6531926ca18b2ca850eb218041488dEric Christopher AddGnuCPlusPlusIncludePaths( 757fbfdb202405df65e054db4ad2111393c1b581d2dChandler Carruth "/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.4/include/g++-v4", 758fbfdb202405df65e054db4ad2111393c1b581d2dChandler Carruth "x86_64-pc-linux-gnu", "32", "", triple); 75970d9d4196e6531926ca18b2ca850eb218041488dEric Christopher // Gentoo amd64 gcc 4.4.3 76070d9d4196e6531926ca18b2ca850eb218041488dEric Christopher AddGnuCPlusPlusIncludePaths( 76170d9d4196e6531926ca18b2ca850eb218041488dEric Christopher "/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.3/include/g++-v4", 76270d9d4196e6531926ca18b2ca850eb218041488dEric Christopher "x86_64-pc-linux-gnu", "32", "", triple); 763fbfdb202405df65e054db4ad2111393c1b581d2dChandler Carruth // Gentoo amd64 gcc 4.3.2 7648ad8a1cc1e39d70345d45ef1b8564ec6cbf49471Nico Weber AddGnuCPlusPlusIncludePaths( 765fbfdb202405df65e054db4ad2111393c1b581d2dChandler Carruth "/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.2/include/g++-v4", 766fbfdb202405df65e054db4ad2111393c1b581d2dChandler Carruth "x86_64-pc-linux-gnu", "", "", triple); 767fbfdb202405df65e054db4ad2111393c1b581d2dChandler Carruth // Gentoo amd64 stable 768fbfdb202405df65e054db4ad2111393c1b581d2dChandler Carruth AddGnuCPlusPlusIncludePaths( 769fbfdb202405df65e054db4ad2111393c1b581d2dChandler Carruth "/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.2/include/g++-v4", 770fbfdb202405df65e054db4ad2111393c1b581d2dChandler Carruth "i686-pc-linux-gnu", "", "", triple); 7718ad8a1cc1e39d70345d45ef1b8564ec6cbf49471Nico Weber 7726693534adb31fdd13b1ee873df3e90c99f916ad5Nick Lewycky // Gentoo amd64 llvm-gcc trunk 7736693534adb31fdd13b1ee873df3e90c99f916ad5Nick Lewycky AddGnuCPlusPlusIncludePaths( 7746693534adb31fdd13b1ee873df3e90c99f916ad5Nick Lewycky "/usr/lib/llvm-gcc-4.2-9999/include/c++/4.2.1", 7756693534adb31fdd13b1ee873df3e90c99f916ad5Nick Lewycky "x86_64-pc-linux-gnu", "", "", triple); 776fbfdb202405df65e054db4ad2111393c1b581d2dChandler Carruth 777e4b255c80a786c6f16d3f0362ecb7e1b1e959f63Rafael Espindola break; 778e4b255c80a786c6f16d3f0362ecb7e1b1e959f63Rafael Espindola case llvm::Triple::FreeBSD: 779ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m // FreeBSD 8.0 780ac78b7a7af0e67f2f4f45d9d94393c281ff4417bmike-m // FreeBSD 7.3 781afe859a9a6217f177daf42ebab294a90bfe8a6abNuno Lopes AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.2", "", "", "", triple); 782e4b255c80a786c6f16d3f0362ecb7e1b1e959f63Rafael Espindola break; 783ab079419ff2e52652be349e949202a2470f8d253Anton Korobeynikov case llvm::Triple::NetBSD: 784ab079419ff2e52652be349e949202a2470f8d253Anton Korobeynikov AddGnuCPlusPlusIncludePaths("/usr/include/g++", "", "", "", triple); 785ab079419ff2e52652be349e949202a2470f8d253Anton Korobeynikov break; 78695c0457054518102af6250e718a13a5b2ee5dbeaDaniel Dunbar case llvm::Triple::OpenBSD: { 78795c0457054518102af6250e718a13a5b2ee5dbeaDaniel Dunbar std::string t = triple.getTriple(); 78895c0457054518102af6250e718a13a5b2ee5dbeaDaniel Dunbar if (t.substr(0, 6) == "x86_64") 78995c0457054518102af6250e718a13a5b2ee5dbeaDaniel Dunbar t.replace(0, 6, "amd64"); 79095c0457054518102af6250e718a13a5b2ee5dbeaDaniel Dunbar AddGnuCPlusPlusIncludePaths("/usr/include/g++", 79195c0457054518102af6250e718a13a5b2ee5dbeaDaniel Dunbar t, "", "", triple); 79295c0457054518102af6250e718a13a5b2ee5dbeaDaniel Dunbar break; 79395c0457054518102af6250e718a13a5b2ee5dbeaDaniel Dunbar } 79438e317d6dce161b249508686cc67eb7176958762Chris Lattner case llvm::Triple::Minix: 79538e317d6dce161b249508686cc67eb7176958762Chris Lattner AddGnuCPlusPlusIncludePaths("/usr/gnu/include/c++/4.4.3", 79638e317d6dce161b249508686cc67eb7176958762Chris Lattner "", "", "", triple); 79738e317d6dce161b249508686cc67eb7176958762Chris Lattner break; 798e4b255c80a786c6f16d3f0362ecb7e1b1e959f63Rafael Espindola case llvm::Triple::Solaris: 799e4b255c80a786c6f16d3f0362ecb7e1b1e959f63Rafael Espindola // Solaris - Fall though.. 800e4b255c80a786c6f16d3f0362ecb7e1b1e959f63Rafael Espindola case llvm::Triple::AuroraUX: 801e4b255c80a786c6f16d3f0362ecb7e1b1e959f63Rafael Espindola // AuroraUX 802e4b255c80a786c6f16d3f0362ecb7e1b1e959f63Rafael Espindola AddGnuCPlusPlusIncludePaths("/opt/gcc4/include/c++/4.2.4", 803ab7ae95c46f288ac52974aa60334a9575f9a850cRafael Espindola "i386-pc-solaris2.11", "", "", triple); 804e4b255c80a786c6f16d3f0362ecb7e1b1e959f63Rafael Espindola break; 805e4b255c80a786c6f16d3f0362ecb7e1b1e959f63Rafael Espindola default: 806e4b255c80a786c6f16d3f0362ecb7e1b1e959f63Rafael Espindola break; 807e4b255c80a786c6f16d3f0362ecb7e1b1e959f63Rafael Espindola } 808e4b255c80a786c6f16d3f0362ecb7e1b1e959f63Rafael Espindola} 809e4b255c80a786c6f16d3f0362ecb7e1b1e959f63Rafael Espindola 810e4b255c80a786c6f16d3f0362ecb7e1b1e959f63Rafael Espindolavoid InitHeaderSearch::AddDefaultSystemIncludePaths(const LangOptions &Lang, 8114c2bcad7b843c10fd4a2ffd43da40bfefb4dc8baDouglas Gregor const llvm::Triple &triple, 81279bc57c074cb91f574fba19215f95b63dcf6b04bmike-m const HeaderSearchOptions &HSOpts) { 81380c26f44a6f8d859a2a3babb06bd3ca8d86f2623Daniel Dunbar if (Lang.CPlusPlus && HSOpts.UseStandardCXXIncludes) { 81480c26f44a6f8d859a2a3babb06bd3ca8d86f2623Daniel Dunbar if (!HSOpts.CXXSystemIncludes.empty()) { 81580c26f44a6f8d859a2a3babb06bd3ca8d86f2623Daniel Dunbar for (unsigned i = 0, e = HSOpts.CXXSystemIncludes.size(); i != e; ++i) 81680c26f44a6f8d859a2a3babb06bd3ca8d86f2623Daniel Dunbar AddPath(HSOpts.CXXSystemIncludes[i], System, true, false, false); 81780c26f44a6f8d859a2a3babb06bd3ca8d86f2623Daniel Dunbar } else 81880c26f44a6f8d859a2a3babb06bd3ca8d86f2623Daniel Dunbar AddDefaultCPlusPlusIncludePaths(triple); 81980c26f44a6f8d859a2a3babb06bd3ca8d86f2623Daniel Dunbar } 8206ec18a3f86c702004af66cce6ff979999a736898Rafael Espindola 82179bc57c074cb91f574fba19215f95b63dcf6b04bmike-m AddDefaultCIncludePaths(triple, HSOpts); 822e166582f8f36f4db8f4ea157538fab7fe6bf2658Daniel Dunbar 823e166582f8f36f4db8f4ea157538fab7fe6bf2658Daniel Dunbar // Add the default framework include paths on Darwin. 824e166582f8f36f4db8f4ea157538fab7fe6bf2658Daniel Dunbar if (triple.getOS() == llvm::Triple::Darwin) { 825e166582f8f36f4db8f4ea157538fab7fe6bf2658Daniel Dunbar AddPath("/System/Library/Frameworks", System, true, false, true); 826e166582f8f36f4db8f4ea157538fab7fe6bf2658Daniel Dunbar AddPath("/Library/Frameworks", System, true, false, true); 827e166582f8f36f4db8f4ea157538fab7fe6bf2658Daniel Dunbar } 828e4b255c80a786c6f16d3f0362ecb7e1b1e959f63Rafael Espindola} 829e4b255c80a786c6f16d3f0362ecb7e1b1e959f63Rafael Espindola 8300fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber/// RemoveDuplicates - If there are duplicate directory entries in the specified 8310fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber/// search list, remove the later (dead) ones. 8320fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weberstatic void RemoveDuplicates(std::vector<DirectoryLookup> &SearchList, 8330fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber bool Verbose) { 8340fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber llvm::SmallPtrSet<const DirectoryEntry *, 8> SeenDirs; 8350fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber llvm::SmallPtrSet<const DirectoryEntry *, 8> SeenFrameworkDirs; 8360fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber llvm::SmallPtrSet<const HeaderMap *, 8> SeenHeaderMaps; 8370fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber for (unsigned i = 0; i != SearchList.size(); ++i) { 8387a739401983eb9bc25c9b4b25177e116f5e5ba92Chris Lattner unsigned DirToRemove = i; 8391eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump 84043eee07270bf1966ea7289310066aa670c4b647fChris Lattner const DirectoryLookup &CurEntry = SearchList[i]; 8411eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump 84243eee07270bf1966ea7289310066aa670c4b647fChris Lattner if (CurEntry.isNormalDir()) { 8430fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber // If this isn't the first time we've seen this dir, remove it. 84443eee07270bf1966ea7289310066aa670c4b647fChris Lattner if (SeenDirs.insert(CurEntry.getDir())) 8450fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber continue; 84643eee07270bf1966ea7289310066aa670c4b647fChris Lattner } else if (CurEntry.isFramework()) { 8470fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber // If this isn't the first time we've seen this framework dir, remove it. 84843eee07270bf1966ea7289310066aa670c4b647fChris Lattner if (SeenFrameworkDirs.insert(CurEntry.getFrameworkDir())) 8490fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber continue; 8500fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber } else { 85143eee07270bf1966ea7289310066aa670c4b647fChris Lattner assert(CurEntry.isHeaderMap() && "Not a headermap or normal dir?"); 8520fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber // If this isn't the first time we've seen this headermap, remove it. 85343eee07270bf1966ea7289310066aa670c4b647fChris Lattner if (SeenHeaderMaps.insert(CurEntry.getHeaderMap())) 8540fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber continue; 85530f05b553db067c994966daca37e75324ee7b424Chris Lattner } 8561eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump 85730f05b553db067c994966daca37e75324ee7b424Chris Lattner // If we have a normal #include dir/framework/headermap that is shadowed 85830f05b553db067c994966daca37e75324ee7b424Chris Lattner // later in the chain by a system include location, we actually want to 85930f05b553db067c994966daca37e75324ee7b424Chris Lattner // ignore the user's request and drop the user dir... keeping the system 86030f05b553db067c994966daca37e75324ee7b424Chris Lattner // dir. This is weird, but required to emulate GCC's search path correctly. 86130f05b553db067c994966daca37e75324ee7b424Chris Lattner // 86230f05b553db067c994966daca37e75324ee7b424Chris Lattner // Since dupes of system dirs are rare, just rescan to find the original 86330f05b553db067c994966daca37e75324ee7b424Chris Lattner // that we're nuking instead of using a DenseMap. 86443eee07270bf1966ea7289310066aa670c4b647fChris Lattner if (CurEntry.getDirCharacteristic() != SrcMgr::C_User) { 86530f05b553db067c994966daca37e75324ee7b424Chris Lattner // Find the dir that this is the same of. 86630f05b553db067c994966daca37e75324ee7b424Chris Lattner unsigned FirstDir; 86730f05b553db067c994966daca37e75324ee7b424Chris Lattner for (FirstDir = 0; ; ++FirstDir) { 86830f05b553db067c994966daca37e75324ee7b424Chris Lattner assert(FirstDir != i && "Didn't find dupe?"); 8691eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump 87043eee07270bf1966ea7289310066aa670c4b647fChris Lattner const DirectoryLookup &SearchEntry = SearchList[FirstDir]; 87143eee07270bf1966ea7289310066aa670c4b647fChris Lattner 87230f05b553db067c994966daca37e75324ee7b424Chris Lattner // If these are different lookup types, then they can't be the dupe. 87343eee07270bf1966ea7289310066aa670c4b647fChris Lattner if (SearchEntry.getLookupType() != CurEntry.getLookupType()) 87430f05b553db067c994966daca37e75324ee7b424Chris Lattner continue; 8751eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump 87630f05b553db067c994966daca37e75324ee7b424Chris Lattner bool isSame; 87743eee07270bf1966ea7289310066aa670c4b647fChris Lattner if (CurEntry.isNormalDir()) 87843eee07270bf1966ea7289310066aa670c4b647fChris Lattner isSame = SearchEntry.getDir() == CurEntry.getDir(); 87943eee07270bf1966ea7289310066aa670c4b647fChris Lattner else if (CurEntry.isFramework()) 88043eee07270bf1966ea7289310066aa670c4b647fChris Lattner isSame = SearchEntry.getFrameworkDir() == CurEntry.getFrameworkDir(); 88130f05b553db067c994966daca37e75324ee7b424Chris Lattner else { 88243eee07270bf1966ea7289310066aa670c4b647fChris Lattner assert(CurEntry.isHeaderMap() && "Not a headermap or normal dir?"); 88343eee07270bf1966ea7289310066aa670c4b647fChris Lattner isSame = SearchEntry.getHeaderMap() == CurEntry.getHeaderMap(); 88430f05b553db067c994966daca37e75324ee7b424Chris Lattner } 8851eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump 88630f05b553db067c994966daca37e75324ee7b424Chris Lattner if (isSame) 88730f05b553db067c994966daca37e75324ee7b424Chris Lattner break; 88830f05b553db067c994966daca37e75324ee7b424Chris Lattner } 8891eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump 89030f05b553db067c994966daca37e75324ee7b424Chris Lattner // If the first dir in the search path is a non-system dir, zap it 89130f05b553db067c994966daca37e75324ee7b424Chris Lattner // instead of the system one. 89230f05b553db067c994966daca37e75324ee7b424Chris Lattner if (SearchList[FirstDir].getDirCharacteristic() == SrcMgr::C_User) 89330f05b553db067c994966daca37e75324ee7b424Chris Lattner DirToRemove = FirstDir; 89430f05b553db067c994966daca37e75324ee7b424Chris Lattner } 89530f05b553db067c994966daca37e75324ee7b424Chris Lattner 89630f05b553db067c994966daca37e75324ee7b424Chris Lattner if (Verbose) { 897e7cb7e4570842297f698bd7fd8d85520fc008acdDaniel Dunbar llvm::errs() << "ignoring duplicate directory \"" 898e7cb7e4570842297f698bd7fd8d85520fc008acdDaniel Dunbar << CurEntry.getName() << "\"\n"; 89930f05b553db067c994966daca37e75324ee7b424Chris Lattner if (DirToRemove != i) 900e7cb7e4570842297f698bd7fd8d85520fc008acdDaniel Dunbar llvm::errs() << " as it is a non-system directory that duplicates " 901e7cb7e4570842297f698bd7fd8d85520fc008acdDaniel Dunbar << "a system directory\n"; 9020fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber } 9031eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump 9047a739401983eb9bc25c9b4b25177e116f5e5ba92Chris Lattner // This is reached if the current entry is a duplicate. Remove the 9057a739401983eb9bc25c9b4b25177e116f5e5ba92Chris Lattner // DirToRemove (usually the current dir). 9067a739401983eb9bc25c9b4b25177e116f5e5ba92Chris Lattner SearchList.erase(SearchList.begin()+DirToRemove); 9070fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber --i; 9080fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber } 9090fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber} 9100fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber 9110fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber 9120fca022d77b89100e746f4d659b84ed5b1ee0158Nico Webervoid InitHeaderSearch::Realize() { 9130fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber // Concatenate ANGLE+SYSTEM+AFTER chains together into SearchList. 9140fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber std::vector<DirectoryLookup> SearchList; 9150fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber SearchList = IncludeGroup[Angled]; 9160fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber SearchList.insert(SearchList.end(), IncludeGroup[System].begin(), 9170fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber IncludeGroup[System].end()); 9180fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber SearchList.insert(SearchList.end(), IncludeGroup[After].begin(), 9190fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber IncludeGroup[After].end()); 9200fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber RemoveDuplicates(SearchList, Verbose); 9210fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber RemoveDuplicates(IncludeGroup[Quoted], Verbose); 9221eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump 9230fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber // Prepend QUOTED list on the search list. 9241eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump SearchList.insert(SearchList.begin(), IncludeGroup[Quoted].begin(), 9250fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber IncludeGroup[Quoted].end()); 9261eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump 9270fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber 9280fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber bool DontSearchCurDir = false; // TODO: set to true if -I- is set? 9290fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber Headers.SetSearchPaths(SearchList, IncludeGroup[Quoted].size(), 9300fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber DontSearchCurDir); 9310fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber 9320fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber // If verbose, print the list of directories that will be searched. 9330fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber if (Verbose) { 934e7cb7e4570842297f698bd7fd8d85520fc008acdDaniel Dunbar llvm::errs() << "#include \"...\" search starts here:\n"; 9350fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber unsigned QuotedIdx = IncludeGroup[Quoted].size(); 9360fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber for (unsigned i = 0, e = SearchList.size(); i != e; ++i) { 9370fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber if (i == QuotedIdx) 938e7cb7e4570842297f698bd7fd8d85520fc008acdDaniel Dunbar llvm::errs() << "#include <...> search starts here:\n"; 9390fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber const char *Name = SearchList[i].getName(); 9400fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber const char *Suffix; 9410fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber if (SearchList[i].isNormalDir()) 9420fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber Suffix = ""; 9430fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber else if (SearchList[i].isFramework()) 9440fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber Suffix = " (framework directory)"; 9450fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber else { 9460fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber assert(SearchList[i].isHeaderMap() && "Unknown DirectoryLookup"); 9470fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber Suffix = " (headermap)"; 9480fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber } 949e7cb7e4570842297f698bd7fd8d85520fc008acdDaniel Dunbar llvm::errs() << " " << Name << Suffix << "\n"; 9500fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber } 951e7cb7e4570842297f698bd7fd8d85520fc008acdDaniel Dunbar llvm::errs() << "End of search list.\n"; 9520fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber } 9530fca022d77b89100e746f4d659b84ed5b1ee0158Nico Weber} 95463c8b77334f90472260d2f48df2742ed5067261eDaniel Dunbar 9555814e657c9ad9ef6049a2a4af0d2aad248a8a15cDaniel Dunbarvoid clang::ApplyHeaderSearchOptions(HeaderSearch &HS, 9565814e657c9ad9ef6049a2a4af0d2aad248a8a15cDaniel Dunbar const HeaderSearchOptions &HSOpts, 9575814e657c9ad9ef6049a2a4af0d2aad248a8a15cDaniel Dunbar const LangOptions &Lang, 95863c8b77334f90472260d2f48df2742ed5067261eDaniel Dunbar const llvm::Triple &Triple) { 95963c8b77334f90472260d2f48df2742ed5067261eDaniel Dunbar InitHeaderSearch Init(HS, HSOpts.Verbose, HSOpts.Sysroot); 96063c8b77334f90472260d2f48df2742ed5067261eDaniel Dunbar 96163c8b77334f90472260d2f48df2742ed5067261eDaniel Dunbar // Add the user defined entries. 96263c8b77334f90472260d2f48df2742ed5067261eDaniel Dunbar for (unsigned i = 0, e = HSOpts.UserEntries.size(); i != e; ++i) { 96363c8b77334f90472260d2f48df2742ed5067261eDaniel Dunbar const HeaderSearchOptions::Entry &E = HSOpts.UserEntries[i]; 9641b483e70ad3f670f6dd0bc62dbe0921a28195f24Daniel Dunbar Init.AddPath(E.Path, E.Group, false, E.IsUserSupplied, E.IsFramework, 96523637beead1fce7dac755890c9482bcdce538b87Chris Lattner !E.IsSysRootRelative); 96663c8b77334f90472260d2f48df2742ed5067261eDaniel Dunbar } 96763c8b77334f90472260d2f48df2742ed5067261eDaniel Dunbar 96863c8b77334f90472260d2f48df2742ed5067261eDaniel Dunbar // Add entries from CPATH and friends. 9699e9ddf6100fd50ca2f9f9d0106b856e20b43300fBenjamin Kramer Init.AddDelimitedPaths(HSOpts.EnvIncPath); 970c363cb1929c7908c8c8c4b77d025c2ccb09284aeDaniel Dunbar if (Lang.CPlusPlus && Lang.ObjC1) 9719e9ddf6100fd50ca2f9f9d0106b856e20b43300fBenjamin Kramer Init.AddDelimitedPaths(HSOpts.ObjCXXEnvIncPath); 972c363cb1929c7908c8c8c4b77d025c2ccb09284aeDaniel Dunbar else if (Lang.CPlusPlus) 9739e9ddf6100fd50ca2f9f9d0106b856e20b43300fBenjamin Kramer Init.AddDelimitedPaths(HSOpts.CXXEnvIncPath); 974c363cb1929c7908c8c8c4b77d025c2ccb09284aeDaniel Dunbar else if (Lang.ObjC1) 9759e9ddf6100fd50ca2f9f9d0106b856e20b43300fBenjamin Kramer Init.AddDelimitedPaths(HSOpts.ObjCEnvIncPath); 976c363cb1929c7908c8c8c4b77d025c2ccb09284aeDaniel Dunbar else 9779e9ddf6100fd50ca2f9f9d0106b856e20b43300fBenjamin Kramer Init.AddDelimitedPaths(HSOpts.CEnvIncPath); 97863c8b77334f90472260d2f48df2742ed5067261eDaniel Dunbar 979dd35ce9a783dea7e6660f9cb1d973742f3b3c73fDaniel Dunbar if (HSOpts.UseStandardIncludes) 98079bc57c074cb91f574fba19215f95b63dcf6b04bmike-m Init.AddDefaultSystemIncludePaths(Lang, Triple, HSOpts); 98163c8b77334f90472260d2f48df2742ed5067261eDaniel Dunbar 98263c8b77334f90472260d2f48df2742ed5067261eDaniel Dunbar Init.Realize(); 98363c8b77334f90472260d2f48df2742ed5067261eDaniel Dunbar} 984