mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-05-13 01:15:32 +00:00
Declare register classes as const. Fix a couple pointers to register classes that weren't already const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151138 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
cc77b54036
commit
c528e462a1
@ -2269,7 +2269,7 @@ SDNode *X86DAGToDAGISel::Select(SDNode *Node) {
|
|||||||
|
|
||||||
// On x86-32, only the ABCD registers have 8-bit subregisters.
|
// On x86-32, only the ABCD registers have 8-bit subregisters.
|
||||||
if (!Subtarget->is64Bit()) {
|
if (!Subtarget->is64Bit()) {
|
||||||
TargetRegisterClass *TRC = 0;
|
const TargetRegisterClass *TRC;
|
||||||
switch (N0.getValueType().getSimpleVT().SimpleTy) {
|
switch (N0.getValueType().getSimpleVT().SimpleTy) {
|
||||||
case MVT::i32: TRC = &X86::GR32_ABCDRegClass; break;
|
case MVT::i32: TRC = &X86::GR32_ABCDRegClass; break;
|
||||||
case MVT::i16: TRC = &X86::GR16_ABCDRegClass; break;
|
case MVT::i16: TRC = &X86::GR16_ABCDRegClass; break;
|
||||||
@ -2298,7 +2298,7 @@ SDNode *X86DAGToDAGISel::Select(SDNode *Node) {
|
|||||||
SDValue Reg = N0.getNode()->getOperand(0);
|
SDValue Reg = N0.getNode()->getOperand(0);
|
||||||
|
|
||||||
// Put the value in an ABCD register.
|
// Put the value in an ABCD register.
|
||||||
TargetRegisterClass *TRC = 0;
|
const TargetRegisterClass *TRC;
|
||||||
switch (N0.getValueType().getSimpleVT().SimpleTy) {
|
switch (N0.getValueType().getSimpleVT().SimpleTy) {
|
||||||
case MVT::i64: TRC = &X86::GR64_ABCDRegClass; break;
|
case MVT::i64: TRC = &X86::GR64_ABCDRegClass; break;
|
||||||
case MVT::i32: TRC = &X86::GR32_ABCDRegClass; break;
|
case MVT::i32: TRC = &X86::GR32_ABCDRegClass; break;
|
||||||
|
@ -480,7 +480,7 @@ RegisterInfoEmitter::runTargetHeader(raw_ostream &OS, CodeGenTarget &Target,
|
|||||||
OS << " };\n";
|
OS << " };\n";
|
||||||
|
|
||||||
// Output the extern for the instance.
|
// Output the extern for the instance.
|
||||||
OS << " extern " << Name << "Class\t" << Name << "RegClass;\n";
|
OS << " extern const " << Name << "Class " << Name << "RegClass;\n";
|
||||||
// Output the extern for the pointer to the instance (should remove).
|
// Output the extern for the pointer to the instance (should remove).
|
||||||
OS << " static const TargetRegisterClass * const " << Name
|
OS << " static const TargetRegisterClass * const " << Name
|
||||||
<< "RegisterClass = &" << Name << "RegClass;\n";
|
<< "RegisterClass = &" << Name << "RegClass;\n";
|
||||||
@ -548,8 +548,9 @@ RegisterInfoEmitter::runTargetDesc(raw_ostream &OS, CodeGenTarget &Target,
|
|||||||
OS << "namespace " << RegisterClasses[0]->Namespace
|
OS << "namespace " << RegisterClasses[0]->Namespace
|
||||||
<< " { // Register class instances\n";
|
<< " { // Register class instances\n";
|
||||||
for (unsigned i = 0, e = RegisterClasses.size(); i != e; ++i)
|
for (unsigned i = 0, e = RegisterClasses.size(); i != e; ++i)
|
||||||
OS << " " << RegisterClasses[i]->getName() << "Class\t"
|
OS << " extern const " << RegisterClasses[i]->getName() << "Class "
|
||||||
<< RegisterClasses[i]->getName() << "RegClass;\n";
|
<< RegisterClasses[i]->getName() << "RegClass = "
|
||||||
|
<< RegisterClasses[i]->getName() << "Class();\n";
|
||||||
|
|
||||||
std::map<unsigned, std::set<unsigned> > SuperRegClassMap;
|
std::map<unsigned, std::set<unsigned> > SuperRegClassMap;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user