[llvm] r238704 - Use a 32 bit field for the symbol index.

Rafael Espindola rafael.espindola at gmail.com
Sun May 31 17:58:31 PDT 2015


Author: rafael
Date: Sun May 31 19:58:31 2015
New Revision: 238704

URL: http://llvm.org/viewvc/llvm-project?rev=238704&view=rev
Log:
Use a 32 bit field for the symbol index.

Even 64 ELF uses a 32 bit field to refer to symbols.

Modified:
    llvm/trunk/include/llvm/MC/MCSymbol.h

Modified: llvm/trunk/include/llvm/MC/MCSymbol.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCSymbol.h?rev=238704&r1=238703&r2=238704&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCSymbol.h (original)
+++ llvm/trunk/include/llvm/MC/MCSymbol.h Sun May 31 19:58:31 2015
@@ -66,7 +66,7 @@ class MCSymbol {
   mutable bool HasData : 1;
 
   /// Index field, for use by the object file implementation.
-  mutable uint64_t Index : 60;
+  mutable uint32_t Index = 0;
 
   /// An expression describing how to calculate the size of a symbol. If a
   /// symbol has no size this field will be NULL.
@@ -99,7 +99,7 @@ private: // MCContext creates and unique
   friend class MCContext;
   MCSymbol(const StringMapEntry<bool> *Name, bool isTemporary)
       : Name(Name), Section(nullptr), Value(nullptr), IsTemporary(isTemporary),
-        IsRedefinable(false), IsUsed(false), HasData(false), Index(0) {
+        IsRedefinable(false), IsUsed(false), HasData(false) {
     Offset = 0;
   }
 
@@ -200,15 +200,14 @@ public:
   /// @}
 
   /// Get the (implementation defined) index.
-  uint64_t getIndex() const {
+  uint32_t getIndex() const {
     assert(HasData && "Uninitialized symbol data");
     return Index;
   }
 
   /// Set the (implementation defined) index.
-  void setIndex(uint64_t Value) const {
+  void setIndex(uint32_t Value) const {
     assert(HasData && "Uninitialized symbol data");
-    assert(!(Value >> 60) && "Not enough bits for value");
     Index = Value;
   }
 





More information about the llvm-commits mailing list