Make <target>CodeEmitter::getBinaryCodeForInstr() a const method.
authorJim Grosbach <grosbach@apple.com>
Fri, 8 Oct 2010 00:21:28 +0000 (00:21 +0000)
committerJim Grosbach <grosbach@apple.com>
Fri, 8 Oct 2010 00:21:28 +0000 (00:21 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116018 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMCodeEmitter.cpp
lib/Target/ARM/ARMMCCodeEmitter.cpp
lib/Target/Alpha/AlphaCodeEmitter.cpp
lib/Target/PowerPC/PPCCodeEmitter.cpp
utils/TableGen/CodeEmitterGen.cpp

index b31ac5bad0eb710b52a75d1738c1a656df04805b..1525daadfb0b54961b4dea51a63b2952f6e02cf2 100644 (file)
@@ -74,7 +74,7 @@ namespace {
     /// getBinaryCodeForInstr - This function, generated by the
     /// CodeEmitterGenerator using TableGen, produces the binary encoding for
     /// machine instructions.
-    unsigned getBinaryCodeForInstr(const MachineInstr &MI);
+    unsigned getBinaryCodeForInstr(const MachineInstr &MI) const;
 
     bool runOnMachineFunction(MachineFunction &MF);
 
index 35319a473d984fff163ff0a9d897810dd75e229e..908f6f08b9ab63f41f9a58b7e55cddac56242cff 100644 (file)
@@ -40,7 +40,7 @@ public:
 
   // getBinaryCodeForInstr - TableGen'erated function for getting the
   // binary encoding for an instruction.
-  unsigned getBinaryCodeForInstr(const MCInst &MI);
+  unsigned getBinaryCodeForInstr(const MCInst &MI) const;
 
   /// getMachineOpValue - Return binary encoding of operand. If the machine
   /// operand requires relocation, record the relocation and return zero.
index 3aec07035d74c83254b8418bde60de2c6323fa4d..238a69005e9347c6db1032d17b0d10b08cc10e87 100644 (file)
@@ -41,12 +41,12 @@ namespace {
     /// CodeEmitterGenerator using TableGen, produces the binary encoding for
     /// machine instructions.
 
-    unsigned getBinaryCodeForInstr(const MachineInstr &MI);
+    unsigned getBinaryCodeForInstr(const MachineInstr &MI) const;
 
     /// getMachineOpValue - evaluates the MachineOperand of a given MachineInstr
 
     unsigned getMachineOpValue(const MachineInstr &MI,
-                               const MachineOperand &MO);
+                               const MachineOperand &MO) const;
     
     bool runOnMachineFunction(MachineFunction &MF);
     
@@ -143,7 +143,7 @@ static unsigned getAlphaRegNumber(unsigned Reg) {
 }
 
 unsigned AlphaCodeEmitter::getMachineOpValue(const MachineInstr &MI,
-                                             const MachineOperand &MO) {
+                                             const MachineOperand &MO) const {
 
   unsigned rv = 0; // Return value; defaults to 0 for unhandled cases
                    // or things that get fixed up later by the JIT.
index 0e0483d4539069c9733d8fc735be39c20a91946b..5298dda6bee076576da68bfb01c36552e058b9cd 100644 (file)
@@ -51,12 +51,12 @@ namespace {
     /// CodeEmitterGenerator using TableGen, produces the binary encoding for
     /// machine instructions.
 
-    unsigned getBinaryCodeForInstr(const MachineInstr &MI);
+    unsigned getBinaryCodeForInstr(const MachineInstr &MI) const;
 
     /// getMachineOpValue - evaluates the MachineOperand of a given MachineInstr
 
     unsigned getMachineOpValue(const MachineInstr &MI,
-                               const MachineOperand &MO);
+                               const MachineOperand &MO) const;
 
     const char *getPassName() const { return "PowerPC Machine Code Emitter"; }
 
@@ -125,7 +125,7 @@ void PPCCodeEmitter::emitBasicBlock(MachineBasicBlock &MBB) {
 }
 
 unsigned PPCCodeEmitter::getMachineOpValue(const MachineInstr &MI,
-                                           const MachineOperand &MO) {
+                                           const MachineOperand &MO) const {
 
   unsigned rv = 0; // Return value; defaults to 0 for unhandled cases
                    // or things that get fixed up later by the JIT.
index ac085120bf3dcaba640282d885eb9d664f6bd405..a039e0b1e35abe55bd16069cacc3921862a95ba2 100644 (file)
@@ -81,7 +81,7 @@ void CodeEmitterGen::run(raw_ostream &o) {
 
   // Emit function declaration
   o << "unsigned " << Target.getName() << "CodeEmitter::"
-    << "getBinaryCodeForInstr(const MachineInstr &MI) {\n";
+    << "getBinaryCodeForInstr(const MachineInstr &MI) const {\n";
 
   // Emit instruction base values
   o << "  static const unsigned InstBits[] = {\n";