Skip to content

Commit

Permalink
llvm: initialize loc of artificial CL_BINOP_MULT insn
Browse files Browse the repository at this point in the history
... to prevent `plotInsn()` from printing garbage into
the resulting `.dot` file.

Fixes: #99
Closes: #100
  • Loading branch information
kdudka committed Jul 18, 2024
1 parent 6654a89 commit 830666c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cl/llvm/clplug.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1614,8 +1614,6 @@ void CLPass::handleAllocaInstruction(AllocaInst *I) {

struct cl_type *allocated = handleType(I->getAllocatedType());

struct cl_insn mult;

if (I->isArrayAllocation()) {
handleOperand(I->getArraySize(), &arraySize);

Expand All @@ -1627,7 +1625,9 @@ void CLPass::handleAllocaInstruction(AllocaInst *I) {
size.type = handleType(I->getArraySize()->getType());
size.data.var = handleVariable(nullptr);

struct cl_insn mult;
mult.code = CL_INSN_BINOP;
mult.loc = cl_loc_known;
mult.data.insn_binop.code = CL_BINOP_MULT;
mult.data.insn_binop.src1 = &typeSize;
mult.data.insn_binop.src2 = &arraySize;
Expand Down

0 comments on commit 830666c

Please sign in to comment.