#include "CodeGenTarget.h"
#include "CodeGenInstruction.h"
#include "CodeGenRegisters.h"
#include "CodeGenSchedule.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/TableGen/Error.h"
#include "llvm/TableGen/Record.h"
#include <algorithm>
#include <iterator>
#include <tuple>
usingnamespacellvm;
cl::OptionCategory AsmParserCat("Options for -gen-asm-parser");
cl::OptionCategory AsmWriterCat("Options for -gen-asm-writer");
static cl::opt<unsigned>
AsmParserNum("asmparsernum", cl::init(0),
cl::desc("Make -gen-asm-parser emit assembly parser #N"),
cl::cat(AsmParserCat));
static cl::opt<unsigned>
AsmWriterNum("asmwriternum", cl::init(0),
cl::desc("Make -gen-asm-writer emit assembly writer #N"),
cl::cat(AsmWriterCat));
MVT::SimpleValueType llvm::getValueType(const Record *Rec) { … }
StringRef llvm::getName(MVT::SimpleValueType T) { … }
StringRef llvm::getEnumName(MVT::SimpleValueType T) { … }
std::string llvm::getQualifiedName(const Record *R) { … }
CodeGenTarget::CodeGenTarget(RecordKeeper &records)
: … { … }
CodeGenTarget::~CodeGenTarget() { … }
StringRef CodeGenTarget::getName() const { … }
StringRef CodeGenTarget::getInstNamespace() const { … }
StringRef CodeGenTarget::getRegNamespace() const { … }
Record *CodeGenTarget::getInstructionSet() const { … }
bool CodeGenTarget::getAllowRegisterRenaming() const { … }
Record *CodeGenTarget::getAsmParser() const { … }
Record *CodeGenTarget::getAsmParserVariant(unsigned i) const { … }
unsigned CodeGenTarget::getAsmParserVariantCount() const { … }
Record *CodeGenTarget::getAsmWriter() const { … }
CodeGenRegBank &CodeGenTarget::getRegBank() const { … }
std::optional<CodeGenRegisterClass *> CodeGenTarget::getSuperRegForSubReg(
const ValueTypeByHwMode &ValueTy, CodeGenRegBank &RegBank,
const CodeGenSubRegIndex *SubIdx, bool MustBeAllocatable) const { … }
void CodeGenTarget::ReadRegAltNameIndices() const { … }
const CodeGenRegister *CodeGenTarget::getRegisterByName(StringRef Name) const { … }
const CodeGenRegisterClass &CodeGenTarget::getRegisterClass(Record *R) const { … }
std::vector<ValueTypeByHwMode> CodeGenTarget::getRegisterVTs(Record *R) const { … }
void CodeGenTarget::ReadLegalValueTypes() const { … }
CodeGenSchedModels &CodeGenTarget::getSchedModels() const { … }
void CodeGenTarget::ReadInstructions() const { … }
static const CodeGenInstruction *GetInstByName(
const char *Name,
const DenseMap<const Record *, std::unique_ptr<CodeGenInstruction>> &Insts,
RecordKeeper &Records) { … }
static const char *FixedInstrs[] = …;
unsigned CodeGenTarget::getNumFixedInstructions() { … }
void CodeGenTarget::ComputeInstrsByEnum() const { … }
bool CodeGenTarget::isLittleEndianEncoding() const { … }
void CodeGenTarget::reverseBitsForLittleEndianEncoding() { … }
bool CodeGenTarget::guessInstructionProperties() const { … }
ComplexPattern::ComplexPattern(Record *R) { … }