mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-20 10:24:12 +00:00
Use more realistically sized vectors. Reserve capacity if we know in advance
how much will be used. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37515 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -2973,16 +2973,19 @@ private:
|
|||||||
|
|
||||||
// Sort the landing pads in order of their type ids. This is used to fold
|
// Sort the landing pads in order of their type ids. This is used to fold
|
||||||
// duplicate actions.
|
// duplicate actions.
|
||||||
SmallVector<const LandingPadInfo *, 32> LandingPads(PadInfos.size(), NULL);
|
SmallVector<const LandingPadInfo *, 64> LandingPads;
|
||||||
|
|
||||||
|
LandingPads.reserve(PadInfos.size());
|
||||||
for (unsigned i = 0, N = PadInfos.size(); i != N; ++i)
|
for (unsigned i = 0, N = PadInfos.size(); i != N; ++i)
|
||||||
LandingPads[i] = &PadInfos[i];
|
LandingPads.push_back(&PadInfos[i]);
|
||||||
std::sort(LandingPads.begin(), LandingPads.end(), PadLT);
|
std::sort(LandingPads.begin(), LandingPads.end(), PadLT);
|
||||||
|
|
||||||
// Gather first action index for each landing pad site.
|
// Gather first action index for each landing pad site.
|
||||||
SmallVector<unsigned, 32> FirstActions;
|
SmallVector<unsigned, 64> FirstActions;
|
||||||
|
FirstActions.reserve(PadInfos.size());
|
||||||
|
|
||||||
// The actions table.
|
// The actions table.
|
||||||
SmallVector<ActionEntry, 64> Actions;
|
SmallVector<ActionEntry, 32> Actions;
|
||||||
|
|
||||||
// Compute sizes for exception table.
|
// Compute sizes for exception table.
|
||||||
unsigned SizeSites = 0;
|
unsigned SizeSites = 0;
|
||||||
|
Reference in New Issue
Block a user