//===-- ARM/ARMCodeEmitter.cpp - Convert ARM code to machine code ---------===////// The LLVM Compiler Infrastructure//// This file is distributed under the University of Illinois Open Source// License. See LICENSE.TXT for details.////===----------------------------------------------------------------------===////// This file contains the pass that transforms the ARM machine instructions into// relocatable machine code.////===----------------------------------------------------------------------===//#define DEBUG_TYPE "jit"#include"ARM.h"#include"ARMAddressingModes.h"#include"ARMConstantPoolValue.h"#include"ARMInstrInfo.h"#include"ARMRelocations.h"#include"ARMSubtarget.h"#include"ARMTargetMachine.h"#include"llvm/Constants.h"#include"llvm/DerivedTypes.h"#include"llvm/Function.h"#include"llvm/PassManager.h"#include"llvm/CodeGen/MachineCodeEmitter.h"#include"llvm/CodeGen/JITCodeEmitter.h"#include"llvm/CodeGen/ObjectCodeEmitter.h"#include"llvm/CodeGen/MachineConstantPool.h"#include"llvm/CodeGen/MachineFunctionPass.h"#include"llvm/CodeGen/MachineInstr.h"#include"llvm/CodeGen/MachineJumpTableInfo.h"#include"llvm/CodeGen/Passes.h"#include"llvm/ADT/Statistic.h"#include"llvm/Support/Compiler.h"#include"llvm/Support/Debug.h"#include"llvm/Support/ErrorHandling.h"#include"llvm/Support/raw_ostream.h"#ifndef NDEBUG#include<iomanip>#endifusingnamespacellvm;STATISTIC(NumEmitted,"Number of machine instructions emitted");namespace{classARMCodeEmitter{public:/// getBinaryCodeForInstr - This function, generated by the/// CodeEmitterGenerator using TableGen, produces the binary encoding for/// machine instructions.unsignedgetBinaryCodeForInstr(constMachineInstr&MI);};template<classCodeEmitter>classVISIBILITY_HIDDENEmitter:publicMachineFunctionPass,publicARMCodeEmitter{ARMJITInfo*JTI;constARMInstrInfo*II;constTargetData*TD;TargetMachine&TM;CodeEmitter&MCE;conststd::vector<MachineConstantPoolEntry>*MCPEs;conststd::vector<MachineJumpTableEntry>*MJTEs;