[llvm-branch-commits] [llvm] [DirectX] Add resource handling to the DXIL pretty printer (PR #104448)

Justin Bogner via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Aug 26 16:16:40 PDT 2024


https://github.com/bogner updated https://github.com/llvm/llvm-project/pull/104448

>From 4b54fa3f1d499e9bcf5bff09105584841b6c62a8 Mon Sep 17 00:00:00 2001
From: Justin Bogner <mail at justinbogner.com>
Date: Mon, 26 Aug 2024 16:16:31 -0700
Subject: [PATCH] drop constexpr - llvm_unreachable isn't always constexpr

Created using spr 1.3.5-bogner
---
 llvm/lib/Target/DirectX/DXILPrettyPrinter.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/llvm/lib/Target/DirectX/DXILPrettyPrinter.cpp b/llvm/lib/Target/DirectX/DXILPrettyPrinter.cpp
index 6c80c731f13e44..f282eff6c002b2 100644
--- a/llvm/lib/Target/DirectX/DXILPrettyPrinter.cpp
+++ b/llvm/lib/Target/DirectX/DXILPrettyPrinter.cpp
@@ -20,7 +20,7 @@
 
 using namespace llvm;
 
-static constexpr StringRef getRCName(dxil::ResourceClass RC) {
+static StringRef getRCName(dxil::ResourceClass RC) {
   switch (RC) {
   case dxil::ResourceClass::SRV:
     return "SRV";
@@ -34,7 +34,7 @@ static constexpr StringRef getRCName(dxil::ResourceClass RC) {
   llvm_unreachable("covered switch");
 }
 
-static constexpr StringRef getRCPrefix(dxil::ResourceClass RC) {
+static StringRef getRCPrefix(dxil::ResourceClass RC) {
   switch (RC) {
   case dxil::ResourceClass::SRV:
     return "t";
@@ -47,7 +47,7 @@ static constexpr StringRef getRCPrefix(dxil::ResourceClass RC) {
   }
 }
 
-static constexpr StringRef getFormatName(const dxil::ResourceInfo &RI) {
+static StringRef getFormatName(const dxil::ResourceInfo &RI) {
   if (RI.isTyped()) {
     switch (RI.getTyped().ElementTy) {
     case dxil::ElementType::I1:
@@ -97,7 +97,7 @@ static constexpr StringRef getFormatName(const dxil::ResourceInfo &RI) {
   return "byte";
 }
 
-static constexpr StringRef getTextureDimName(dxil::ResourceKind RK) {
+static StringRef getTextureDimName(dxil::ResourceKind RK) {
   switch (RK) {
   case dxil::ResourceKind::Texture1D:
     return "1d";



More information about the llvm-branch-commits mailing list