#include "Basic/SequenceToOffsetTable.h"
#include "Common/AsmWriterInst.h"
#include "Common/CodeGenInstAlias.h"
#include "Common/CodeGenInstruction.h"
#include "Common/CodeGenRegisters.h"
#include "Common/CodeGenTarget.h"
#include "Common/Types.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/FormatVariadic.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/TableGen/Error.h"
#include "llvm/TableGen/Record.h"
#include "llvm/TableGen/TableGenBackend.h"
#include <algorithm>
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <deque>
#include <iterator>
#include <map>
#include <set>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
usingnamespacellvm;
#define DEBUG_TYPE …
namespace {
class AsmWriterEmitter { … };
}
static void
PrintCases(std::vector<std::pair<std::string, AsmWriterOperand>> &OpsToPrint,
raw_ostream &O, bool PassSubtarget) { … }
static void EmitInstructions(std::vector<AsmWriterInst> &Insts, raw_ostream &O,
bool PassSubtarget) { … }
void AsmWriterEmitter::FindUniqueOperandCommands(
std::vector<std::string> &UniqueOperandCommands,
std::vector<std::vector<unsigned>> &InstIdxs,
std::vector<unsigned> &InstOpsUsed, bool PassSubtarget) const { … }
static void UnescapeString(std::string &Str) { … }
static void UnescapeAliasString(std::string &Str) { … }
void AsmWriterEmitter::EmitGetMnemonic(
raw_ostream &O,
std::vector<std::vector<std::string>> &TableDrivenOperandPrinters,
unsigned &BitsLeft, unsigned &AsmStrBits) { … }
void AsmWriterEmitter::EmitPrintInstruction(
raw_ostream &O,
std::vector<std::vector<std::string>> &TableDrivenOperandPrinters,
unsigned &BitsLeft, unsigned &AsmStrBits) { … }
static void
emitRegisterNameString(raw_ostream &O, StringRef AltName,
const std::deque<CodeGenRegister> &Registers) { … }
void AsmWriterEmitter::EmitGetRegisterName(raw_ostream &O) { … }
namespace {
class IAPrinter { … };
}
static unsigned CountNumOperands(StringRef AsmString, unsigned Variant) { … }
namespace {
struct AliasPriorityComparator { … };
}
void AsmWriterEmitter::EmitPrintAliasInstruction(raw_ostream &O) { … }
AsmWriterEmitter::AsmWriterEmitter(const RecordKeeper &R)
: … { … }
void AsmWriterEmitter::run(raw_ostream &O) { … }
static TableGen::Emitter::OptClass<AsmWriterEmitter>
X("gen-asm-writer", "Generate assembly writer");