================ @@ -98,9 +100,47 @@ std::optional<std::string> tryParseProfile(StringRef Profile) { else if (llvm::getAsUnsignedInteger(Parts[2], 0, Minor)) return std::nullopt; - // dxil-unknown-shadermodel-hull + // Determine DXIL version number using the minor version number of Shader + // Model version specified in target profile. Prior to decoupling DXIL version + // numbering from that of Shader Model DXIL version 1.Y corresponds to SM 6.Y. + // E.g., dxilv1.Y-unknown-shadermodelX.Y-hull llvm::Triple T; - T.setArch(Triple::ArchType::dxil); + Triple::SubArchType SubArch = llvm::Triple::NoSubArch; + switch (Minor) { + case 0: + SubArch = llvm::Triple::DXILSubArch_v1_0; + break; + case 1: + SubArch = llvm::Triple::DXILSubArch_v1_1; + break; + case 2: + SubArch = llvm::Triple::DXILSubArch_v1_2; + break; + case 3: + SubArch = llvm::Triple::DXILSubArch_v1_3; + break; + case 4: + SubArch = llvm::Triple::DXILSubArch_v1_4; + break; + case 5: + SubArch = llvm::Triple::DXILSubArch_v1_5; + break; + case 6: + SubArch = llvm::Triple::DXILSubArch_v1_6; + break; + case 7: + SubArch = llvm::Triple::DXILSubArch_v1_7; + break; + case 8: + SubArch = llvm::Triple::DXILSubArch_v1_8; + break; + } + if (SubArch == llvm::Triple::NoSubArch) { + report_fatal_error( ---------------- bharadwajy wrote:
> The frontend should not call `report_fatal_error`. If this error is possible > we should emit a driver diagnostic (see the `D.Diag` calls elsewhere in this > file). > > If this can't happen, we should instead assert. > > If this error can occur we need a test that verifies the error condition. Pushed a change to address the feedback. Thanks! https://github.com/llvm/llvm-project/pull/89823 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits