mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-05-24 02:38:42 +00:00
Use BitVector instead. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34460 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e549c4940c
commit
957840b3e1
@ -27,6 +27,7 @@
|
|||||||
#include "llvm/Support/CommandLine.h"
|
#include "llvm/Support/CommandLine.h"
|
||||||
#include "llvm/Support/Debug.h"
|
#include "llvm/Support/Debug.h"
|
||||||
#include "llvm/Support/Compiler.h"
|
#include "llvm/Support/Compiler.h"
|
||||||
|
#include "llvm/ADT/BitVector.h"
|
||||||
#include "llvm/ADT/Statistic.h"
|
#include "llvm/ADT/Statistic.h"
|
||||||
#include "llvm/ADT/STLExtras.h"
|
#include "llvm/ADT/STLExtras.h"
|
||||||
#include "llvm/ADT/SmallSet.h"
|
#include "llvm/ADT/SmallSet.h"
|
||||||
@ -423,14 +424,10 @@ namespace {
|
|||||||
class VISIBILITY_HIDDEN ReuseInfo {
|
class VISIBILITY_HIDDEN ReuseInfo {
|
||||||
MachineInstr &MI;
|
MachineInstr &MI;
|
||||||
std::vector<ReusedOp> Reuses;
|
std::vector<ReusedOp> Reuses;
|
||||||
bool *PhysRegsClobbered;
|
BitVector PhysRegsClobbered;
|
||||||
public:
|
public:
|
||||||
ReuseInfo(MachineInstr &mi, const MRegisterInfo *mri) : MI(mi) {
|
ReuseInfo(MachineInstr &mi, const MRegisterInfo *mri) : MI(mi) {
|
||||||
PhysRegsClobbered = new bool[mri->getNumRegs()];
|
PhysRegsClobbered.resize(mri->getNumRegs());
|
||||||
std::fill(PhysRegsClobbered, PhysRegsClobbered+mri->getNumRegs(), false);
|
|
||||||
}
|
|
||||||
~ReuseInfo() {
|
|
||||||
delete[] PhysRegsClobbered;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool hasReuses() const {
|
bool hasReuses() const {
|
||||||
@ -452,11 +449,11 @@ namespace {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void markClobbered(unsigned PhysReg) {
|
void markClobbered(unsigned PhysReg) {
|
||||||
PhysRegsClobbered[PhysReg] = true;
|
PhysRegsClobbered.set(PhysReg);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isClobbered(unsigned PhysReg) const {
|
bool isClobbered(unsigned PhysReg) const {
|
||||||
return PhysRegsClobbered[PhysReg];
|
return PhysRegsClobbered.test(PhysReg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// GetRegForReload - We are about to emit a reload into PhysReg. If there
|
/// GetRegForReload - We are about to emit a reload into PhysReg. If there
|
||||||
|
Loading…
x
Reference in New Issue
Block a user