From 69552b15553d70fc870bea96660ce28296569a64 Mon Sep 17 00:00:00 2001 From: "A. R. Shajii" Date: Fri, 28 Jan 2022 15:07:11 -0500 Subject: [PATCH] Remove dummy op --- codon/compiler/compiler.cpp | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/codon/compiler/compiler.cpp b/codon/compiler/compiler.cpp index 9ac9349a..cbb62c07 100644 --- a/codon/compiler/compiler.cpp +++ b/codon/compiler/compiler.cpp @@ -112,22 +112,9 @@ Compiler::parseCode(const std::string &file, const std::string &code, int startL const std::unordered_map &defines) { return parse(/*isCode=*/true, file, code, startLine, testFlags, defines); } -struct DummyOp : public codon::ir::util::Operator { - void handle(codon::ir::CallInstr *x) override { - auto *M = x->getModule(); - auto *func = codon::ir::util::getFunc(x->getCallee()); - if (!func || func->getUnmangledName() != "foo") - return; - auto fn = M->getOrRealizeFunc("bar", {x->front()->getType()}, {}); - seqassert(fn, "did not succeed"); - auto result = codon::ir::util::call(fn, {x->front()}); - x->replaceAll(result); - } -}; + llvm::Error Compiler::compile() { pm->run(module.get()); - auto d = DummyOp(); - module->accept(d); llvisitor->visit(module.get()); return llvm::Error::success(); }