================ @@ -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 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits