From e9ec9fd0eec249eb0c5386076cc0257232795d3a Mon Sep 17 00:00:00 2001 From: Andy Ragusa Date: Fri, 15 Dec 2023 12:31:17 -0800 Subject: [PATCH] blah --- libclambcc/ClamBCTrace/ClamBCTrace.cpp | 27 +------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/libclambcc/ClamBCTrace/ClamBCTrace.cpp b/libclambcc/ClamBCTrace/ClamBCTrace.cpp index ed0cc39232..2eb04d0b23 100644 --- a/libclambcc/ClamBCTrace/ClamBCTrace.cpp +++ b/libclambcc/ClamBCTrace/ClamBCTrace.cpp @@ -61,17 +61,13 @@ namespace ClamBCTrace { class ClamBCTrace : public PassInfoMixin { public: - //static char ID; - ClamBCTrace() - /* : ModulePass(ID) */ {} + ClamBCTrace() {} virtual llvm::StringRef getPassName() const { return "ClamAV Bytecode Execution Tracing"; } -// virtual bool runOnModule(Module &M); PreservedAnalyses run(Module & m, ModuleAnalysisManager & MAM); }; -//char ClamBCTrace::ID; /* declare i32 @trace_directory(i8*, i32) @@ -88,15 +84,10 @@ declare i32 @trace_ptr(i8*, i32) */ -#if 0 -bool ClamBCTrace::runOnModule(Module &M) -#else PreservedAnalyses ClamBCTrace::run(Module & M, ModuleAnalysisManager & MAM) -#endif { if (!InsertTracing) { return PreservedAnalyses::all(); - //return false; } unsigned MDDbgKind = M.getContext().getMDKindID("dbg"); DenseMap scopeIDs; @@ -203,11 +194,6 @@ PreservedAnalyses ClamBCTrace::run(Module & M, ModuleAnalysisManager & MAM) for (Function::arg_iterator AI = I->arg_begin(), AE = I->arg_end(); AI != AE; ++AI) { if (isa(AI->getType())) { -#if 0 - Value *V = builder.CreateIntCast(AI, Type::getInt32Ty(M.getContext()), false); - Value *ValueName = builder.CreateGlobalStringPtr(AI->getName().data()); - builder.CreateCall2(trace_value, ValueName, V); -#endif } else if (isa(AI->getType())) { Value *V = builder.CreatePointerCast(AI, PointerType::getUnqual(Type::getInt8Ty(M.getContext()))); @@ -224,13 +210,7 @@ PreservedAnalyses ClamBCTrace::run(Module & M, ModuleAnalysisManager & MAM) std::vector args = { Op, ConstantInt::get(Type::getInt32Ty(M.getContext()), Loc->getColumn())}; builder.CreateCall(trace_op, args, "ClamBCTrace_trace_op"); - //Value *ValueName = builder.CreateGlobalStringPtr(II->getName().data()); if (isa(II->getType())) { -#if 0 - builder.SetInsertPoint(&*J, BBIt); - Value *V = builder.CreateIntCast(II, Type::getInt32Ty(M.getContext()), false); - builder.CreateCall2(trace_value, ValueName, V); -#endif } else if (isa(II->getType())) { builder.SetInsertPoint(&*J, BBIt); Value *V = builder.CreatePointerCast(II, @@ -246,11 +226,6 @@ PreservedAnalyses ClamBCTrace::run(Module & M, ModuleAnalysisManager & MAM) return PreservedAnalyses::none(); } -//llvm::ModulePass *createClamBCTrace() -//{ -// return new ClamBCTrace(); -//} - } // namespace