Go to the documentation of this file.00001
00016 #include "ManagerInterReachConsts.hpp"
00017 #include <Utils/Util.hpp>
00018
00019
00020 namespace OA {
00021 namespace ReachConsts {
00022
00023 static bool debug = false;
00024
00025 ManagerInterReachConsts::ManagerInterReachConsts(
00026 OA_ptr<ReachConstsIRInterface> _ir) : mIR(_ir)
00027 {
00028 OA_DEBUG_CTRL_MACRO("DEBUG_ManagerInterReachConsts:ALL", debug);
00029 }
00030
00034 OA_ptr<InterReachConsts>
00035 ManagerInterReachConsts::performAnalysis(
00036 OA_ptr<CallGraph::CallGraphInterface> callGraph,
00037
00038 OA_ptr<Alias::InterAliasInterface> interAlias,
00039 OA_ptr<SideEffect::InterSideEffectInterface> interSE,
00040 OA_ptr<CFG::EachCFGInterface> eachCFG,
00041 DataFlow::DFPImplement algorithm)
00042 {
00043 OA_ptr<InterReachConsts> retval;
00044 retval = new InterReachConsts;
00045
00046
00047
00048 OA_ptr<CallGraph::NodesIteratorInterface> procIter
00049 = callGraph->getCallGraphNodesIterator();
00050 for ( ; procIter->isValid(); ++(*procIter)) {
00051
00052 OA_ptr<CallGraph::NodeInterface> Node = procIter->currentCallGraphNode();
00053 ProcHandle proc = Node->getProc();
00054
00055
00056 if (proc==ProcHandle(0)) {
00057 continue;
00058 }
00059
00060
00061
00062
00063
00064 OA_ptr<Alias::Interface> alias;
00065 alias = interAlias->getAliasResults(proc);
00066
00067
00068 OA_ptr<CFG::CFGInterface> cfg;
00069 cfg = eachCFG->getCFGResults(proc);
00070
00071
00072 OA_ptr<ManagerReachConstsStandard> rcman;
00073 rcman = new ReachConsts::ManagerReachConstsStandard(mIR);
00074
00075 OA_ptr<ReachConsts::ReachConstsStandard> rcs
00076 = rcman->performAnalysis(proc, cfg,
00077 alias,interSE,algorithm);
00078
00079
00080 retval->mapProcToReachConsts(proc,rcs);
00081
00082 }
00083
00084 return retval;
00085 }
00086
00087
00088 }
00089 }