#include "MCTargetDesc/SparcMCExpr.h"
#include "MCTargetDesc/SparcMCTargetDesc.h"
#include "TargetInfo/SparcTargetInfo.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/MC/MCAsmMacro.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCExpr.h"
#include "llvm/MC/MCInst.h"
#include "llvm/MC/MCInstBuilder.h"
#include "llvm/MC/MCInstrInfo.h"
#include "llvm/MC/MCObjectFileInfo.h"
#include "llvm/MC/MCParser/MCAsmLexer.h"
#include "llvm/MC/MCParser/MCAsmParser.h"
#include "llvm/MC/MCParser/MCParsedAsmOperand.h"
#include "llvm/MC/MCParser/MCTargetAsmParser.h"
#include "llvm/MC/MCRegisterInfo.h"
#include "llvm/MC/MCStreamer.h"
#include "llvm/MC/MCSubtargetInfo.h"
#include "llvm/MC/MCSymbol.h"
#include "llvm/MC/TargetRegistry.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/SMLoc.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/TargetParser/Triple.h"
#include <algorithm>
#include <cassert>
#include <cstdint>
#include <memory>
usingnamespacellvm;
namespace llvm {
namespace Sparc {
usingnamespaceSP;
}
}
namespace {
class SparcOperand;
class SparcAsmParser : public MCTargetAsmParser { … };
}
static const MCPhysReg IntRegs[32] = …;
static const MCPhysReg DoubleRegs[32] = …;
static const MCPhysReg QuadFPRegs[32] = …;
static const MCPhysReg IntPairRegs[] = …;
static const MCPhysReg CoprocPairRegs[] = …;
namespace {
class SparcOperand : public MCParsedAsmOperand { … };
}
#define GET_MATCHER_IMPLEMENTATION
#define GET_REGISTER_MATCHER
#define GET_MNEMONIC_SPELL_CHECKER
#include "SparcGenAsmMatcher.inc"
SparcAsmParser::MatchResultTy
SparcAsmParser::mnemonicIsValid(StringRef Mnemonic, unsigned VariantID) { … }
bool SparcAsmParser::expandSET(MCInst &Inst, SMLoc IDLoc,
SmallVectorImpl<MCInst> &Instructions) { … }
bool SparcAsmParser::expandSETX(MCInst &Inst, SMLoc IDLoc,
SmallVectorImpl<MCInst> &Instructions) { … }
bool SparcAsmParser::matchAndEmitInstruction(SMLoc IDLoc, unsigned &Opcode,
OperandVector &Operands,
MCStreamer &Out,
uint64_t &ErrorInfo,
bool MatchingInlineAsm) { … }
bool SparcAsmParser::parseRegister(MCRegister &Reg, SMLoc &StartLoc,
SMLoc &EndLoc) { … }
ParseStatus SparcAsmParser::tryParseRegister(MCRegister &Reg, SMLoc &StartLoc,
SMLoc &EndLoc) { … }
bool SparcAsmParser::parseInstruction(ParseInstructionInfo &Info,
StringRef Name, SMLoc NameLoc,
OperandVector &Operands) { … }
ParseStatus SparcAsmParser::parseDirective(AsmToken DirectiveID) { … }
ParseStatus SparcAsmParser::parseMEMOperand(OperandVector &Operands) { … }
template <unsigned N>
ParseStatus SparcAsmParser::parseShiftAmtImm(OperandVector &Operands) { … }
template <SparcAsmParser::TailRelocKind Kind>
ParseStatus SparcAsmParser::parseTailRelocSym(OperandVector &Operands) { … }
ParseStatus SparcAsmParser::parseMembarTag(OperandVector &Operands) { … }
ParseStatus SparcAsmParser::parseASITag(OperandVector &Operands) { … }
ParseStatus SparcAsmParser::parsePrefetchTag(OperandVector &Operands) { … }
ParseStatus SparcAsmParser::parseCallTarget(OperandVector &Operands) { … }
ParseStatus SparcAsmParser::parseOperand(OperandVector &Operands,
StringRef Mnemonic) { … }
ParseStatus
SparcAsmParser::parseSparcAsmOperand(std::unique_ptr<SparcOperand> &Op,
bool isCall) { … }
ParseStatus SparcAsmParser::parseBranchModifiers(OperandVector &Operands) { … }
ParseStatus SparcAsmParser::parseExpression(int64_t &Val) { … }
MCRegister SparcAsmParser::matchRegisterName(const AsmToken &Tok,
unsigned &RegKind) { … }
static bool hasGOTReference(const MCExpr *Expr) { … }
const SparcMCExpr *
SparcAsmParser::adjustPICRelocation(SparcMCExpr::VariantKind VK,
const MCExpr *subExpr) { … }
bool SparcAsmParser::matchSparcAsmModifiers(const MCExpr *&EVal,
SMLoc &EndLoc) { … }
bool SparcAsmParser::isPossibleExpression(const AsmToken &Token) { … }
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeSparcAsmParser() { … }
unsigned SparcAsmParser::validateTargetOperandClass(MCParsedAsmOperand &GOp,
unsigned Kind) { … }