Reapply 116059, this time without the fatfingered pasto at the top.

''const'ify getMachineOpValue() and associated helpers.'

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116067 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/ARM/ARMMCCodeEmitter.cpp b/lib/Target/ARM/ARMMCCodeEmitter.cpp
index 5ccc8f5..1f45eb9 100644
--- a/lib/Target/ARM/ARMMCCodeEmitter.cpp
+++ b/lib/Target/ARM/ARMMCCodeEmitter.cpp
@@ -44,8 +44,8 @@
 
   /// getMachineOpValue - Return binary encoding of operand. If the machine
   /// operand requires relocation, record the relocation and return zero.
-  unsigned getMachineOpValue(const MCInst &MI,const MCOperand &MO);
-  unsigned getMachineOpValue(const MCInst &MI, unsigned OpIdx) {
+  unsigned getMachineOpValue(const MCInst &MI,const MCOperand &MO) const;
+  unsigned getMachineOpValue(const MCInst &MI, unsigned OpIdx) const {
     return getMachineOpValue(MI, MI.getOperand(OpIdx));
   }
 
@@ -120,17 +120,13 @@
     return;
 
   ++MCNumEmitted;  // Keep track of the # of mi's emitted
-  switch (TSFlags & ARMII::FormMask) {
-  case ARMII::BrMiscFrm:
-  case ARMII::MiscFrm: {
+  switch (Opcode) {
+  //FIXME: Any non-pseudos that need special handling, if there are any...
+  default: {
     unsigned Value = getBinaryCodeForInstr(MI);
     EmitConstant(Value, 4, CurByte, OS);
     break;
   }
-  default: {
-    llvm_unreachable("Unhandled instruction encoding format!");
-    break;
-  }
   }
 }