Skip to content

Commit 93f9f2a

Browse files
committed
Assert that return value of HitObject default ctor is unused ('this' return is a Clang codegen artifact)
1 parent 601a8af commit 93f9f2a

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

lib/HLSL/HLOperationLower.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6196,10 +6196,9 @@ Value *TranslateHitObjectMake(CallInst *CI, IntrinsicOp IOP, OP::OpCode Opcode,
61966196
Value *HitObject = TrivialDxilOperation(
61976197
Opcode, {nullptr}, Type::getVoidTy(CI->getContext()), CI, HlslOP);
61986198
Builder.CreateStore(HitObject, HitObjectPtr);
6199-
// Passthru the 'this' pointer when this calls 'HitObject_MakeNop' as the
6200-
// default constructor
6201-
if (!CI->getType()->isVoidTy())
6202-
return HitObjectPtr;
6199+
DXASSERT(
6200+
CI->use_empty(),
6201+
"Default ctor return type is a Clang artifact. Value must not be used");
62036202
return nullptr;
62046203
}
62056204

0 commit comments

Comments
 (0)