mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-03 09:21:13 +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:
parent
b5d01436e3
commit
5c4736a3da
@ -42,6 +42,8 @@ namespace llvm {
|
||||
|
||||
const std::string &getName() const;
|
||||
|
||||
unsigned getNumValueTypes() const { return VTs.size(); }
|
||||
|
||||
const MVT::ValueType getValueTypeNum(unsigned VTNum) const {
|
||||
if (VTNum < VTs.size())
|
||||
return VTs[VTNum];
|
||||
|
@ -90,7 +90,26 @@ public:
|
||||
assert(0 && "Didn't find the register class");
|
||||
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 {
|
||||
if (LegalValueTypes.empty()) ReadLegalValueTypes();
|
||||
return LegalValueTypes;
|
||||
|
Loading…
Reference in New Issue
Block a user