From 2408ff73942bfd8d96bcd623e2056e169240f071 Mon Sep 17 00:00:00 2001 From: Andy Ragusa Date: Fri, 15 Dec 2023 11:45:57 -0800 Subject: [PATCH] blah --- .../ClamBCLogicalCompilerHelper.cpp | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/libclambcc/ClamBCLogicalCompilerHelper/ClamBCLogicalCompilerHelper.cpp b/libclambcc/ClamBCLogicalCompilerHelper/ClamBCLogicalCompilerHelper.cpp index 22b26c9232..77184ed9ba 100644 --- a/libclambcc/ClamBCLogicalCompilerHelper/ClamBCLogicalCompilerHelper.cpp +++ b/libclambcc/ClamBCLogicalCompilerHelper/ClamBCLogicalCompilerHelper.cpp @@ -101,11 +101,12 @@ namespace ClamBCLogicalCompilerHelper virtual void processPHI(PHINode * phi, Function * pCalledFunction, std::vector & args); virtual void fixupSetVirusNameCalls(); + + size_t getBranchIdx(llvm::BranchInst * pBranch, llvm::BasicBlock * pBB); }; - /*TODO: make protected*/ - size_t getBranchIdx(llvm::BranchInst * pBranch, llvm::BasicBlock * pBB){ + size_t ClamBCLogicalCompilerHelper::getBranchIdx(llvm::BranchInst * pBranch, llvm::BasicBlock * pBB){ for ( size_t ret = 0; ret < pBranch->getNumSuccessors(); ret++){ if (pBranch->getSuccessor(ret) == pBB){ return ret; @@ -135,7 +136,8 @@ namespace ClamBCLogicalCompilerHelper a dyn_cast*/ size_t branchIdx = getBranchIdx(pBranch, phi->getParent()); - BasicBlock * pNew = BasicBlock::Create(pMod->getContext(), "ClamBCLogicalCompilerHelper_call_SetVirusName_", phi->getParent()->getParent(), phi->getParent()); + BasicBlock * pNew = BasicBlock::Create(pMod->getContext(), + "ClamBCLogicalCompilerHelper_call_SetVirusName_", phi->getParent()->getParent(), phi->getParent()); pBranch->setSuccessor(branchIdx, pNew); args[0] = pVal; @@ -162,15 +164,6 @@ namespace ClamBCLogicalCompilerHelper if (PHINode * phi = llvm::dyn_cast(operand)){ calls.push_back(pci); -#if 0 - std::vector args; - populateArgs(pci, args); - processPHI(phi, svn, args); - erase.push_back(pci); - /*This leaves a block with only a branch instruction (essentially empty). - * I don't think that is an issue, but consider removing it.*/ - erase.push_back(phi); -#endif } } }