#include "WebAssemblyAsmPrinter.h"
#include "MCTargetDesc/WebAssemblyMCTargetDesc.h"
#include "MCTargetDesc/WebAssemblyTargetStreamer.h"
#include "TargetInfo/WebAssemblyTargetInfo.h"
#include "Utils/WebAssemblyTypeUtilities.h"
#include "WebAssembly.h"
#include "WebAssemblyMCInstLower.h"
#include "WebAssemblyMachineFunctionInfo.h"
#include "WebAssemblyRegisterInfo.h"
#include "WebAssemblyRuntimeLibcallSignatures.h"
#include "WebAssemblyTargetMachine.h"
#include "WebAssemblyUtilities.h"
#include "llvm/ADT/MapVector.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/BinaryFormat/Wasm.h"
#include "llvm/CodeGen/Analysis.h"
#include "llvm/CodeGen/AsmPrinter.h"
#include "llvm/CodeGen/MachineConstantPool.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineModuleInfoImpls.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/DebugInfoMetadata.h"
#include "llvm/IR/GlobalVariable.h"
#include "llvm/IR/Metadata.h"
#include "llvm/IR/Module.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCSectionWasm.h"
#include "llvm/MC/MCStreamer.h"
#include "llvm/MC/MCSymbol.h"
#include "llvm/MC/MCSymbolWasm.h"
#include "llvm/MC/TargetRegistry.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
usingnamespacellvm;
#define DEBUG_TYPE …
extern cl::opt<bool> WasmKeepRegisters;
MVT WebAssemblyAsmPrinter::getRegType(unsigned RegNo) const { … }
std::string WebAssemblyAsmPrinter::regToString(const MachineOperand &MO) { … }
WebAssemblyTargetStreamer *WebAssemblyAsmPrinter::getTargetStreamer() { … }
static bool isEmscriptenInvokeName(StringRef Name) { … }
static char getInvokeSig(wasm::ValType VT) { … }
static std::string getEmscriptenInvokeSymbolName(wasm::WasmSignature *Sig) { … }
MCSymbolWasm *WebAssemblyAsmPrinter::getMCSymbolForFunction(
const Function *F, bool EnableEmEH, wasm::WasmSignature *Sig,
bool &InvokeDetected) { … }
void WebAssemblyAsmPrinter::emitGlobalVariable(const GlobalVariable *GV) { … }
MCSymbol *WebAssemblyAsmPrinter::getOrCreateWasmSymbol(StringRef Name) { … }
void WebAssemblyAsmPrinter::emitSymbolType(const MCSymbolWasm *Sym) { … }
void WebAssemblyAsmPrinter::emitDecls(const Module &M) { … }
void WebAssemblyAsmPrinter::emitEndOfAsmFile(Module &M) { … }
void WebAssemblyAsmPrinter::EmitProducerInfo(Module &M) { … }
void WebAssemblyAsmPrinter::EmitTargetFeatures(Module &M) { … }
void WebAssemblyAsmPrinter::EmitFunctionAttributes(Module &M) { … }
void WebAssemblyAsmPrinter::emitConstantPool() { … }
void WebAssemblyAsmPrinter::emitJumpTableInfo() { … }
void WebAssemblyAsmPrinter::emitFunctionBodyStart() { … }
void WebAssemblyAsmPrinter::emitInstruction(const MachineInstr *MI) { … }
bool WebAssemblyAsmPrinter::PrintAsmOperand(const MachineInstr *MI,
unsigned OpNo,
const char *ExtraCode,
raw_ostream &OS) { … }
bool WebAssemblyAsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI,
unsigned OpNo,
const char *ExtraCode,
raw_ostream &OS) { … }
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeWebAssemblyAsmPrinter() { … }