Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions llvm/lib/Target/DirectX/DXILRootSignature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,9 @@ PreservedAnalyses RootSignatureAnalysisPrinter::run(Module &M,
OS << "Root Signature Definitions"
<< "\n";
uint8_t Space = 0;
for (const auto &P : RSDMap) {
const auto &[Function, RSD] = P;
OS << "Definition for '" << Function->getName() << "':\n";
for (const auto &F : M) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better style to spell out the type if it doesn't show up elsewhere (such as in a cast).

Suggested change
for (const auto &F : M) {
for (const Function &F : M) {

const auto RSD = RSDMap.at(&F);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will crash if there are functions in the module without root signatures (ie, if the root signature metadata isn't present, or if there are helper functions without their own root signatures)

OS << "Definition for '" << F.getName() << "':\n";

// start root signature header
Space++;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ attributes #0 = { "hlsl.numthreads"="1,1,1" "hlsl.shader"="compute" }
!6 = !{ !7 } ; list of root signature elements
!7 = !{ !"RootFlags", i32 2 } ; 1 = allow_input_assembler_input_layout


; CHECK-LABEL: Definition for 'main':
; CHECK-NEXT: Flags: 0x000001
; CHECK-NEXT: Version: 2
Expand Down