diff options
| author | Duncan Sands <baldrick@free.fr> | 2007-06-08 08:59:11 +0000 |
|---|---|---|
| committer | Duncan Sands <baldrick@free.fr> | 2007-06-08 08:59:11 +0000 |
| commit | dc8fc1550e910d229b17ba3ce2831ded292e032c (patch) | |
| tree | 2e7efe37b09e158b303c1cb87fc8feb214ad9076 /llvm/lib/CodeGen/DwarfWriter.cpp | |
| parent | 2e5efc30c27c4fbdf72a4a7a9c9ae1630fcc625d (diff) | |
| download | bcm5719-llvm-dc8fc1550e910d229b17ba3ce2831ded292e032c.tar.gz bcm5719-llvm-dc8fc1550e910d229b17ba3ce2831ded292e032c.zip | |
Use more realistically sized vectors. Reserve capacity if we know in advance
how much will be used.
llvm-svn: 37515
Diffstat (limited to 'llvm/lib/CodeGen/DwarfWriter.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/DwarfWriter.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/DwarfWriter.cpp b/llvm/lib/CodeGen/DwarfWriter.cpp index 850f25b2bf8..6bfbacd7136 100644 --- a/llvm/lib/CodeGen/DwarfWriter.cpp +++ b/llvm/lib/CodeGen/DwarfWriter.cpp @@ -2973,16 +2973,19 @@ private: // Sort the landing pads in order of their type ids. This is used to fold // 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) - LandingPads[i] = &PadInfos[i]; + LandingPads.push_back(&PadInfos[i]); std::sort(LandingPads.begin(), LandingPads.end(), PadLT); // Gather first action index for each landing pad site. - SmallVector<unsigned, 32> FirstActions; + SmallVector<unsigned, 64> FirstActions; + FirstActions.reserve(PadInfos.size()); // The actions table. - SmallVector<ActionEntry, 64> Actions; + SmallVector<ActionEntry, 32> Actions; // Compute sizes for exception table. unsigned SizeSites = 0; |

