mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-15 07:34:33 +00:00
Alternative name enum should go into the enum portion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133979 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
1e0bd63477
commit
4987033fbd
@ -57,7 +57,8 @@ RegisterInfoEmitter::runEnums(raw_ostream &OS,
|
||||
Target.getRegisterClasses();
|
||||
if (!RegisterClasses.empty()) {
|
||||
OS << "\n// Register classes\n";
|
||||
OS << "namespace " << RegisterClasses[0].Namespace << " {\n";
|
||||
if (!Namespace.empty())
|
||||
OS << "namespace " << Namespace << " {\n";
|
||||
OS << "enum {\n";
|
||||
for (unsigned i = 0, e = RegisterClasses.size(); i != e; ++i) {
|
||||
if (i) OS << ",\n";
|
||||
@ -65,9 +66,27 @@ RegisterInfoEmitter::runEnums(raw_ostream &OS,
|
||||
OS << " = " << i;
|
||||
}
|
||||
OS << "\n };\n";
|
||||
OS << "}\n";
|
||||
if (!Namespace.empty())
|
||||
OS << "}\n";
|
||||
}
|
||||
|
||||
const std::vector<Record*> RegAltNameIndices = Target.getRegAltNameIndices();
|
||||
// If the only definition is the default NoRegAltName, we don't need to
|
||||
// emit anything.
|
||||
if (RegAltNameIndices.size() > 1) {
|
||||
OS << "\n// Register alternate name indices\n";
|
||||
if (!Namespace.empty())
|
||||
OS << "namespace " << Namespace << " {\n";
|
||||
OS << "enum {\n";
|
||||
for (unsigned i = 0, e = RegAltNameIndices.size(); i != e; ++i)
|
||||
OS << " " << RegAltNameIndices[i]->getName() << ",\t// " << i << "\n";
|
||||
OS << " NUM_TARGET_REG_ALT_NAMES = " << RegAltNameIndices.size() << "\n";
|
||||
OS << "};\n";
|
||||
if (!Namespace.empty())
|
||||
OS << "}\n";
|
||||
}
|
||||
|
||||
|
||||
OS << "} // End llvm namespace \n";
|
||||
OS << "#endif // GET_REGINFO_ENUM\n\n";
|
||||
}
|
||||
@ -112,18 +131,6 @@ RegisterInfoEmitter::runMCDesc(raw_ostream &OS, CodeGenTarget &Target,
|
||||
OS << "0 };\n";
|
||||
}
|
||||
|
||||
const std::vector<Record*> RegAltNameIndices = Target.getRegAltNameIndices();
|
||||
// If the only definition is the default NoRegAltName, we don't need to
|
||||
// emit anything.
|
||||
if (RegAltNameIndices.size() > 1) {
|
||||
OS << "\n// Register alternate name indices\n";
|
||||
OS << "enum {\n";
|
||||
for (unsigned i = 0, e = RegAltNameIndices.size(); i != e; ++i)
|
||||
OS << " " << RegAltNameIndices[i]->getName() << ",\t// " << i << "\n";
|
||||
OS << " NUM_TARGET_REG_ALT_NAMES = " << RegAltNameIndices.size() << "\n";
|
||||
OS << "};\n";
|
||||
}
|
||||
|
||||
// Emit the empty sub-registers list
|
||||
OS << " const unsigned Empty_SubRegsSet[] = { 0 };\n";
|
||||
// Loop over all of the registers which have sub-registers, emitting the
|
||||
|
Loading…
x
Reference in New Issue
Block a user