gen: Keep case/default body IR blocks in lexical order [nfc]

This makes the IR slightly easier to read, in particular the
PGO lit tests.
This commit is contained in:
David Nadlinger 2016-08-02 19:56:59 +01:00
parent 8fbb0ddbfa
commit 9d5bf5a707
3 changed files with 10 additions and 22 deletions

View file

@ -1365,6 +1365,7 @@ public:
PGO.setCurrentStmt(stmt);
const auto body = funcGen.switchTargets.getOrCreate(stmt, "case");
body->moveAfter(irs->scopebb());
if (!irs->scopereturned()) {
llvm::BranchInst::Create(body, irs->scopebb());
@ -1393,6 +1394,7 @@ public:
PGO.setCurrentStmt(stmt);
const auto body = funcGen.switchTargets.getOrCreate(stmt, "default");
body->moveAfter(irs->scopebb());
if (!irs->scopereturned()) {
llvm::BranchInst::Create(body, irs->scopebb());