[llvm-commits] [llvm] r140940 - in /llvm/trunk/lib/Target/ARM: ARMConstantPoolValue.cpp ARMConstantPoolValue.h

Bill Wendling isanbard at gmail.com
Sat Oct 1 02:04:18 PDT 2011


Author: void
Date: Sat Oct  1 04:04:18 2011
New Revision: 140940

URL: http://llvm.org/viewvc/llvm-project?rev=140940&view=rev
Log:
Remove now dead methods and ivar.

Modified:
    llvm/trunk/lib/Target/ARM/ARMConstantPoolValue.cpp
    llvm/trunk/lib/Target/ARM/ARMConstantPoolValue.h

Modified: llvm/trunk/lib/Target/ARM/ARMConstantPoolValue.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMConstantPoolValue.cpp?rev=140940&r1=140939&r2=140940&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMConstantPoolValue.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMConstantPoolValue.cpp Sat Oct  1 04:04:18 2011
@@ -31,7 +31,7 @@
                                            unsigned char PCAdj,
                                            ARMCP::ARMCPModifier modifier,
                                            bool addCurrentAddress)
-  : MachineConstantPoolValue(Ty), MBB(NULL), S(NULL), LabelId(id), Kind(kind),
+  : MachineConstantPoolValue(Ty), MBB(NULL), LabelId(id), Kind(kind),
     PCAdjust(PCAdj), Modifier(modifier),
     AddCurrentAddress(addCurrentAddress) {}
 
@@ -41,7 +41,7 @@
                                            ARMCP::ARMCPModifier modifier,
                                            bool addCurrentAddress)
   : MachineConstantPoolValue((Type*)Type::getInt32Ty(C)),
-    S(NULL), LabelId(id), Kind(kind), PCAdjust(PCAdj), Modifier(modifier),
+    LabelId(id), Kind(kind), PCAdjust(PCAdj), Modifier(modifier),
     AddCurrentAddress(addCurrentAddress) {}
 
 ARMConstantPoolValue::ARMConstantPoolValue(LLVMContext &C,
@@ -52,21 +52,10 @@
                                            ARMCP::ARMCPModifier Modif,
                                            bool AddCA)
   : MachineConstantPoolValue((Type*)Type::getInt8PtrTy(C)),
-    MBB(mbb), S(NULL), LabelId(id), Kind(K), PCAdjust(PCAdj),
+    MBB(mbb), LabelId(id), Kind(K), PCAdjust(PCAdj),
     Modifier(Modif), AddCurrentAddress(AddCA) {}
 
-ARMConstantPoolValue::ARMConstantPoolValue(LLVMContext &C,
-                                           const char *s, unsigned id,
-                                           unsigned char PCAdj,
-                                           ARMCP::ARMCPModifier Modif,
-                                           bool AddCA)
-  : MachineConstantPoolValue((Type*)Type::getInt32Ty(C)),
-    S(strdup(s)), LabelId(id), Kind(ARMCP::CPExtSymbol),
-    PCAdjust(PCAdj), Modifier(Modif), AddCurrentAddress(AddCA) {}
-
-ARMConstantPoolValue::~ARMConstantPoolValue() {
-  free((void*)S);
-}
+ARMConstantPoolValue::~ARMConstantPoolValue() {}
 
 const MachineBasicBlock *ARMConstantPoolValue::getMBB() const {
   return MBB;
@@ -86,14 +75,6 @@
   }
 }
 
-static bool CPV_streq(const char *S1, const char *S2) {
-  if (S1 == S2)
-    return true;
-  if (S1 && S2 && strcmp(S1, S2) == 0)
-    return true;
-  return false;
-}
-
 int ARMConstantPoolValue::getExistingMachineCPValue(MachineConstantPool *CP,
                                                     unsigned Alignment) {
   unsigned AlignMask = Alignment - 1;
@@ -105,7 +86,6 @@
         (ARMConstantPoolValue *)Constants[i].Val.MachineCPVal;
       if (CPV->LabelId == LabelId &&
           CPV->PCAdjust == PCAdjust &&
-          CPV_streq(CPV->S, S) &&
           CPV->Modifier == Modifier)
         return i;
     }
@@ -116,7 +96,6 @@
 
 void
 ARMConstantPoolValue::addSelectionDAGCSEId(FoldingSetNodeID &ID) {
-  ID.AddPointer(S);
   ID.AddInteger(LabelId);
   ID.AddInteger(PCAdjust);
 }
@@ -125,7 +104,6 @@
 ARMConstantPoolValue::hasSameValue(ARMConstantPoolValue *ACPV) {
   if (ACPV->Kind == Kind &&
       ACPV->PCAdjust == PCAdjust &&
-      CPV_streq(ACPV->S, S) &&
       ACPV->Modifier == Modifier) {
     if (ACPV->LabelId == LabelId)
       return true;
@@ -144,8 +122,6 @@
 void ARMConstantPoolValue::print(raw_ostream &O) const {
   if (MBB)
     O << "";
-  else
-    O << S;
   if (Modifier) O << "(" << getModifierText() << ")";
   if (PCAdjust != 0) {
     O << "-(LPC" << LabelId << "+" << (unsigned)PCAdjust;
@@ -286,6 +262,14 @@
                                    AddCurrentAddress);
 }
 
+static bool CPV_streq(const char *S1, const char *S2) {
+  if (S1 == S2)
+    return true;
+  if (S1 && S2 && strcmp(S1, S2) == 0)
+    return true;
+  return false;
+}
+
 int ARMConstantPoolSymbol::getExistingMachineCPValue(MachineConstantPool *CP,
                                                      unsigned Alignment) {
   unsigned AlignMask = Alignment - 1;

Modified: llvm/trunk/lib/Target/ARM/ARMConstantPoolValue.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMConstantPoolValue.h?rev=140940&r1=140939&r2=140940&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMConstantPoolValue.h (original)
+++ llvm/trunk/lib/Target/ARM/ARMConstantPoolValue.h Sat Oct  1 04:04:18 2011
@@ -50,7 +50,6 @@
 /// instruction and the constant being loaded, i.e. (&GV-(LPIC+8)).
 class ARMConstantPoolValue : public MachineConstantPoolValue {
   const MachineBasicBlock *MBB; // MachineBasicBlock being loaded.
-  const char *S;           // ExtSymbol being loaded.
   unsigned LabelId;        // Label id of the load.
   ARMCP::ARMCPKind Kind;   // Kind of constant.
   unsigned char PCAdjust;  // Extra adjustment if constantpool is pc-relative.
@@ -72,13 +71,8 @@
                        unsigned char PCAdj = 0,
                        ARMCP::ARMCPModifier Modifier = ARMCP::no_modifier,
                        bool AddCurrentAddress = false);
-  ARMConstantPoolValue(LLVMContext &C, const char *s, unsigned id,
-                       unsigned char PCAdj = 0,
-                       ARMCP::ARMCPModifier Modifier = ARMCP::no_modifier,
-                       bool AddCurrentAddress = false);
   virtual ~ARMConstantPoolValue();
 
-  const char *getSymbol() const { return S; }
   const MachineBasicBlock *getMBB() const;
 
   ARMCP::ARMCPModifier getModifier() const { return Modifier; }





More information about the llvm-commits mailing list