[llvm-commits] CVS: llvm/lib/Target/ARM/ARMAsmPrinter.cpp ARMMachineFunctionInfo.h ARMRegisterInfo.h
Evan Cheng
evan.cheng at apple.com
Wed Jan 24 19:07:42 PST 2007
Changes in directory llvm/lib/Target/ARM:
ARMAsmPrinter.cpp updated: 1.46 -> 1.47
ARMMachineFunctionInfo.h updated: 1.2 -> 1.3
ARMRegisterInfo.h updated: 1.6 -> 1.7
---
Log message:
Getting rid uses of evil std::set<>
---
Diffs of the changes: (+39 -23)
ARMAsmPrinter.cpp | 1
ARMMachineFunctionInfo.h | 60 ++++++++++++++++++++++++++++++-----------------
ARMRegisterInfo.h | 1
3 files changed, 39 insertions(+), 23 deletions(-)
Index: llvm/lib/Target/ARM/ARMAsmPrinter.cpp
diff -u llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.46 llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.47
--- llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.46 Tue Jan 23 16:59:13 2007
+++ llvm/lib/Target/ARM/ARMAsmPrinter.cpp Wed Jan 24 21:07:27 2007
@@ -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: llvm/lib/Target/ARM/ARMMachineFunctionInfo.h
diff -u llvm/lib/Target/ARM/ARMMachineFunctionInfo.h:1.2 llvm/lib/Target/ARM/ARMMachineFunctionInfo.h:1.3
--- llvm/lib/Target/ARM/ARMMachineFunctionInfo.h:1.2 Fri Jan 19 20:09:25 2007
+++ llvm/lib/Target/ARM/ARMMachineFunctionInfo.h Wed Jan 24 21:07:27 2007
@@ -60,9 +60,9 @@
/// 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 @@
void setGPRCalleeSavedArea2Size(unsigned s) { GPRCS2Size = s; }
void setDPRCalleeSavedAreaSize(unsigned s) { DPRCSSize = s; }
- bool isGPRCalleeSavedArea1Frame(unsigned fi) const {
- return GPRCS1Frames.count(fi);
- }
- bool isGPRCalleeSavedArea2Frame(unsigned fi) const {
- return GPRCS2Frames.count(fi);
- }
- bool isDPRCalleeSavedAreaFrame(unsigned fi) const {
- return DPRCSFrames.count(fi);
- }
-
- void addGPRCalleeSavedArea1Frame(unsigned fi) {
- GPRCS1Frames.insert(fi);
- }
- void addGPRCalleeSavedArea2Frame(unsigned fi) {
- GPRCS2Frames.insert(fi);
- }
- void addDPRCalleeSavedAreaFrame(unsigned fi) {
- DPRCSFrames.insert(fi);
+ bool isGPRCalleeSavedArea1Frame(int fi) const {
+ if (fi < 0 || fi >= (int)GPRCS1Frames.size())
+ return false;
+ return GPRCS1Frames[fi];
+ }
+ bool isGPRCalleeSavedArea2Frame(int fi) const {
+ if (fi < 0 || fi >= (int)GPRCS2Frames.size())
+ return false;
+ return GPRCS2Frames[fi];
+ }
+ bool isDPRCalleeSavedAreaFrame(int fi) const {
+ if (fi < 0 || fi >= (int)DPRCSFrames.size())
+ return false;
+ return DPRCSFrames[fi];
+ }
+
+ void addGPRCalleeSavedArea1Frame(int fi) {
+ if (fi >= 0) {
+ if (fi >= (int)GPRCS1Frames.size())
+ GPRCS1Frames.resize(fi+1);
+ GPRCS1Frames[fi] = true;
+ }
+ }
+ void addGPRCalleeSavedArea2Frame(int fi) {
+ if (fi >= 0) {
+ if (fi >= (int)GPRCS2Frames.size())
+ GPRCS2Frames.resize(fi+1);
+ GPRCS2Frames[fi] = true;
+ }
+ }
+ void addDPRCalleeSavedAreaFrame(int fi) {
+ if (fi >= 0) {
+ if (fi >= (int)DPRCSFrames.size())
+ DPRCSFrames.resize(fi+1);
+ DPRCSFrames[fi] = true;
+ }
}
unsigned createJumpTableUId() {
Index: llvm/lib/Target/ARM/ARMRegisterInfo.h
diff -u llvm/lib/Target/ARM/ARMRegisterInfo.h:1.6 llvm/lib/Target/ARM/ARMRegisterInfo.h:1.7
--- llvm/lib/Target/ARM/ARMRegisterInfo.h:1.6 Mon Jan 22 18:52:44 2007
+++ llvm/lib/Target/ARM/ARMRegisterInfo.h Wed Jan 24 21:07:27 2007
@@ -17,7 +17,6 @@
#include "llvm/Target/MRegisterInfo.h"
#include "ARMGenRegisterInfo.h.inc"
-#include <set>
namespace llvm {
class TargetInstrInfo;
More information about the llvm-commits
mailing list