Skip to content
Snippets Groups Projects
Select Git revision
  • caml
  • master default protected
  • caml2
  • input_conditionals
  • cache
5 results

dumpcft.cpp

Blame
  • dumpcft.cpp 6.12 KiB
    /* ----------------------------------------------------------------------------
       Copyright (C) 2020, Université de Lille, Lille, FRANCE
    
       This file is part of WSymb.
    
       WSymb is free software; you can redistribute it and/or
       modify it under the terms of the GNU Lesser General Public License
       as published by the Free Software Foundation ; either version 2 of
       the License, or (at your option) any later version.
    
       WSymb is distributed in the hope that it will be useful, but
       WITHOUT ANY WARRANTY ; without even the implied warranty of
       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
       Lesser General Public License for more details.
    
       You should have received a copy of the GNU Lesser General Public
       License along with this program ; if not, write to the Free Software
       Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
       USA
       ---------------------------------------------------------------------------- */
    
    #include <stdio.h>
    
    #include <otawa/app/Application.h>
    #include <otawa/cfg/features.h>
    #include <otawa/script/Script.h>
    #include <otawa/prog/WorkSpace.h>
    #include <otawa/proc/DynProcessor.h>
    #include <otawa/cfg/Dominance.h>
    #include <otawa/proc/DynFeature.h>
    #include <otawa/cfg/Virtualizer.h>
    
    //includes pour l'affichage du CFG
    #include <otawa/display/CFGOutput.h>
    #include <elm/io/OutFileStream.h>
    #include <otawa/ipet/features.h>
    #include <otawa/flowfact/features.h>
    
    #include "include/CFTree.h"
    
    using namespace otawa; //comme import
    using namespace otawa::cftree;
    
    
    
    
    void fix_virtualized_loopinfo(CFG *entryCFG, Block *loop = nullptr) {
    	for (CFG::BlockIter iter(entryCFG->blocks()); iter(); iter++) {
    		if (ENCLOSING_LOOP_HEADER(*iter) == nullptr)
    			ENCLOSING_LOOP_HEADER(*iter) = loop;
    
    		if ((*iter)->isSynth()) {
    			CFG *callee = (*iter)->toSynth()->callee();
    			fix_virtualized_loopinfo(callee, ENCLOSING_LOOP_HEADER(*iter));
    		}
    	}
    }
    
    static bool is_strictly_in(Block *inner, Block *outer) {
    	ASSERT(LOOP_HEADER(inner));
    	ASSERT(LOOP_HEADER(outer));
    
    	Block *current = inner;
    	while (current != nullptr) {
    		current = ENCLOSING_LOOP_HEADER(current);
    		if (current == outer) return true;
    	}
    	return false;
    }