Skip to content

Commit

Permalink
Fix deprecation of getElementType()
Browse files Browse the repository at this point in the history
As stipulated in migration instructions
(https://llvm.org/docs/OpaquePointers.html)
  • Loading branch information
PatriceBlin committed Jul 24, 2023
1 parent 0735284 commit a67b09d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions bogus/BogusControlFlow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -627,8 +627,8 @@ bool BogusControlFlow::doF(Module &M) {
for (std::vector<Instruction *>::iterator i = toEdit.begin();
i != toEdit.end(); ++i) {
// if y < 10 || x*(x+1) % 2 == 0
opX = new LoadInst(x->getType()->getPointerElementType(), (Value *)x, "", (*i));
opY = new LoadInst(y->getType()->getPointerElementType(), (Value *)y, "", (*i));
opX = new LoadInst(x->getValueType(), (Value *)x, "", (*i));
opY = new LoadInst(y->getValueType(), (Value *)y, "", (*i));

op = BinaryOperator::Create(
Instruction::Sub, (Value *)opX,
Expand Down
2 changes: 1 addition & 1 deletion flattening/Flattening.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ bool Flattening::flatten(Function *f) {
loopEntry = BasicBlock::Create(f->getContext(), "loopEntry", f, insert);
loopEnd = BasicBlock::Create(f->getContext(), "loopEnd", f, insert);

load = new LoadInst(switchVar->getType()->getPointerElementType(), switchVar,
load = new LoadInst(switchVar->getAllocatedType(), switchVar,
"switchVar", loopEntry);

// Move first BB on top
Expand Down

0 comments on commit a67b09d

Please sign in to comment.