mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-21 08:17:40 +00:00
Teach TableGen to automatically generate missing SubRegIndex instances.
The RegisterInfo.td file should only specify the indexes that sources need to refer to. The rest is inferred. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131058 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -98,14 +98,14 @@ std::string llvm::getEnumName(MVT::SimpleValueType T) {
|
||||
/// namespace qualifier if the record contains one.
|
||||
///
|
||||
std::string llvm::getQualifiedName(const Record *R) {
|
||||
std::string Namespace = R->getValueAsString("Namespace");
|
||||
std::string Namespace;
|
||||
if (R->getValue("Namespace"))
|
||||
Namespace = R->getValueAsString("Namespace");
|
||||
if (Namespace.empty()) return R->getName();
|
||||
return Namespace + "::" + R->getName();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// getTarget - Return the current instance of the Target class.
|
||||
///
|
||||
CodeGenTarget::CodeGenTarget(RecordKeeper &records) : Records(records) {
|
||||
@@ -182,6 +182,13 @@ void CodeGenTarget::ReadSubRegIndices() const {
|
||||
std::sort(SubRegIndices.begin(), SubRegIndices.end(), LessRecord());
|
||||
}
|
||||
|
||||
Record *CodeGenTarget::createSubRegIndex(const std::string &Name) {
|
||||
Record *R = new Record(Name, SMLoc(), Records);
|
||||
Records.addDef(R);
|
||||
SubRegIndices.push_back(R);
|
||||
return R;
|
||||
}
|
||||
|
||||
void CodeGenTarget::ReadRegisterClasses() const {
|
||||
std::vector<Record*> RegClasses =
|
||||
Records.getAllDerivedDefinitions("RegisterClass");
|
||||
|
||||
Reference in New Issue
Block a user