From: JF Bastien Date: Tue, 25 Aug 2015 23:19:49 +0000 (+0000) Subject: WebAssembly: assert that there aren't any constant pools X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=c3a33b1b54d66b5c6db12d93fc556f025bc69971;p=oota-llvm.git WebAssembly: assert that there aren't any constant pools WebAssembly will either use globals or immediates, since it's a virtual ISA. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245989 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp b/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp index a81e35ea4da..aa7734118a6 100644 --- a/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp +++ b/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp @@ -23,6 +23,7 @@ #include "llvm/ADT/SmallString.h" #include "llvm/CodeGen/AsmPrinter.h" +#include "llvm/CodeGen/MachineConstantPool.h" #include "llvm/CodeGen/MachineInstr.h" #include "llvm/IR/DataLayout.h" #include "llvm/IR/DebugInfo.h" @@ -67,6 +68,7 @@ private: // AsmPrinter Implementation. //===------------------------------------------------------------------===// + void EmitConstantPool() override; void EmitFunctionEntryLabel() override; void EmitFunctionBodyStart() override; void EmitFunctionBodyEnd() override; @@ -108,6 +110,11 @@ static const char *toType(const Type *Ty) { return ""; } +void WebAssemblyAsmPrinter::EmitConstantPool() { + assert(MF->getConstantPool()->getConstants().empty() && + "WebAssembly disables constant pools"); +} + void WebAssemblyAsmPrinter::EmitFunctionEntryLabel() { SmallString<128> Str; raw_svector_ostream OS(Str);