Skip to content

Commit 39e60c0

Browse files
author
joaosaffran
committed
try fix format
1 parent aedb446 commit 39e60c0

File tree

3 files changed

+25
-2
lines changed

3 files changed

+25
-2
lines changed

llvm/lib/Target/DirectX/DXILRootSignature.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,16 @@ static bool parseRootSignatureElement(LLVMContext *Ctx,
5757

5858
RootSignatureElementKind ElementKind =
5959
StringSwitch<RootSignatureElementKind>(ElementText->getString())
60-
.Case("RootFlags", RootSignatureElementKind::RootFlags);
60+
.Case("RootFlags", RootSignatureElementKind::RootFlags)
61+
.Default(RootSignatureElementKind::None);
6162

6263
switch (ElementKind) {
6364

6465
case RootSignatureElementKind::RootFlags:
6566
return parseRootFlags(Ctx, MRS, Element);
67+
case RootSignatureElementKind::None:
68+
return reportError(Ctx,
69+
"Invalid Root Element: " + ElementText->getString());
6670
}
6771

6872
return true;

llvm/lib/Target/DirectX/DXILRootSignature.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
namespace llvm {
2323
namespace dxil {
2424

25-
enum class RootSignatureElementKind { RootFlags = 1 };
25+
enum class RootSignatureElementKind { None = 0, RootFlags = 1 };
2626

2727
struct ModuleRootSignature {
2828
uint32_t Flags = 0;
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
; RUN: not llc %s --filetype=obj -o -
2+
3+
target triple = "dxil-unknown-shadermodel6.0-compute"
4+
5+
; expected-error@-1: Invalid Root Element: NOTRootFlags
6+
7+
8+
define void @main() #0 {
9+
entry:
10+
ret void
11+
}
12+
13+
attributes #0 = { "hlsl.numthreads"="1,1,1" "hlsl.shader"="compute" }
14+
15+
16+
!dx.rootsignatures = !{!2} ; list of function/root signature pairs
17+
!2 = !{ ptr @main, !3 } ; function, root signature
18+
!3 = !{ !4 } ; list of root signature elements
19+
!4 = !{ !"NOTRootFlags", i32 1 } ; 1 = allow_input_assembler_input_layout

0 commit comments

Comments
 (0)