[PATCH] D11279: Initial patch for PS4 toolchain

Katya Romanova via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 2 16:39:23 PDT 2015


kromanova added inline comments.

================
Comment at: lib/Frontend/InitHeaderSearch.cpp:325-344
@@ +324,22 @@
+  case llvm::Triple::PS4: {
+    // <isysroot> gets prepended later in AddPath().
+    std::string BaseSDKPath = "";
+    if (!HasSysroot) {
+      const char *envValue = getenv("SCE_PS4_SDK_DIR");
+      if (envValue)
+        BaseSDKPath = envValue;
+      else {
+        // HSOpts.ResourceDir variable contains the location of Clang's
+        // resource files.
+        // Assuming that Clang is configured for PS4 without
+        // --with-clang-resource-dir option, the location of Clang's resource
+        // files is <SDK_DIR>/host_tools/lib/clang
+        SmallString<128> P = StringRef(HSOpts.ResourceDir);
+        llvm::sys::path::append(P, "../../..");
+        BaseSDKPath = P.str();
+      }
+    }
+    AddPath(BaseSDKPath + "/target/include", System, false);
+    if (triple.isPS4CPU())
+      AddPath(BaseSDKPath + "/target/include_common", System, false);
+  }
----------------
echristo wrote:
> kromanova wrote:
> > echristo wrote:
> > > This all seems odd, what's going on here?
> > Our SDK layout structure is different from other platforms. Some of the PS4 specific headers (e.g. graphic headers, etc) are placed into target/include_common directory and we want to have them in the search path.
> You also check for ps4cpu in here?
I don't think this is needed since we are under Triple::PS4 switch now. Sorry, this is an oversight on our part, caused by refactoring of old code that didn't has PS4 switch case before. We will remove 'if' part.


http://reviews.llvm.org/D11279





More information about the cfe-commits mailing list