This commit is contained in:
@@ -2045,8 +2045,15 @@ Block& Builder::makeNewBlock()
|
||||
|
||||
Builder::LoopBlocks& Builder::makeNewLoop()
|
||||
{
|
||||
// Older MSVC versions don't allow inlining of blocks below.
|
||||
LoopBlocks blocks = {makeNewBlock(), makeNewBlock(), makeNewBlock(), makeNewBlock()};
|
||||
// This verbosity is needed to simultaneously get the same behavior
|
||||
// everywhere (id's in the same order), have a syntax that works
|
||||
// across lots of versions of C++, have no warnings from pedantic
|
||||
// compilation modes, and leave the rest of the code alone.
|
||||
Block& head = makeNewBlock();
|
||||
Block& body = makeNewBlock();
|
||||
Block& merge = makeNewBlock();
|
||||
Block& continue_target = makeNewBlock();
|
||||
LoopBlocks blocks(head, body, merge, continue_target);
|
||||
loops.push(blocks);
|
||||
return loops.top();
|
||||
}
|
||||
|
||||
@@ -397,7 +397,12 @@ public:
|
||||
void endSwitch(std::vector<Block*>& segmentBB);
|
||||
|
||||
struct LoopBlocks {
|
||||
LoopBlocks(Block& head, Block& body, Block& merge, Block& continue_target) :
|
||||
head(head), body(body), merge(merge), continue_target(continue_target) { }
|
||||
Block &head, &body, &merge, &continue_target;
|
||||
private:
|
||||
LoopBlocks();
|
||||
LoopBlocks& operator=(const LoopBlocks&);
|
||||
};
|
||||
|
||||
// Start a new loop and prepare the builder to generate code for it. Until
|
||||
|
||||
Reference in New Issue
Block a user