diff options
author | Chris Lattner <sabre@nondot.org> | 2006-02-09 04:21:49 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-02-09 04:21:49 +0000 |
commit | 1cd22199dd07a19eabe5a5b078c720662b5af1a0 (patch) | |
tree | 7ff27503cb421ccb82b62de3f833b47136b01cf9 | |
parent | 47f7319f0050bb99fe02b259f115c340231961d6 (diff) | |
download | bcm5719-llvm-1cd22199dd07a19eabe5a5b078c720662b5af1a0.tar.gz bcm5719-llvm-1cd22199dd07a19eabe5a5b078c720662b5af1a0.zip |
Use a MachineConstantPoolEntry struct instead of a pair to hold
constant pool entries.
llvm-svn: 26075
-rw-r--r-- | llvm/include/llvm/CodeGen/MachineConstantPool.h | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/llvm/include/llvm/CodeGen/MachineConstantPool.h b/llvm/include/llvm/CodeGen/MachineConstantPool.h index 2ac6e148b34..bcfa40c18cb 100644 --- a/llvm/include/llvm/CodeGen/MachineConstantPool.h +++ b/llvm/include/llvm/CodeGen/MachineConstantPool.h @@ -30,10 +30,20 @@ namespace llvm { class Constant; +/// MachineConstantPoolEntry - One entry in the constant pool. +/// +struct MachineConstantPoolEntry { + /// Val - The constant itself. + Constant *Val; + /// Alignment - The alignment of the constant. + unsigned Alignment; + + MachineConstantPoolEntry(Constant *V, unsigned A) : Val(V), Alignment(A) {} +}; + class MachineConstantPool { - std::vector<std::pair<Constant*,unsigned> > Constants; + std::vector<MachineConstantPoolEntry> Constants; public: - /// getConstantPoolIndex - Create a new entry in the constant pool or return /// an existing one. User must specify an alignment in bytes for the object. /// @@ -44,9 +54,9 @@ public: // // FIXME, this could be made much more efficient for large constant pools. for (unsigned i = 0, e = Constants.size(); i != e; ++i) - if (Constants[i].first == C && Constants[i].second >= Alignment) + if (Constants[i].Val == C && Constants[i].Alignment >= Alignment) return i; - Constants.push_back(std::make_pair(C, Alignment)); + Constants.push_back(MachineConstantPoolEntry(C, Alignment)); return Constants.size()-1; } @@ -54,7 +64,7 @@ public: /// bool isEmpty() const { return Constants.empty(); } - const std::vector<std::pair<Constant*,unsigned> > &getConstants() const { + const std::vector<MachineConstantPoolEntry> &getConstants() const { return Constants; } |