1
0
Fork 0

DBG: Clarify/fix something in LinearPass.cpp

This commit is contained in:
Nukem 2015-11-26 22:48:23 -05:00
parent 0e64b0d959
commit 8734087227
1 changed files with 7 additions and 0 deletions

View File

@ -334,5 +334,12 @@ BasicBlock* LinearPass::CreateBlockWorker(std::vector<BasicBlock>* Blocks, duint
block.SetFlag(BASIC_BLOCK_FLAG_PAD);
Blocks->push_back(block);
// std::vector::back() incurs a very large performance overhead (30% slower) when
// used in debug mode. This code eliminates it from showing up in the profiler.
#ifdef _DEBUG
return &Blocks->data()[Blocks->size() - 1];
#else
return &Blocks->back();
#endif // _DEBUG
}