diff --git a/libclambcc/ClamBCRebuild.cpp b/libclambcc/ClamBCRebuild.cpp index ac3812f6fd..2980909861 100644 --- a/libclambcc/ClamBCRebuild.cpp +++ b/libclambcc/ClamBCRebuild.cpp @@ -305,12 +305,16 @@ class ClamBCRebuild : public PassInfoMixin, public InstVisitor(v)){ - //DEBUG_VALUE(bci->getOperand(0)); - //DEBUG_VALUE(bci->getOperand(0)->getType()); - //DEBUG_VALUE(bci->getSrcTy()); - //DEBUG_VALUE(t); if (bci->getSrcTy() == t){ return bci->getOperand(0); } @@ -323,18 +327,11 @@ class ClamBCRebuild : public PassInfoMixin, public InstVisitorgetType() == Ty) { return V; } diff --git a/libclambcc/ClamBCVerifier.cpp b/libclambcc/ClamBCVerifier.cpp index bd8aa74815..7cb388f0b6 100644 --- a/libclambcc/ClamBCVerifier.cpp +++ b/libclambcc/ClamBCVerifier.cpp @@ -163,13 +163,6 @@ class ClamBCVerifier : public PassInfoMixin, Function *getCalledFunctionFromCallInst(CallInst *pci) { - { - /* - * Issue is in 'memstr'. - * - * The 'needle' is not correct in the earlier versions. - */ - llvm::errs() << "<" << __LINE__ << ">" << "TODO: Clean this up!!!" << "\n"; Value * pCalledOperand = pci->getCalledOperand(); Function * ret = llvm::dyn_cast(pCalledOperand); if (nullptr == ret){ @@ -179,65 +172,9 @@ class ClamBCVerifier : public PassInfoMixin, } if (nullptr == ret){ - assert (0 && "still got work to do "); + ClamBCStop("Verifier unable to get called function from call instruction", pci); } - return ret; - } - - - - DEBUG_VALUE(pci); - Function *ret = pci->getCalledFunction(); - if (nullptr == ret) { - DEBUG_VALUE(pci); - Value *v = pci->getOperand(0); /*This is the called operand.*/ - if (nullptr == v) { - llvm::errs() << "<" << __LINE__ << ">" << *pci << "\n"; - llvm::errs() << "<" << __LINE__ << ">" << *(pci->getOperand(0)) << "\n"; - assert(0 && "How do I handle function pointers?"); - } - - for (size_t i = 0; i< pci->getNumOperands(); i++){ - DEBUG_VALUE(pci->getOperand(i)); - } - llvm::errs() << "\n"; - llvm::errs() << "\n"; - llvm::errs() << "\n"; - - - DEBUG_VALUE(pci->getCalledOperand()); - llvm::errs() << "\n"; - llvm::errs() << "\n"; - llvm::errs() << "\n"; - - - - exit(11); -#if 0 - - - - - while (1){ - - if (BitCastOperator *bco = llvm::dyn_cast(v)) { - ret = llvm::dyn_cast(bco->getOperand(0)); - } else if (GEPOperator * pgpe = llvm::dyn_cast(v)) { - ret = llvm::dyn_cast(pgpe->getPointerOperand()); - } else { - DEBUG_VALUE(v); - DEBUG_NONPOINTER(llvm::isa(v)); - assert (0 && "WTF"); - } - } - - - -#endif - - } - return ret; } diff --git a/libclambcc/ClamBCWriter.cpp b/libclambcc/ClamBCWriter.cpp index 70341af437..0a1f4d20d9 100644 --- a/libclambcc/ClamBCWriter.cpp +++ b/libclambcc/ClamBCWriter.cpp @@ -1337,7 +1337,6 @@ class ClamBCWriter : public PassInfoMixin, public InstVisitor