Skip to content

Commit f768ee7

Browse files
committed
Fix funciton name conflict of addInst
1 parent d19ff64 commit f768ee7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

source/slang/slang-ir.cpp

+5-2
Original file line numberDiff line numberDiff line change
@@ -1743,7 +1743,7 @@ void addHoistableInst(IRBuilder* builder, IRInst* inst)
17431743
}
17441744

17451745
// Add the given inst to the parent of its operand.
1746-
void addInst(IRInst* inst)
1746+
void addDeduplicatedInst(IRInst* inst)
17471747
{
17481748
SLANG_ASSERT(nullptr == inst->parent);
17491749

@@ -2648,7 +2648,7 @@ IRInst* IRBuilder::_findOrEmitHoistableInst(
26482648
// In order to de-duplicate them, Witness-table is marked as Hoistable.
26492649
// But it is not exactly a hoistable type and it can be added simpler.
26502650
if (inst->getOp() == kIROp_WitnessTable)
2651-
addInst(inst);
2651+
addDeduplicatedInst(inst);
26522652
else
26532653
addHoistableInst(this, inst);
26542654
}
@@ -4628,7 +4628,10 @@ void addGlobalValue(IRBuilder* builder, IRInst* value)
46284628
// have dependency to the earlier siblings.
46294629
//
46304630
if (value->parent)
4631+
{
4632+
SLANG_ASSERT(getIROpInfo(value->getOp()).isHoistable());
46314633
return;
4634+
}
46324635

46334636
// Try to find a suitable parent for the
46344637
// global value we are emitting.

0 commit comments

Comments
 (0)