[llvm-commits] [llvm] r151138 - in /llvm/trunk: lib/Target/X86/X86ISelDAGToDAG.cpp utils/TableGen/RegisterInfoEmitter.cpp
Craig Topper
craig.topper at gmail.com
Tue Feb 21 23:28:11 PST 2012
Author: ctopper
Date: Wed Feb 22 01:28:11 2012
New Revision: 151138
URL: http://llvm.org/viewvc/llvm-project?rev=151138&view=rev
Log:
Declare register classes as const. Fix a couple pointers to register classes that weren't already const.
Modified:
llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp
llvm/trunk/utils/TableGen/RegisterInfoEmitter.cpp
Modified: llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp?rev=151138&r1=151137&r2=151138&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp Wed Feb 22 01:28:11 2012
@@ -2269,7 +2269,7 @@
// On x86-32, only the ABCD registers have 8-bit subregisters.
if (!Subtarget->is64Bit()) {
- TargetRegisterClass *TRC = 0;
+ const TargetRegisterClass *TRC;
switch (N0.getValueType().getSimpleVT().SimpleTy) {
case MVT::i32: TRC = &X86::GR32_ABCDRegClass; break;
case MVT::i16: TRC = &X86::GR16_ABCDRegClass; break;
@@ -2298,7 +2298,7 @@
SDValue Reg = N0.getNode()->getOperand(0);
// Put the value in an ABCD register.
- TargetRegisterClass *TRC = 0;
+ const TargetRegisterClass *TRC;
switch (N0.getValueType().getSimpleVT().SimpleTy) {
case MVT::i64: TRC = &X86::GR64_ABCDRegClass; break;
case MVT::i32: TRC = &X86::GR32_ABCDRegClass; break;
Modified: llvm/trunk/utils/TableGen/RegisterInfoEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/RegisterInfoEmitter.cpp?rev=151138&r1=151137&r2=151138&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/RegisterInfoEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/RegisterInfoEmitter.cpp Wed Feb 22 01:28:11 2012
@@ -480,7 +480,7 @@
OS << " };\n";
// 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).
OS << " static const TargetRegisterClass * const " << Name
<< "RegisterClass = &" << Name << "RegClass;\n";
@@ -548,8 +548,9 @@
OS << "namespace " << RegisterClasses[0]->Namespace
<< " { // Register class instances\n";
for (unsigned i = 0, e = RegisterClasses.size(); i != e; ++i)
- OS << " " << RegisterClasses[i]->getName() << "Class\t"
- << RegisterClasses[i]->getName() << "RegClass;\n";
+ OS << " extern const " << RegisterClasses[i]->getName() << "Class "
+ << RegisterClasses[i]->getName() << "RegClass = "
+ << RegisterClasses[i]->getName() << "Class();\n";
std::map<unsigned, std::set<unsigned> > SuperRegClassMap;
More information about the llvm-commits
mailing list