We start our journey towards goto support and this is a first step on this way.
There are some discussion in #508 and according to the plan we do the following here:
1) a new pass called StructuredCFG that is a stub now but later will be responsible for the regions inlining. The pass works only if emit-cir is not passed in cmd line. Thus, the clang behavior is not changed here from the user's point of view.
2) The pass will be accomplished with goto solver later, so we talk about several passes that are mandatory for the lowering into llvm dialect. There are at least two clients of this pass that will be affected: clang itself and cir-opt, so we need a common point for them: and populateCIRFlatteningPasses and populateCIRToLLVMPasses guarantee that CIR will be in the correct state for all the clients, whatever new passes we will add later.
3) new option -emit-flat-cir to dump CIR after all the flattening and structuring and goto-solving.
We start our journey towards
goto
support and this is a first step on this way.There are some discussion in #508 and according to the plan we do the following here: 1) a new pass called
StructuredCFG
that is a stub now but later will be responsible for the regions inlining. The pass works only ifemit-cir
is not passed in cmd line. Thus, the clang behavior is not changed here from the user's point of view. 2) The pass will be accomplished withgoto
solver later, so we talk about several passes that are mandatory for the lowering intollvm
dialect. There are at least two clients of this pass that will be affected:clang
itself andcir-opt
, so we need a common point for them: andpopulateCIRFlatteningPasses
andpopulateCIRToLLVMPasses
guarantee thatCIR
will be in the correct state for all the clients, whatever new passes we will add later. 3) new option-emit-flat-cir
to dump CIR after all the flattening and structuring and goto-solving.