[clang] [libcxx] [llvm] Triple::normalize: Use none as OS for XX-none-ABI (PR #89638)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 30 18:37:21 PDT 2024


================
@@ -1151,6 +1151,13 @@ std::string Triple::normalize(StringRef Str) {
     }
   }
 
+  // For 3-component triples, the middle component is used to set Vendor;
+  // while if it is "none", we'd prefer to set OS.
+  // This is for some baremetal cases, such as "arm-none-elf".
+  if (Found[0] && !Found[1] && !Found[2] && Found[3] &&
+      Components[1].equals("none") && Components[2].empty())
----------------
MaskRay wrote:

Prefer `==` to `equals`.

`equals` is to be deprecated

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


More information about the llvm-commits mailing list