mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-04 10:52:30 +00:00
Change std::vector to SmallVector<4> and remove some unused methods.
This is more consistent with other vectors in this code. In addition, I ran some tests compiling a large program and >96% of fragments have 4 or less fixups, so SmallVector<4> is a good optimization. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169433 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
5807fd41a7
commit
5c10f509f4
@ -107,11 +107,11 @@ class MCDataFragment : public MCFragment {
|
||||
SmallString<32> Contents;
|
||||
|
||||
/// Fixups - The list of fixups in this fragment.
|
||||
std::vector<MCFixup> Fixups;
|
||||
SmallVector<MCFixup, 4> Fixups;
|
||||
|
||||
public:
|
||||
typedef std::vector<MCFixup>::const_iterator const_fixup_iterator;
|
||||
typedef std::vector<MCFixup>::iterator fixup_iterator;
|
||||
typedef SmallVectorImpl<MCFixup>::const_iterator const_fixup_iterator;
|
||||
typedef SmallVectorImpl<MCFixup>::iterator fixup_iterator;
|
||||
|
||||
public:
|
||||
MCDataFragment(MCSectionData *SD = 0) : MCFragment(FT_Data, SD) {}
|
||||
@ -133,9 +133,6 @@ public:
|
||||
Fixups.push_back(Fixup);
|
||||
}
|
||||
|
||||
std::vector<MCFixup> &getFixups() { return Fixups; }
|
||||
const std::vector<MCFixup> &getFixups() const { return Fixups; }
|
||||
|
||||
fixup_iterator fixup_begin() { return Fixups.begin(); }
|
||||
const_fixup_iterator fixup_begin() const { return Fixups.begin(); }
|
||||
|
||||
|
@ -870,7 +870,7 @@ void MCFragment::dump() {
|
||||
}
|
||||
OS << "] (" << Contents.size() << " bytes)";
|
||||
|
||||
if (!DF->getFixups().empty()) {
|
||||
if (DF->fixup_begin() != DF->fixup_end()) {
|
||||
OS << ",\n ";
|
||||
OS << " Fixups:[";
|
||||
for (MCDataFragment::const_fixup_iterator it = DF->fixup_begin(),
|
||||
|
Loading…
Reference in New Issue
Block a user