#include "llvm/MC/MCExpr.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/MC/MCAsmBackend.h"
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCAssembler.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCObjectWriter.h"
#include "llvm/MC/MCSymbol.h"
#include "llvm/MC/MCValue.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
#include <cassert>
#include <cstdint>
usingnamespacellvm;
#define DEBUG_TYPE …
namespace {
stats
}
void MCExpr::print(raw_ostream &OS, const MCAsmInfo *MAI, bool InParens) const { … }
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
LLVM_DUMP_METHOD void MCExpr::dump() const {
dbgs() << *this;
dbgs() << '\n';
}
#endif
const MCBinaryExpr *MCBinaryExpr::create(Opcode Opc, const MCExpr *LHS,
const MCExpr *RHS, MCContext &Ctx,
SMLoc Loc) { … }
const MCUnaryExpr *MCUnaryExpr::create(Opcode Opc, const MCExpr *Expr,
MCContext &Ctx, SMLoc Loc) { … }
const MCConstantExpr *MCConstantExpr::create(int64_t Value, MCContext &Ctx,
bool PrintInHex,
unsigned SizeInBytes) { … }
MCSymbolRefExpr::MCSymbolRefExpr(const MCSymbol *Symbol, VariantKind Kind,
const MCAsmInfo *MAI, SMLoc Loc)
: … { … }
const MCSymbolRefExpr *MCSymbolRefExpr::create(const MCSymbol *Sym,
VariantKind Kind,
MCContext &Ctx, SMLoc Loc) { … }
const MCSymbolRefExpr *MCSymbolRefExpr::create(StringRef Name, VariantKind Kind,
MCContext &Ctx) { … }
StringRef MCSymbolRefExpr::getVariantKindName(VariantKind Kind) { … }
MCSymbolRefExpr::VariantKind
MCSymbolRefExpr::getVariantKindForName(StringRef Name) { … }
void MCTargetExpr::anchor() { … }
bool MCExpr::evaluateAsAbsolute(int64_t &Res) const { … }
bool MCExpr::evaluateAsAbsolute(int64_t &Res, const MCAssembler &Asm,
const SectionAddrMap &Addrs) const { … }
bool MCExpr::evaluateAsAbsolute(int64_t &Res, const MCAssembler &Asm) const { … }
bool MCExpr::evaluateAsAbsolute(int64_t &Res, const MCAssembler *Asm) const { … }
bool MCExpr::evaluateKnownAbsolute(int64_t &Res, const MCAssembler &Asm) const { … }
bool MCExpr::evaluateAsAbsolute(int64_t &Res, const MCAssembler *Asm,
const SectionAddrMap *Addrs, bool InSet) const { … }
static void AttemptToFoldSymbolOffsetDifference(
const MCAssembler *Asm, const SectionAddrMap *Addrs, bool InSet,
const MCSymbolRefExpr *&A, const MCSymbolRefExpr *&B, int64_t &Addend) { … }
static bool evaluateSymbolicAdd(const MCAssembler *Asm,
const SectionAddrMap *Addrs, bool InSet,
const MCValue &LHS, const MCValue &RHS,
MCValue &Res) { … }
bool MCExpr::evaluateAsRelocatable(MCValue &Res, const MCAssembler *Asm,
const MCFixup *Fixup) const { … }
bool MCExpr::evaluateAsValue(MCValue &Res, const MCAssembler &Asm) const { … }
static bool canExpand(const MCSymbol &Sym, bool InSet) { … }
bool MCExpr::evaluateAsRelocatableImpl(MCValue &Res, const MCAssembler *Asm,
const MCFixup *Fixup,
const SectionAddrMap *Addrs,
bool InSet) const { … }
MCFragment *MCExpr::findAssociatedFragment() const { … }