diff options
-rw-r--r-- | llvm/include/llvm/Frontend/HLSL/HLSLResource.h | 2 | ||||
-rw-r--r-- | llvm/lib/Frontend/HLSL/HLSLResource.cpp | 9 | ||||
-rw-r--r-- | llvm/lib/Target/DirectX/DXILResource.cpp | 5 |
3 files changed, 8 insertions, 8 deletions
diff --git a/llvm/include/llvm/Frontend/HLSL/HLSLResource.h b/llvm/include/llvm/Frontend/HLSL/HLSLResource.h index ba08ee5..997ddcc 100644 --- a/llvm/include/llvm/Frontend/HLSL/HLSLResource.h +++ b/llvm/include/llvm/Frontend/HLSL/HLSLResource.h @@ -67,7 +67,7 @@ public: GlobalVariable *getGlobalVariable(); StringRef getSourceType(); - uint32_t getResourceKind(); + ResourceKind getResourceKind(); uint32_t getResourceIndex(); uint32_t getSpace(); MDNode *getMetadata() { return Entry; } diff --git a/llvm/lib/Frontend/HLSL/HLSLResource.cpp b/llvm/lib/Frontend/HLSL/HLSLResource.cpp index 59f730d..a3a7d0b 100644 --- a/llvm/lib/Frontend/HLSL/HLSLResource.cpp +++ b/llvm/lib/Frontend/HLSL/HLSLResource.cpp @@ -27,10 +27,11 @@ StringRef FrontendResource::getSourceType() { return cast<MDString>(Entry->getOperand(1))->getString(); } -uint32_t FrontendResource::FrontendResource::getResourceKind() { - return cast<ConstantInt>( - cast<ConstantAsMetadata>(Entry->getOperand(2))->getValue()) - ->getLimitedValue(); +ResourceKind FrontendResource::getResourceKind() { + return static_cast<ResourceKind>( + cast<ConstantInt>( + cast<ConstantAsMetadata>(Entry->getOperand(2))->getValue()) + ->getLimitedValue()); } uint32_t FrontendResource::getResourceIndex() { return cast<ConstantInt>( diff --git a/llvm/lib/Target/DirectX/DXILResource.cpp b/llvm/lib/Target/DirectX/DXILResource.cpp index 0390a3f..041b8fa 100644 --- a/llvm/lib/Target/DirectX/DXILResource.cpp +++ b/llvm/lib/Target/DirectX/DXILResource.cpp @@ -233,9 +233,8 @@ void ResourceBase::print(raw_ostream &OS, StringRef IDPrefix, } UAVResource::UAVResource(uint32_t I, FrontendResource R) - : ResourceBase(I, R), - Shape(static_cast<ResourceBase::Kinds>(R.getResourceKind())), - GloballyCoherent(false), HasCounter(false), IsROV(false), ExtProps() { + : ResourceBase(I, R), Shape(R.getResourceKind()), GloballyCoherent(false), + HasCounter(false), IsROV(false), ExtProps() { parseSourceType(R.getSourceType()); } |