Skip to content
Snippets Groups Projects
Commit c48564ed authored by Lipari Giuseppe's avatar Lipari Giuseppe
Browse files

Code smell

parent 79e739cf
No related branches found
No related tags found
No related merge requests found
......@@ -15,9 +15,7 @@
namespace otawa {
namespace cache_block_id {
// Declaration du plugin
class Plugin : public ProcessorPlugin {
public:
Plugin() : ProcessorPlugin("otawa::cache_block_id", Version(1, 0, 0), OTAWA_PROC_VERSION) {}
......@@ -35,32 +33,27 @@ namespace otawa {
.require(cache::COLLECTED_LBLOCKS_FEATURE)
.require(hard::CACHE_CONFIGURATION_FEATURE)
.provide(CACHE_BLOCK_ID_FEATURE);
// definition feature
p::feature CACHE_BLOCK_ID_FEATURE("otawa::cache_block_id::CACHE_BLOCK_ID_FEATURE", new Maker<Cache_block_idProcessor>());
Cache_block_idProcessor::Cache_block_idProcessor(p::declare &r) : Processor(r) {}
void Cache_block_idProcessor::configure(const PropList &props) {
void Cache_block_idProcessor::configure(const PropList &props)
{
Processor::configure(props);
}
const otawa::hard::Cache* get_cache(WorkSpace *ws) {
const otawa::hard::Cache* get_cache(WorkSpace *ws)
{
const CFGCollection *coll = INVOLVED_CFGS(ws);
for(CFGCollection::Iter cfg_iter(*coll); cfg_iter(); cfg_iter++) {
for(CFG::BlockIter block_iter = cfg_iter->blocks(); block_iter(); block_iter++) {
if(block_iter->isBasic()) {
AllocArray<LBlock*> *lblock_array =
BB_LBLOCKS(block_iter->toBasic());
AllocArray<LBlock*> *lblock_array = BB_LBLOCKS(block_iter->toBasic());
for(int i = 0; i < lblock_array->count(); i++) {
LBlock *lb = (*lblock_array)[i];
return lb->lblockset()->cache();
return lb->lblockset()->cache(); // CODE SMELL
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment