Skip to content

Commit 998f8ca

Browse files
committed
prevent linker error gore when getIntrinsic is used but specialized type isn't defined yet.
1 parent a950dc6 commit 998f8ca

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

clang/lib/CodeGen/CGHLSLRuntime.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ class CGHLSLRuntime {
8080
//===----------------------------------------------------------------------===//
8181
// Start of reserved area for HLSL intrinsic getters.
8282
//===----------------------------------------------------------------------===//
83+
8384
template <unsigned BI> llvm::Intrinsic::ID getIntrinsic();
8485
GENERATE_HLSL_INTRINSIC_TEMPLATE(builtin_hlsl_elementwise_all, all)
8586
GENERATE_HLSL_INTRINSIC_FUNCTION(ThreadId, thread_id)
@@ -140,6 +141,11 @@ class CGHLSLRuntime {
140141
llvm::SmallVector<Buffer> Buffers;
141142
};
142143

144+
// Default implementation
145+
template <unsigned BI> llvm::Intrinsic::ID CGHLSLRuntime::getIntrinsic() {
146+
static_assert(false, "getIntrinsic is only allowed on specialized templates");
147+
}
148+
143149
} // namespace CodeGen
144150
} // namespace clang
145151

0 commit comments

Comments
 (0)