summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
diff options
context:
space:
mode:
authorJF Bastien <jfb@google.com>2015-08-25 23:19:49 +0000
committerJF Bastien <jfb@google.com>2015-08-25 23:19:49 +0000
commit54be3b1f03dde06f0c4e97ca5f82e44e6b530823 (patch)
tree809c502b4ce2733bd7fff4328c7409435f9eadee /llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
parentf2aa5e7d19840997ef40fd890dfbaf2d0877661d (diff)
downloadbcm5719-llvm-54be3b1f03dde06f0c4e97ca5f82e44e6b530823.tar.gz
bcm5719-llvm-54be3b1f03dde06f0c4e97ca5f82e44e6b530823.zip
WebAssembly: assert that there aren't any constant pools
WebAssembly will either use globals or immediates, since it's a virtual ISA. llvm-svn: 245989
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp')
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
index a81e35ea4da..aa7734118a6 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
+++ b/llvm/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 "<invalid>";
}
+void WebAssemblyAsmPrinter::EmitConstantPool() {
+ assert(MF->getConstantPool()->getConstants().empty() &&
+ "WebAssembly disables constant pools");
+}
+
void WebAssemblyAsmPrinter::EmitFunctionEntryLabel() {
SmallString<128> Str;
raw_svector_ostream OS(Str);
OpenPOWER on IntegriCloud