mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-26 12:20:42 +00:00
Use CodeGenRegister class to make reading in of register information more
systematic. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15805 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -103,11 +103,24 @@ Record *CodeGenTarget::getAsmWriter() const {
|
||||
return TargetRec->getValueAsDef("AssemblyWriter");
|
||||
}
|
||||
|
||||
void CodeGenTarget::ReadRegisters() const {
|
||||
std::vector<Record*> Regs = Records.getAllDerivedDefinitions("Register");
|
||||
if (Regs.empty())
|
||||
throw std::string("No 'Register' subclasses defined!");
|
||||
|
||||
Registers.reserve(Regs.size());
|
||||
Registers.assign(Regs.begin(), Regs.end());
|
||||
}
|
||||
|
||||
const std::string &CodeGenRegister::getName() const {
|
||||
return TheDef->getName();
|
||||
}
|
||||
|
||||
|
||||
void CodeGenTarget::ReadInstructions() const {
|
||||
std::vector<Record*> Insts = Records.getAllDerivedDefinitions("Instruction");
|
||||
|
||||
if (Insts.size() == 0)
|
||||
if (Insts.empty())
|
||||
throw std::string("No 'Instruction' subclasses defined!");
|
||||
|
||||
std::string InstFormatName =
|
||||
|
||||
Reference in New Issue
Block a user