[llvm-commits] CVS: llvm/include/llvm/CodeGen/MachineConstantPool.h

Chris Lattner lattner at cs.uiuc.edu
Wed Feb 8 18:24:36 PST 2006



Changes in directory llvm/include/llvm/CodeGen:

MachineConstantPool.h updated: 1.10 -> 1.11
---
Log message:

Require an alignment.


---
Diffs of the changes:  (+3 -6)

 MachineConstantPool.h |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)


Index: llvm/include/llvm/CodeGen/MachineConstantPool.h
diff -u llvm/include/llvm/CodeGen/MachineConstantPool.h:1.10 llvm/include/llvm/CodeGen/MachineConstantPool.h:1.11
--- llvm/include/llvm/CodeGen/MachineConstantPool.h:1.10	Tue Jan 31 16:21:33 2006
+++ llvm/include/llvm/CodeGen/MachineConstantPool.h	Wed Feb  8 20:24:25 2006
@@ -34,18 +34,15 @@
 public:
 
   /// getConstantPoolIndex - Create a new entry in the constant pool or return
-  /// an existing one. User may specify an alignment that is greater than the
-  /// default alignment. If one is not specified, it will be 0.
+  /// an existing one.  User must specify an alignment in bytes for the object.
   ///
-  unsigned getConstantPoolIndex(Constant *C, unsigned Alignment = 0) {
+  unsigned getConstantPoolIndex(Constant *C, unsigned Alignment) {
     // Check to see if we already have this constant.
     //
     // 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 = std::max(Constants[i].second, Alignment);
+      if (Constants[i].first == C && Constants[i].second >= Alignment)
         return i;
-      }
     Constants.push_back(std::make_pair(C, Alignment));
     return Constants.size()-1;
   }






More information about the llvm-commits mailing list