<div dir="ltr">Hi,<div><br></div><div>I recently started working on control flow analysis of C programs using CFG generated by clang. I noticed that clang generates basic blocks for each condition of a compound condition it encounters in if statment (or in loop conditions). I wanted to have only one basic basic with the entire compound condition instead of having basic blocks for each condition.<br><br>I am outlining my attempts and the direction in which I tried. Please let me know if there is a better way to what I am trying to achieve or I should take an entirely new direction.<br><br>Thanks.<br>Shamiek<br><br>My attempts:<br>I first looked at CFG::BuildOptions() <span style="font-size:12.8px;font-family:sans-serif">(</span><a href="https://clang.llvm.org/doxygen/classclang_1_1CFG_1_1BuildOptions.html" target="_blank" style="font-size:12.8px;font-family:sans-serif">https://clang.llvm.org/doxyge<wbr>n/classclang_1_1CFG_1_1BuildOp<wbr>tions.html</a><span style="font-size:12.8px;font-family:sans-serif">)</span> and did not find anything there.</div><div><br></div><div>Then I went to to <span style="color:rgb(0,0,0);font-family:monospace,fixed;font-size:13px;white-space:pre-wrap;background-color:rgb(251,252,253)">CFGBuilder::VisitIfStmt</span> and found the line that causes creation of basic blocks for individual conditions of the compound condition (<a href="https://clang.llvm.org/doxygen/CFG_8cpp_source.html#l02180">https://clang.llvm.org/doxygen/CFG_8cpp_source.html#l02180</a>). Should I try and change the code here or there might be deeper implications for changing code here. Please suggest.</div></div>