mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-15 06:29:05 +00:00
PrintVRegOrUnit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189124 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -901,6 +901,7 @@ static inline raw_ostream &operator<<(raw_ostream &OS, const PrintReg &PR) {
|
|||||||
/// Usage: OS << PrintRegUnit(Unit, TRI) << '\n';
|
/// Usage: OS << PrintRegUnit(Unit, TRI) << '\n';
|
||||||
///
|
///
|
||||||
class PrintRegUnit {
|
class PrintRegUnit {
|
||||||
|
protected:
|
||||||
const TargetRegisterInfo *TRI;
|
const TargetRegisterInfo *TRI;
|
||||||
unsigned Unit;
|
unsigned Unit;
|
||||||
public:
|
public:
|
||||||
@@ -914,6 +915,21 @@ static inline raw_ostream &operator<<(raw_ostream &OS, const PrintRegUnit &PR) {
|
|||||||
return OS;
|
return OS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// PrintVRegOrUnit - It is often convenient to track virtual registers and
|
||||||
|
/// physical register units in the same list.
|
||||||
|
class PrintVRegOrUnit : protected PrintRegUnit {
|
||||||
|
public:
|
||||||
|
PrintVRegOrUnit(unsigned VRegOrUnit, const TargetRegisterInfo *tri)
|
||||||
|
: PrintRegUnit(VRegOrUnit, tri) {}
|
||||||
|
void print(raw_ostream&) const;
|
||||||
|
};
|
||||||
|
|
||||||
|
static inline raw_ostream &operator<<(raw_ostream &OS,
|
||||||
|
const PrintVRegOrUnit &PR) {
|
||||||
|
PR.print(OS);
|
||||||
|
return OS;
|
||||||
|
}
|
||||||
|
|
||||||
} // End llvm namespace
|
} // End llvm namespace
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -73,6 +73,14 @@ void PrintRegUnit::print(raw_ostream &OS) const {
|
|||||||
OS << '~' << TRI->getName(*Roots);
|
OS << '~' << TRI->getName(*Roots);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PrintVRegOrUnit::print(raw_ostream &OS) const {
|
||||||
|
if (TRI && TRI->isVirtualRegister(Unit)) {
|
||||||
|
OS << "%vreg" << TargetRegisterInfo::virtReg2Index(Unit);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
PrintRegUnit::print(OS);
|
||||||
|
}
|
||||||
|
|
||||||
/// getAllocatableClass - Return the maximal subclass of the given register
|
/// getAllocatableClass - Return the maximal subclass of the given register
|
||||||
/// class that is alloctable, or NULL.
|
/// class that is alloctable, or NULL.
|
||||||
const TargetRegisterClass *
|
const TargetRegisterClass *
|
||||||
|
Reference in New Issue
Block a user