[clang] [clang][AIX] Fix -print-runtime-dir fallback on AIX (PR #141439)

Jake Egan via cfe-commits cfe-commits at lists.llvm.org
Sun Jun 1 18:45:45 PDT 2025


================
@@ -933,11 +933,16 @@ ToolChain::getTargetSubDirPath(StringRef BaseDir) const {
   if (auto Path = getPathForTriple(T))
     return *Path;
 
-  if (T.isOSAIX() && T.getEnvironment() == Triple::UnknownEnvironment) {
-    // Strip unknown environment from the triple.
-    const llvm::Triple AIXTriple(
-        llvm::Triple(T.getArchName(), T.getVendorName(),
-                     llvm::Triple::getOSTypeName(T.getOS())));
+  if (T.isOSAIX()) {
+    llvm::Triple AIXTriple;
+    if (T.getEnvironment() == Triple::UnknownEnvironment) {
+      // Strip unknown environment from the triple.
----------------
jakeegan wrote:

The reason I moved "Strip the OS version from the triple" a level higher is so it doesn't have to be repeated twice. But I'm fine with either way. I updated the PR as you said

https://github.com/llvm/llvm-project/pull/141439


More information about the cfe-commits mailing list