summaryrefslogtreecommitdiff
path: root/lib/Target/ARM/ARMMachineFunctionInfo.h
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2007-03-01 07:52:44 +0000
committerEvan Cheng <evan.cheng@apple.com>2007-03-01 07:52:44 +0000
commitcda067bad95654d970e14d3555f4aa685e5ebcae (patch)
tree3947038434b61b25f29d1ce629e57382a987b49c /lib/Target/ARM/ARMMachineFunctionInfo.h
parente8019bb1fc46069109dadd5b1c48e86a912bf990 (diff)
downloadllvm-cda067bad95654d970e14d3555f4aa685e5ebcae.tar.gz
llvm-cda067bad95654d970e14d3555f4aa685e5ebcae.tar.bz2
llvm-cda067bad95654d970e14d3555f4aa685e5ebcae.tar.xz
Switch from std::vector<bool> to BitVector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34781 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/ARMMachineFunctionInfo.h')
-rw-r--r--lib/Target/ARM/ARMMachineFunctionInfo.h44
1 files changed, 32 insertions, 12 deletions
diff --git a/lib/Target/ARM/ARMMachineFunctionInfo.h b/lib/Target/ARM/ARMMachineFunctionInfo.h
index cf4c105fe1..87eda4b7e8 100644
--- a/lib/Target/ARM/ARMMachineFunctionInfo.h
+++ b/lib/Target/ARM/ARMMachineFunctionInfo.h
@@ -17,6 +17,7 @@
#include "ARMSubtarget.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/Target/TargetMachine.h"
+#include "llvm/ADT/BitVector.h"
namespace llvm {
@@ -41,7 +42,7 @@ class ARMFunctionInfo : public MachineFunctionInfo {
bool LRForceSpilled;
/// R3IsLiveIn - True if R3 is live in to this function.
- ///
+ /// FIXME: Remove when register scavenger for Thumb is done.
bool R3IsLiveIn;
/// FramePtrSpillOffset - If HasStackFrame, this records the frame pointer
@@ -68,9 +69,9 @@ class ARMFunctionInfo : public MachineFunctionInfo {
/// GPRCS1Frames, GPRCS2Frames, DPRCSFrames - Keeps track of frame indices
/// which belong to these spill areas.
- std::vector<bool> GPRCS1Frames;
- std::vector<bool> GPRCS2Frames;
- std::vector<bool> DPRCSFrames;
+ BitVector GPRCS1Frames;
+ BitVector GPRCS2Frames;
+ BitVector DPRCSFrames;
/// JumpTableUId - Unique id for jumptables.
///
@@ -82,14 +83,18 @@ public:
VarArgsRegSaveSize(0), HasStackFrame(false),
LRForceSpilled(false), R3IsLiveIn(false),
FramePtrSpillOffset(0), GPRCS1Offset(0), GPRCS2Offset(0), DPRCSOffset(0),
- GPRCS1Size(0), GPRCS2Size(0), DPRCSSize(0), JumpTableUId(0) {}
+ GPRCS1Size(0), GPRCS2Size(0), DPRCSSize(0),
+ GPRCS1Frames(32), GPRCS2Frames(32), DPRCSFrames(32),
+ JumpTableUId(0) {}
ARMFunctionInfo(MachineFunction &MF) :
isThumb(MF.getTarget().getSubtarget<ARMSubtarget>().isThumb()),
VarArgsRegSaveSize(0), HasStackFrame(false),
LRForceSpilled(false), R3IsLiveIn(false),
FramePtrSpillOffset(0), GPRCS1Offset(0), GPRCS2Offset(0), DPRCSOffset(0),
- GPRCS1Size(0), GPRCS2Size(0), DPRCSSize(0), JumpTableUId(0) {}
+ GPRCS1Size(0), GPRCS2Size(0), DPRCSSize(0),
+ GPRCS1Frames(32), GPRCS2Frames(32), DPRCSFrames(32),
+ JumpTableUId(0) {}
bool isThumbFunction() const { return isThumb; }
@@ -142,22 +147,37 @@ public:
void addGPRCalleeSavedArea1Frame(int fi) {
if (fi >= 0) {
- if (fi >= (int)GPRCS1Frames.size())
- GPRCS1Frames.resize(fi+1);
+ int Size = GPRCS1Frames.size();
+ if (fi >= Size) {
+ Size *= 2;
+ if (fi >= Size)
+ Size = fi+1;
+ GPRCS1Frames.resize(Size);
+ }
GPRCS1Frames[fi] = true;
}
}
void addGPRCalleeSavedArea2Frame(int fi) {
if (fi >= 0) {
- if (fi >= (int)GPRCS2Frames.size())
- GPRCS2Frames.resize(fi+1);
+ int Size = GPRCS2Frames.size();
+ if (fi >= Size) {
+ Size *= 2;
+ if (fi >= Size)
+ Size = fi+1;
+ GPRCS2Frames.resize(Size);
+ }
GPRCS2Frames[fi] = true;
}
}
void addDPRCalleeSavedAreaFrame(int fi) {
if (fi >= 0) {
- if (fi >= (int)DPRCSFrames.size())
- DPRCSFrames.resize(fi+1);
+ int Size = DPRCSFrames.size();
+ if (fi >= Size) {
+ Size *= 2;
+ if (fi >= Size)
+ Size = fi+1;
+ DPRCSFrames.resize(Size);
+ }
DPRCSFrames[fi] = true;
}
}