From c3a33b1b54d66b5c6db12d93fc556f025bc69971 Mon Sep 17 00:00:00 2001 From: JF Bastien Date: Tue, 25 Aug 2015 23:19:49 +0000 Subject: [PATCH] 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 --- lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp | 7 +++++++ 1 file changed, 7 insertions(+) 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); -- 2.11.0