mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-04 19:17:12 +00:00
Add some methods
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24596 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -42,6 +42,8 @@ namespace llvm {
|
|||||||
|
|
||||||
const std::string &getName() const;
|
const std::string &getName() const;
|
||||||
|
|
||||||
|
unsigned getNumValueTypes() const { return VTs.size(); }
|
||||||
|
|
||||||
const MVT::ValueType getValueTypeNum(unsigned VTNum) const {
|
const MVT::ValueType getValueTypeNum(unsigned VTNum) const {
|
||||||
if (VTNum < VTs.size())
|
if (VTNum < VTs.size())
|
||||||
return VTs[VTNum];
|
return VTs[VTNum];
|
||||||
|
@@ -91,6 +91,25 @@ public:
|
|||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// getRegisterClassForRegister - Find the register class that contains the
|
||||||
|
/// specified physical register. If there register exists in multiple
|
||||||
|
/// register classes or is not in a register class, return null.
|
||||||
|
const CodeGenRegisterClass *getRegisterClassForRegister(Record *R) const {
|
||||||
|
const std::vector<CodeGenRegisterClass> &RCs = getRegisterClasses();
|
||||||
|
const CodeGenRegisterClass *FoundRC = 0;
|
||||||
|
for (unsigned i = 0, e = RCs.size(); i != e; ++i) {
|
||||||
|
const CodeGenRegisterClass &RC = RegisterClasses[i];
|
||||||
|
for (unsigned ei = 0, ee = RC.Elements.size(); ei != ee; ++ei) {
|
||||||
|
if (R == RC.Elements[ei]) {
|
||||||
|
if (FoundRC) return 0; // In multiple RC's
|
||||||
|
FoundRC = &RC;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return FoundRC;
|
||||||
|
}
|
||||||
|
|
||||||
const std::vector<MVT::ValueType> &getLegalValueTypes() const {
|
const std::vector<MVT::ValueType> &getLegalValueTypes() const {
|
||||||
if (LegalValueTypes.empty()) ReadLegalValueTypes();
|
if (LegalValueTypes.empty()) ReadLegalValueTypes();
|
||||||
return LegalValueTypes;
|
return LegalValueTypes;
|
||||||
|
Reference in New Issue
Block a user