mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-26 23:24:34 +00:00
Some code cleanups from Chris
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11724 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -18,12 +18,10 @@
|
|||||||
#define LLVM_CODEGEN_PHYSREGTRACKER_H
|
#define LLVM_CODEGEN_PHYSREGTRACKER_H
|
||||||
|
|
||||||
#include "llvm/CodeGen/MachineFunction.h"
|
#include "llvm/CodeGen/MachineFunction.h"
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
|
|
||||||
class PhysRegTracker {
|
class PhysRegTracker {
|
||||||
private:
|
|
||||||
const MRegisterInfo* mri_;
|
const MRegisterInfo* mri_;
|
||||||
std::vector<unsigned> regUse_;
|
std::vector<unsigned> regUse_;
|
||||||
|
|
||||||
@ -50,10 +48,8 @@ namespace llvm {
|
|||||||
assert(MRegisterInfo::isPhysicalRegister(physReg) &&
|
assert(MRegisterInfo::isPhysicalRegister(physReg) &&
|
||||||
"should be physical register!");
|
"should be physical register!");
|
||||||
++regUse_[physReg];
|
++regUse_[physReg];
|
||||||
for (const unsigned* as = mri_->getAliasSet(physReg); *as; ++as) {
|
for (const unsigned* as = mri_->getAliasSet(physReg); *as; ++as)
|
||||||
physReg = *as;
|
++regUse_[*as];
|
||||||
++regUse_[physReg];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void delRegUse(unsigned physReg) {
|
void delRegUse(unsigned physReg) {
|
||||||
@ -62,9 +58,8 @@ namespace llvm {
|
|||||||
assert(regUse_[physReg] != 0);
|
assert(regUse_[physReg] != 0);
|
||||||
--regUse_[physReg];
|
--regUse_[physReg];
|
||||||
for (const unsigned* as = mri_->getAliasSet(physReg); *as; ++as) {
|
for (const unsigned* as = mri_->getAliasSet(physReg); *as; ++as) {
|
||||||
physReg = *as;
|
assert(regUse_[*as] != 0);
|
||||||
assert(regUse_[physReg] != 0);
|
--regUse_[*as];
|
||||||
--regUse_[physReg];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user