File tree Expand file tree Collapse file tree 5 files changed +61
-0
lines changed
include/llvm/Frontend/HLSL Expand file tree Collapse file tree 5 files changed +61
-0
lines changed Original file line number Diff line number Diff line change 15
15
#define LLVM_FRONTEND_HLSL_HLSLROOTSIGNATURE_H
16
16
17
17
#include " llvm/Support/DXILABI.h"
18
+ #include " llvm/Support/raw_ostream.h"
18
19
#include < variant>
19
20
20
21
namespace llvm {
@@ -86,6 +87,8 @@ struct DescriptorTableClause {
86
87
break ;
87
88
}
88
89
}
90
+
91
+ void dump (raw_ostream &OS) const ;
89
92
};
90
93
91
94
// Models RootElement : DescriptorTable | DescriptorTableClause
Original file line number Diff line number Diff line change 1
1
add_llvm_component_library (LLVMFrontendHLSL
2
2
CBuffer.cpp
3
3
HLSLResource.cpp
4
+ HLSLRootSignature.cpp
4
5
5
6
ADDITIONAL_HEADER_DIRS
6
7
${LLVM_MAIN_INCLUDE_DIR} /llvm/Frontend
Original file line number Diff line number Diff line change
1
+ // ===- HLSLRootSignature.cpp - HLSL Root Signature helper objects ---------===//
2
+ //
3
+ // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
+ // See https://llvm.org/LICENSE.txt for license information.
5
+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
+ //
7
+ // ===----------------------------------------------------------------------===//
8
+ // /
9
+ // / \file This file contains helpers for working with HLSL Root Signatures.
10
+ // /
11
+ // ===----------------------------------------------------------------------===//
12
+
13
+ #include " llvm/Frontend/HLSL/HLSLRootSignature.h"
14
+
15
+ namespace llvm {
16
+ namespace hlsl {
17
+ namespace rootsig {
18
+
19
+ void DescriptorTableClause::dump (raw_ostream &OS) const {
20
+ OS << " Clause!" ;
21
+ }
22
+
23
+ } // namespace rootsig
24
+ } // namespace hlsl
25
+ } // namespace llvm
Original file line number Diff line number Diff line change 1
1
set (LLVM_LINK_COMPONENTS
2
2
Analysis
3
3
Core
4
+ FrontendHLSL
4
5
FrontendOpenACC
5
6
FrontendOpenMP
6
7
Passes
@@ -10,6 +11,7 @@ set(LLVM_LINK_COMPONENTS
10
11
)
11
12
12
13
add_llvm_unittest (LLVMFrontendTests
14
+ HLSLRootSignatureDumpTest.cpp
13
15
OpenACCTest.cpp
14
16
OpenMPContextTest.cpp
15
17
OpenMPIRBuilderTest.cpp
Original file line number Diff line number Diff line change
1
+ // ===-------- HLSLRootSignatureDumpTest.cpp - RootSignature dump tests ----===//
2
+ //
3
+ // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
+ // See https://llvm.org/LICENSE.txt for license information.
5
+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
+ //
7
+ // ===----------------------------------------------------------------------===//
8
+
9
+ #include " llvm/Frontend/HLSL/HLSLRootSignature.h"
10
+ #include " gtest/gtest.h"
11
+
12
+ using namespace llvm ::hlsl::rootsig;
13
+
14
+ namespace {
15
+
16
+ TEST (HLSLRootSignatureTest, DescriptorTablesDump) {
17
+ // Default clause
18
+ DescriptorTableClause Clause;
19
+ Clause.Type = ClauseType::CBuffer;
20
+ Clause.Reg = { RegisterType::BReg, 0 };
21
+
22
+ std::string Out;
23
+ llvm::raw_string_ostream OS (Out);
24
+ Clause.dump (OS);
25
+ OS.flush ();
26
+
27
+ EXPECT_EQ (Out, " Clause!" );
28
+ }
29
+
30
+ } // namespace
You can’t perform that action at this time.
0 commit comments