[flang] Add Solaris/x86 support to Optimizer/CodeGen/Target.cpp
authorRainer Orth <ro@gcc.gnu.org>
Wed, 17 Aug 2022 09:54:38 +0000 (11:54 +0200)
committerRainer Orth <ro@gcc.gnu.org>
Wed, 17 Aug 2022 09:54:38 +0000 (11:54 +0200)
When testing LLVM 15.0.0 rc1 on Solaris, I found that 50+ flang tests
`FAIL`ed with

  error:
/vol/llvm/src/llvm-project/local/flang/lib/Optimizer/CodeGen/Target.cpp:310:
not yet implemented: target not implemented

This patch fixes that for Solaris/x86, where the fix is trivial (just
handling it like the other x86 OSes).

Tested on `amd64-pc-solaris2.11`; only a single failure remains now.

Differential Revision: https://reviews.llvm.org/D131054

flang/lib/Optimizer/CodeGen/Target.cpp

index 9ec2f04..5295420 100644 (file)
@@ -268,6 +268,7 @@ fir::CodeGenSpecifics::get(mlir::MLIRContext *ctx, llvm::Triple &&trp,
     case llvm::Triple::OSType::Linux:
     case llvm::Triple::OSType::Darwin:
     case llvm::Triple::OSType::MacOSX:
+    case llvm::Triple::OSType::Solaris:
     case llvm::Triple::OSType::Win32:
       return std::make_unique<TargetI386>(ctx, std::move(trp),
                                           std::move(kindMap));
@@ -280,6 +281,7 @@ fir::CodeGenSpecifics::get(mlir::MLIRContext *ctx, llvm::Triple &&trp,
     case llvm::Triple::OSType::Linux:
     case llvm::Triple::OSType::Darwin:
     case llvm::Triple::OSType::MacOSX:
+    case llvm::Triple::OSType::Solaris:
     case llvm::Triple::OSType::Win32:
       return std::make_unique<TargetX86_64>(ctx, std::move(trp),
                                             std::move(kindMap));