#include "MCTargetDesc/X86BaseInfo.h"
#include "MCTargetDesc/X86EncodingOptimization.h"
#include "MCTargetDesc/X86MCTargetDesc.h"
#include "X86MCSymbolizer.h"
#include "bolt/Core/MCPlus.h"
#include "bolt/Core/MCPlusBuilder.h"
#include "llvm/BinaryFormat/ELF.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCFixupKindInfo.h"
#include "llvm/MC/MCInst.h"
#include "llvm/MC/MCInstBuilder.h"
#include "llvm/MC/MCInstrInfo.h"
#include "llvm/MC/MCRegister.h"
#include "llvm/MC/MCRegisterInfo.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/DataExtractor.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Errc.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/ErrorOr.h"
#include <set>
#define DEBUG_TYPE …
usingnamespacellvm;
usingnamespacebolt;
namespace opts {
extern cl::OptionCategory BoltOptCategory;
static cl::opt<bool> X86StripRedundantAddressSize(
"x86-strip-redundant-address-size",
cl::desc("Remove redundant Address-Size override prefix"), cl::init(true),
cl::cat(BoltOptCategory));
}
namespace {
bool isMOVSX64rm32(const MCInst &Inst) { … }
bool isADD64rr(const MCInst &Inst) { … }
bool isADDri(const MCInst &Inst) { … }
static InstructionListType createIncMemory(const MCSymbol *Target,
MCContext *Ctx) { … }
#define GET_INSTRINFO_OPERAND_TYPES_ENUM
#define GET_INSTRINFO_OPERAND_TYPE
#define GET_INSTRINFO_MEM_OPERAND_SIZE
#include "X86GenInstrInfo.inc"
class X86MCPlusBuilder : public MCPlusBuilder { … };
}
namespace llvm {
namespace bolt {
MCPlusBuilder *createX86MCPlusBuilder(const MCInstrAnalysis *Analysis,
const MCInstrInfo *Info,
const MCRegisterInfo *RegInfo,
const MCSubtargetInfo *STI) { … }
}
}