[clang] [clang][LoongArch] Add OHOS target (PR #127555)

Lu Weining via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 18 17:46:26 PST 2025


================
@@ -741,16 +741,28 @@ std::unique_ptr<TargetInfo> AllocateTarget(const llvm::Triple &Triple,
   case llvm::Triple::loongarch32:
     switch (os) {
     case llvm::Triple::Linux:
-      return std::make_unique<LinuxTargetInfo<LoongArch32TargetInfo>>(Triple,
-                                                                      Opts);
+      switch (Triple.getEnvironment()) {
+      default:
+        return std::make_unique<LinuxTargetInfo<LoongArch32TargetInfo>>(Triple,
+                                                                        Opts);
+      case llvm::Triple::OpenHOS:
+        return std::make_unique<OHOSTargetInfo<LoongArch32TargetInfo>>(Triple,
+                                                                       Opts);
+      }
----------------
SixWeining wrote:

I think this patch should only focus on LoongArch64. LoongArch32 could be added in future.

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


More information about the cfe-commits mailing list