From ec25b2ca5eabbe7b750b24c2cc9a03fe19d1f12e Mon Sep 17 00:00:00 2001 From: Jason Hiser <jdhiser@gmail.com> Date: Thu, 31 Jan 2019 10:31:58 -0500 Subject: [PATCH] added irdb-cfg --- src/interfaces/irdb/STARS_IRDB_Function.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/interfaces/irdb/STARS_IRDB_Function.cpp b/src/interfaces/irdb/STARS_IRDB_Function.cpp index 0bc3b3bd..84df4eb8 100644 --- a/src/interfaces/irdb/STARS_IRDB_Function.cpp +++ b/src/interfaces/irdb/STARS_IRDB_Function.cpp @@ -6,7 +6,7 @@ #include <interfaces/irdb/STARSInstruction.h> #include <interfaces/irdb/STARSInterface.h> #include <irdb-core> -#include <libIRDB-cfg.hpp> +#include <irdb-cfg> //#include <bea_deprecated.hpp> #include <list> @@ -91,17 +91,18 @@ void STARS_IRDB_Function_t::BuildFuncIR(SMPFunction *func) // build cfg - libIRDB::ControlFlowGraph_t cfg(the_func); + auto cfgp=ControlFlowGraph_t::factory (the_func); + auto &cfg=*cfgp; // sort the blocks into any order where the entry block is first. - vector<libIRDB::BasicBlock_t*> sorted_blocks; + vector<BasicBlock_t*> sorted_blocks; - sorted_blocks.push_back(cfg.GetEntry()); - for(auto it=cfg.GetBlocks().begin(); - it!=cfg.GetBlocks().end(); ++it) + sorted_blocks.push_back(cfg.getEntry()); + for(auto it=cfg.getBlocks().begin(); + it!=cfg.getBlocks().end(); ++it) { auto block=*it; - if(cfg.GetEntry() == block) // we did the entry block first. + if(cfg.getEntry() == block) // we did the entry block first. continue; sorted_blocks.push_back(block); } @@ -115,7 +116,7 @@ void STARS_IRDB_Function_t::BuildFuncIR(SMPFunction *func) list<SMPInstr*> block_id_map; block_id_map.clear(); auto block=*block_it; - for(auto insn_it=block->GetInstructions().begin(); insn_it!=block->GetInstructions().end(); ++insn_it) + for(auto insn_it=block->getInstructions().begin(); insn_it!=block->getInstructions().end(); ++insn_it) { auto irdb_insn=*insn_it; // cout<<"Building IR for instruction "<<dec<<irdb_insn->getBaseID()<<":"<<irdb_insn->getDisassembly()<<endl; -- GitLab