[llvm-commits] [llvm] r118098 - /llvm/trunk/lib/Target/ARM/ARMMCCodeEmitter.cpp

Bill Wendling isanbard at gmail.com
Tue Nov 2 15:44:12 PDT 2010


Author: void
Date: Tue Nov  2 17:44:12 2010
New Revision: 118098

URL: http://llvm.org/viewvc/llvm-project?rev=118098&view=rev
Log:
Simplify the EncodeInstruction method now that a lot of the special case stuff
is handled with the MC encoder.

Modified:
    llvm/trunk/lib/Target/ARM/ARMMCCodeEmitter.cpp

Modified: llvm/trunk/lib/Target/ARM/ARMMCCodeEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMMCCodeEmitter.cpp?rev=118098&r1=118097&r2=118098&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMMCCodeEmitter.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMMCCodeEmitter.cpp Tue Nov  2 17:44:12 2010
@@ -323,22 +323,15 @@
 void ARMMCCodeEmitter::
 EncodeInstruction(const MCInst &MI, raw_ostream &OS,
                   SmallVectorImpl<MCFixup> &Fixups) const {
-  unsigned Opcode = MI.getOpcode();
-  const TargetInstrDesc &Desc = TII.get(Opcode);
-  uint64_t TSFlags = Desc.TSFlags;
-  // Keep track of the current byte being emitted.
-  unsigned CurByte = 0;
-
   // Pseudo instructions don't get encoded.
-  if ((TSFlags & ARMII::FormMask) == ARMII::Pseudo)
+  const TargetInstrDesc &Desc = TII.get(MI.getOpcode());
+  if ((Desc.TSFlags & ARMII::FormMask) == ARMII::Pseudo)
     return;
 
-  ++MCNumEmitted;  // Keep track of the # of mi's emitted
-  unsigned Value = getBinaryCodeForInstr(MI);
-  switch (Opcode) {
-  default: break;
-  }
-  EmitConstant(Value, 4, CurByte, OS);
+  // Keep track of the current byte being emitted.
+  unsigned CurByte = 0;
+  EmitConstant(getBinaryCodeForInstr(MI), 4, CurByte, OS);
+  ++MCNumEmitted;  // Keep track of the # of mi's emitted.
 }
 
 // FIXME: These #defines shouldn't be necessary. Instead, tblgen should





More information about the llvm-commits mailing list