From d245c72f2a92a74ccda83f41758c1948ae5132d3 Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 24 Aug 2022 10:56:53 -0700 Subject: Compiler time evaluation of all int and bool operators. (#2376) * Compiler time evaluation of all int and bool operators. * Fix linux compile error. * Fix. Co-authored-by: Yong He --- source/slang/slang-emit-c-like.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'source/slang/slang-emit-c-like.cpp') diff --git a/source/slang/slang-emit-c-like.cpp b/source/slang/slang-emit-c-like.cpp index e98c8c6f3..7a7951ba1 100644 --- a/source/slang/slang-emit-c-like.cpp +++ b/source/slang/slang-emit-c-like.cpp @@ -3381,6 +3381,17 @@ void CLikeSourceEmitter::ensureInstOperandsRec(ComputeEmitActionsContext* ctx, I case kIROp_NativePtrType: requiredLevel = EmitAction::ForwardDeclaration; break; + case kIROp_lookup_interface_method: + case kIROp_FieldExtract: + case kIROp_FieldAddress: + { + auto opType = inst->getOperand(0)->getDataType(); + if (auto nativePtrType = as(opType)) + { + ensureInstOperand(ctx, nativePtrType->getValueType(), requiredLevel); + } + break; + } default: break; } -- cgit v1.2.3