summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
diff options
context:
space:
mode:
authorDan Gohman <dan433584@gmail.com>2015-09-16 16:51:30 +0000
committerDan Gohman <dan433584@gmail.com>2015-09-16 16:51:30 +0000
commit950a13cfa371503281f91eecdaac6286aca274f7 (patch)
tree577bee2ca86d87c3386463e8f163bbeb30885c46 /llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
parentb02a320f5e141339b16348107f33a2bd5f40ad4d (diff)
downloadbcm5719-llvm-950a13cfa371503281f91eecdaac6286aca274f7.tar.gz
bcm5719-llvm-950a13cfa371503281f91eecdaac6286aca274f7.zip
[WebAssembly] Check in an initial CFG Stackifier pass
This pass implements a simple algorithm for conversion from CFG to wasm's structured control flow. It doesn't yet handle multiple-entry loops; that will be added in a future patch. It also adds initial support for switch statements. Differential Revision: http://reviews.llvm.org/D12735 llvm-svn: 247818
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp')
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
index fca3890de60..94ea1085ff4 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
@@ -73,6 +73,7 @@ private:
void EmitGlobalVariable(const GlobalVariable *GV) override;
+ void EmitJumpTableInfo() override;
void EmitConstantPool() override;
void EmitFunctionEntryLabel() override;
void EmitFunctionBodyStart() override;
@@ -213,6 +214,10 @@ void WebAssemblyAsmPrinter::EmitConstantPool() {
"WebAssembly disables constant pools");
}
+void WebAssemblyAsmPrinter::EmitJumpTableInfo() {
+ // Nothing to do; jump tables are incorporated into the instruction stream.
+}
+
void WebAssemblyAsmPrinter::EmitFunctionEntryLabel() {
SmallString<128> Str;
raw_svector_ostream OS(Str);
@@ -293,6 +298,9 @@ void WebAssemblyAsmPrinter::EmitInstruction(const MachineInstr *MI) {
case MachineOperand::MO_GlobalAddress: {
OS << ' ' << toSymbol(MO.getGlobal()->getName());
} break;
+ case MachineOperand::MO_MachineBasicBlock: {
+ OS << ' ' << toSymbol(MO.getMBB()->getSymbol()->getName());
+ } break;
}
OS << ')';
}
OpenPOWER on IntegriCloud