enable structural analysis and use if, else and endif in the
generated asm.
Signed-off-by: Yongjia Zhang <yongjia.zhang@intel.com>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
#include "llvm/llvm_to_gen.hpp"
#include "sys/cvar.hpp"
#include "sys/platform.hpp"
+#include "ir/unit.hpp"
+#include "ir/structural_analysis.hpp"
#include <clang/CodeGen/CodeGenAction.h>
#endif
passes.run(mod);
+ const ir::Unit::FunctionSet& fs = unit.getFunctionSet();
+ ir::Unit::FunctionSet::const_iterator iter = fs.begin();
+ while(iter != fs.end())
+ {
+ analysis::ControlTree *ct = new analysis::ControlTree(iter->second);
+ ct->analyze();
+ delete ct;
+ iter++;
+ }
+
return true;
}
} /* namespace gbe */