Getting rid uses of evil std::set<>
authorEvan Cheng <evan.cheng@apple.com>
Thu, 25 Jan 2007 03:07:27 +0000 (03:07 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Thu, 25 Jan 2007 03:07:27 +0000 (03:07 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33496 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMAsmPrinter.cpp
lib/Target/ARM/ARMMachineFunctionInfo.h
lib/Target/ARM/ARMRegisterInfo.h

index 1ca8bfd75cfea9b8a99131c2e441b5527853d42b..3bdf3f967cc2dd33b2e3730a6a247e3ebdd511ee 100644 (file)
@@ -37,7 +37,6 @@
 #include "llvm/Support/MathExtras.h"
 #include <cctype>
 #include <iostream>
-#include <set>
 using namespace llvm;
 
 STATISTIC(EmittedInsts, "Number of machine instrs printed");
index 8de6bf85589e98b7df1139cb2d190d47c7ac38c5..05dc0dccdeb2e49a8cf37072500f90ec46e90557 100644 (file)
@@ -60,9 +60,9 @@ class ARMFunctionInfo : public MachineFunctionInfo {
 
   /// GPRCS1Frames, GPRCS2Frames, DPRCSFrames - Keeps track of frame indices
   /// which belong to these spill areas.
-  std::set<int> GPRCS1Frames;
-  std::set<int> GPRCS2Frames;
-  std::set<int> DPRCSFrames;
+  std::vector<bool> GPRCS1Frames;
+  std::vector<bool> GPRCS2Frames;
+  std::vector<bool> DPRCSFrames;
 
   /// JumpTableUId - Unique id for jumptables.
   ///
@@ -107,24 +107,42 @@ public:
   void setGPRCalleeSavedArea2Size(unsigned s) { GPRCS2Size = s; }
   void setDPRCalleeSavedAreaSize(unsigned s)  { DPRCSSize = s; }
 
-  bool isGPRCalleeSavedArea1Frame(unsigned fi) const {
-    return GPRCS1Frames.count(fi);
+  bool isGPRCalleeSavedArea1Frame(int fi) const {
+    if (fi < 0 || fi >= (int)GPRCS1Frames.size())
+      return false;
+    return GPRCS1Frames[fi];
   }
-  bool isGPRCalleeSavedArea2Frame(unsigned fi) const {
-    return GPRCS2Frames.count(fi);
+  bool isGPRCalleeSavedArea2Frame(int fi) const {
+    if (fi < 0 || fi >= (int)GPRCS2Frames.size())
+      return false;
+    return GPRCS2Frames[fi];
   }
-  bool isDPRCalleeSavedAreaFrame(unsigned fi) const {
-    return DPRCSFrames.count(fi);
+  bool isDPRCalleeSavedAreaFrame(int fi) const {
+    if (fi < 0 || fi >= (int)DPRCSFrames.size())
+      return false;
+    return DPRCSFrames[fi];
   }
 
-  void addGPRCalleeSavedArea1Frame(unsigned fi) {
-    GPRCS1Frames.insert(fi);
+  void addGPRCalleeSavedArea1Frame(int fi) {
+    if (fi >= 0) {
+      if (fi >= (int)GPRCS1Frames.size())
+        GPRCS1Frames.resize(fi+1);
+      GPRCS1Frames[fi] = true;
+    }
   }
-  void addGPRCalleeSavedArea2Frame(unsigned fi) {
-    GPRCS2Frames.insert(fi);
+  void addGPRCalleeSavedArea2Frame(int fi) {
+    if (fi >= 0) {
+      if (fi >= (int)GPRCS2Frames.size())
+        GPRCS2Frames.resize(fi+1);
+      GPRCS2Frames[fi] = true;
+    }
   }
-  void addDPRCalleeSavedAreaFrame(unsigned fi) {
-    DPRCSFrames.insert(fi);
+  void addDPRCalleeSavedAreaFrame(int fi) {
+    if (fi >= 0) {
+      if (fi >= (int)DPRCSFrames.size())
+        DPRCSFrames.resize(fi+1);
+      DPRCSFrames[fi] = true;
+    }
   }
 
   unsigned createJumpTableUId() {
index 96a969856f9888feae365da9b613255db5d6eb25..e46da07b000ebee423b9db6d7ffe0660a304d05c 100644 (file)
@@ -17,7 +17,6 @@
 
 #include "llvm/Target/MRegisterInfo.h"
 #include "ARMGenRegisterInfo.h.inc"
-#include <set>
 
 namespace llvm {
   class TargetInstrInfo;