From 2352730995cd70cb0703e20239f531a4372a7774 Mon Sep 17 00:00:00 2001 From: Andy Ragusa Date: Mon, 29 Apr 2024 14:24:45 -0700 Subject: [PATCH] blah --- libclambcc/ClamBCRemovePointerPHIs.cpp | 8 +++++--- libclambcc/ClamBCWriter.cpp | 4 ++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/libclambcc/ClamBCRemovePointerPHIs.cpp b/libclambcc/ClamBCRemovePointerPHIs.cpp index 830449dd96..9d3a27b2b6 100644 --- a/libclambcc/ClamBCRemovePointerPHIs.cpp +++ b/libclambcc/ClamBCRemovePointerPHIs.cpp @@ -363,7 +363,8 @@ class ClamBCRemovePointerPHIs : public PassInfoMixin 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); } @@ -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); @@ -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); } diff --git a/libclambcc/ClamBCWriter.cpp b/libclambcc/ClamBCWriter.cpp index dae961dcb6..7cba33786a 100644 --- a/libclambcc/ClamBCWriter.cpp +++ b/libclambcc/ClamBCWriter.cpp @@ -855,6 +855,10 @@ class ClamBCWriter : public PassInfoMixin, public InstVisitor