Skip to content

Commit d442625

Browse files
committed
removing some copies
1 parent f3253ed commit d442625

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

llvm/lib/Frontend/HLSL/RootSignatureMetadata.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,9 @@ static std::optional<StringRef> extractMdStringValue(MDNode *Node,
6060
template <typename T, typename = std::enable_if_t<
6161
std::is_enum_v<T> &&
6262
std::is_same_v<std::underlying_type_t<T>, uint32_t>>>
63-
Expected<T> extractEnumValue(MDNode *Node, unsigned int OpId, StringRef ErrText,
64-
llvm::function_ref<bool(uint32_t)> VerifyFn) {
63+
static Expected<T>
64+
extractEnumValue(MDNode *Node, unsigned int OpId, StringRef ErrText,
65+
llvm::function_ref<bool(uint32_t)> VerifyFn) {
6566
if (std::optional<uint32_t> Val = extractMdIntValue(Node, OpId)) {
6667
if (!VerifyFn(*Val))
6768
return make_error<RootSignatureValidationError<uint32_t>>(ErrText, *Val);
@@ -543,8 +544,9 @@ Error MetadataParser::parseRootSignatureElement(mcdxbc::RootSignatureDesc &RSD,
543544
llvm_unreachable("Unhandled RootSignatureElementKind enum.");
544545
}
545546

546-
Error validateDescriptorTableSamplerMixin(mcdxbc::DescriptorTable Table,
547-
uint32_t Location) {
547+
static Error
548+
validateDescriptorTableSamplerMixin(const mcdxbc::DescriptorTable &Table,
549+
uint32_t Location) {
548550
dxil::ResourceClass CurrRC = dxil::ResourceClass::Sampler;
549551
for (const mcdxbc::DescriptorRange &Range : Table.Ranges) {
550552
if (Range.RangeType == dxil::ResourceClass::Sampler &&
@@ -555,8 +557,9 @@ Error validateDescriptorTableSamplerMixin(mcdxbc::DescriptorTable Table,
555557
return Error::success();
556558
}
557559

558-
Error validateDescriptorTableRegisterOverflow(mcdxbc::DescriptorTable Table,
559-
uint32_t Location) {
560+
static Error
561+
validateDescriptorTableRegisterOverflow(const mcdxbc::DescriptorTable &Table,
562+
uint32_t Location) {
560563
uint64_t Offset = 0;
561564

562565
for (const mcdxbc::DescriptorRange &Range : Table.Ranges) {

0 commit comments

Comments
 (0)