WebAssembly: assert that there aren't any constant pools
authorJF Bastien <jfb@google.com>
Tue, 25 Aug 2015 23:19:49 +0000 (23:19 +0000)
committerJF Bastien <jfb@google.com>
Tue, 25 Aug 2015 23:19:49 +0000 (23:19 +0000)
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

index a81e35e..aa77341 100644 (file)
@@ -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 "<invalid>";
 }
 
+void WebAssemblyAsmPrinter::EmitConstantPool() {
+  assert(MF->getConstantPool()->getConstants().empty() &&
+         "WebAssembly disables constant pools");
+}
+
 void WebAssemblyAsmPrinter::EmitFunctionEntryLabel() {
   SmallString<128> Str;
   raw_svector_ostream OS(Str);