r231913 - Fix up default header paths for CloudABI.
Ed Schouten
ed at nuxi.nl
Wed Mar 11 01:46:01 PDT 2015
Author: ed
Date: Wed Mar 11 03:46:01 2015
New Revision: 231913
URL: http://llvm.org/viewvc/llvm-project?rev=231913&view=rev
Log:
Fix up default header paths for CloudABI.
CloudABI is a pure cross compilation target. This means that we should
not add /usr/include and /usr/local/include. Instead, headers are stored
in $sysroot/$triple/include.
The method of going back to the sysroot (by using "../../..") is also
used in this function for some of the other environments (e.g., MinGW).
Modified:
cfe/trunk/lib/Frontend/InitHeaderSearch.cpp
Modified: cfe/trunk/lib/Frontend/InitHeaderSearch.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/InitHeaderSearch.cpp?rev=231913&r1=231912&r2=231913&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/InitHeaderSearch.cpp (original)
+++ cfe/trunk/lib/Frontend/InitHeaderSearch.cpp Wed Mar 11 03:46:01 2015
@@ -227,6 +227,7 @@ void InitHeaderSearch::AddDefaultCInclud
if (HSOpts.UseStandardSystemIncludes) {
switch (os) {
+ case llvm::Triple::CloudABI:
case llvm::Triple::FreeBSD:
case llvm::Triple::NetBSD:
case llvm::Triple::OpenBSD:
@@ -270,6 +271,14 @@ void InitHeaderSearch::AddDefaultCInclud
case llvm::Triple::Linux:
llvm_unreachable("Include management is handled in the driver.");
+ case llvm::Triple::CloudABI: {
+ // <sysroot>/<triple>/include
+ SmallString<128> P = StringRef(HSOpts.ResourceDir);
+ llvm::sys::path::append(P, "../../..", triple.str(), "include");
+ AddPath(P.str(), System, false);
+ break;
+ }
+
case llvm::Triple::Haiku:
AddPath("/boot/common/include", System, false);
AddPath("/boot/develop/headers/os", System, false);
@@ -340,8 +349,14 @@ void InitHeaderSearch::AddDefaultCInclud
break;
}
- if ( os != llvm::Triple::RTEMS )
+ switch (os) {
+ case llvm::Triple::CloudABI:
+ case llvm::Triple::RTEMS:
+ break;
+ default:
AddPath("/usr/include", ExternCSystem, false);
+ break;
+ }
}
void InitHeaderSearch::
More information about the cfe-commits
mailing list