Skip to content

Commit 1d3312c

Browse files
committed
add guards for DXIL-only build
1 parent 9550de9 commit 1d3312c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tools/clang/lib/Sema/SemaHLSL.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,11 @@
4949
#include "llvm/Support/ErrorHandling.h"
5050
#include "llvm/Support/raw_ostream.h"
5151

52+
#ifdef ENABLE_SPIRV_CODEGEN
5253
// Enables functions like spv::BuiltInToString()
5354
#define SPV_ENABLE_UTILITY_CODE
5455
#include "spirv/unified1/spirv.hpp11"
56+
#endif
5557

5658
#include <algorithm>
5759
#include <array>
@@ -14600,6 +14602,7 @@ void ValidateDispatchGridValues(DiagnosticsEngine &Diags,
1460014602
}
1460114603

1460214604
void hlsl::NormalizeInlineSPIRVAttributes(Sema &S, Decl *D) {
14605+
#ifdef ENABLE_SPIRV_CODEGEN
1460314606
// Collecting the values that can be set across multiple attributes.
1460414607
std::optional<std::pair<spv::StorageClass, SourceRange>> StorageClass;
1460514608
std::optional<std::pair<unsigned, SourceRange>> Location;
@@ -14751,6 +14754,7 @@ void hlsl::NormalizeInlineSPIRVAttributes(Sema &S, Decl *D) {
1475114754

1475214755
D->dropAttrs();
1475314756
D->setAttrs(NewAttrs);
14757+
#endif // ENABLE_SPIRV_CODEGEN
1475414758
}
1475514759

1475614760
void hlsl::HandleDeclAttributeForHLSL(Sema &S, Decl *D, const AttributeList &A,

0 commit comments

Comments
 (0)