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 1515#define LLVM_FRONTEND_HLSL_HLSLROOTSIGNATURE_H
1616
1717#include " llvm/Support/DXILABI.h"
18+ #include " llvm/Support/raw_ostream.h"
1819#include < variant>
1920
2021namespace llvm {
@@ -86,6 +87,8 @@ struct DescriptorTableClause {
8687 break ;
8788 }
8889 }
90+
91+ void dump (raw_ostream &OS) const ;
8992};
9093
9194// Models RootElement : DescriptorTable | DescriptorTableClause
Original file line number Diff line number Diff line change 11add_llvm_component_library(LLVMFrontendHLSL
22 CBuffer.cpp
33 HLSLResource.cpp
4+ HLSLRootSignature.cpp
45
56 ADDITIONAL_HEADER_DIRS
67 ${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 11set (LLVM_LINK_COMPONENTS
22 Analysis
33 Core
4+ FrontendHLSL
45 FrontendOpenACC
56 FrontendOpenMP
67 Passes
@@ -10,6 +11,7 @@ set(LLVM_LINK_COMPONENTS
1011 )
1112
1213add_llvm_unittest(LLVMFrontendTests
14+ HLSLRootSignatureDumpTest.cpp
1315 OpenACCTest.cpp
1416 OpenMPContextTest.cpp
1517 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