Skip to content

Commit

Permalink
blah
Browse files Browse the repository at this point in the history
  • Loading branch information
ragusaa committed Apr 29, 2024
1 parent 3418d67 commit 2352730
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 5 additions & 3 deletions libclambcc/ClamBCRemovePointerPHIs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,8 @@ class ClamBCRemovePointerPHIs : public PassInfoMixin<ClamBCRemovePointerPHIs>

Type * vt = Type::getVoidTy(pMod->getContext());
Type * pt = Type::getInt8Ty(pMod->getContext())->getPointerTo();
pRet = FunctionType::get(vt, {pt->getPointerTo(), pt}, false);
Type * it = Type::getInt32Ty(pMod->getContext());
pRet = FunctionType::get(vt, {pt->getPointerTo(), it, pt, it}, false);

}

Expand All @@ -379,7 +380,7 @@ return pRet;
pRet->addFnAttr(Attribute::NoInline);

BasicBlock * pEntry = BasicBlock::Create(pMod->getContext(), "entry", pRet, nullptr);
new StoreInst(pRet->getArg(1), pRet->getArg(0), pEntry);
new StoreInst(pRet->getArg(2), pRet->getArg(0), pEntry);
ReturnInst::Create(pMod->getContext(), nullptr, pEntry);

DEBUG_VALUE(pRet);
Expand All @@ -390,7 +391,8 @@ return pRet;

void savePointer(Value * src, Value * dst, Instruction * insPt){
Function * saveFunction = getSaveFunction();
CallInst::Create(getSaveFunctionType(), saveFunction, {dst, src}, "", insPt);
ConstantInt * pci = ConstantInt::get(Type::getInt32Ty(pMod->getContext()), 8);
CallInst::Create(getSaveFunctionType(), saveFunction, {dst, pci, src, pci}, "", insPt);
//CallInst::Create(saveFunction->getType(), saveFunction, {dst, src}, "ClamBCRemovePointerPHIs_", insPt);
}

Expand Down
4 changes: 4 additions & 0 deletions libclambcc/ClamBCWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -855,6 +855,10 @@ class ClamBCWriter : public PassInfoMixin<ClamBCWriter>, public InstVisitor<Clam

pMod = F.getParent();

DEBUG_NONPOINTER("Decide whether or not i need this");
F.addFnAttr(Attribute::OptimizeNone);
F.addFnAttr(Attribute::NoInline);

BBMap.clear();
dbgInfo.clear();
anyDbg = false;
Expand Down

0 comments on commit 2352730

Please sign in to comment.