summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
diff options
context:
space:
mode:
authorDerek Schuff <dschuff@google.com>2016-06-02 23:02:44 +0000
committerDerek Schuff <dschuff@google.com>2016-06-02 23:02:44 +0000
commitf5bae9c1cec4d81a289aedf5afa0c2e68b82aab7 (patch)
tree09bb3231be38ab71d1ef20ca43e7720394586a9c /llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
parentdf24d5b8c8533950a4a7028d44193bff0aa3d69e (diff)
downloadbcm5719-llvm-f5bae9c1cec4d81a289aedf5afa0c2e68b82aab7.tar.gz
bcm5719-llvm-f5bae9c1cec4d81a289aedf5afa0c2e68b82aab7.zip
Revert "[WebAssembly] Emit type signatures for declared functions"
This reverts r271599, it broke the integration tests. More places than I expected had nontrival return types in imports, or else the check was wrong. llvm-svn: 271606
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp')
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp41
1 files changed, 10 insertions, 31 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
index 45e43f62811..64128bf031e 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
@@ -67,7 +67,6 @@ private:
// AsmPrinter Implementation.
//===------------------------------------------------------------------===//
- void EmitEndOfAsmFile(Module &M) override;
void EmitJumpTableInfo() override;
void EmitConstantPool() override;
void EmitFunctionBodyStart() override;
@@ -125,6 +124,16 @@ WebAssemblyTargetStreamer *WebAssemblyAsmPrinter::getTargetStreamer() {
//===----------------------------------------------------------------------===//
// WebAssemblyAsmPrinter Implementation.
//===----------------------------------------------------------------------===//
+
+void WebAssemblyAsmPrinter::EmitConstantPool() {
+ assert(MF->getConstantPool()->getConstants().empty() &&
+ "WebAssembly disables constant pools");
+}
+
+void WebAssemblyAsmPrinter::EmitJumpTableInfo() {
+ // Nothing to do; jump tables are incorporated into the instruction stream.
+}
+
static void ComputeLegalValueVTs(const Function &F, const TargetMachine &TM,
Type *Ty, SmallVectorImpl<MVT> &ValueVTs) {
const DataLayout &DL(F.getParent()->getDataLayout());
@@ -141,36 +150,6 @@ static void ComputeLegalValueVTs(const Function &F, const TargetMachine &TM,
}
}
-void WebAssemblyAsmPrinter::EmitEndOfAsmFile(Module &M) {
- for (const auto &F : M) {
- // Emit function type info for all undefined functions
- if (F.isDeclarationForLinker() && !F.isIntrinsic()) {
- SmallVector<MVT, 4> SignatureVTs;
- ComputeLegalValueVTs(F, TM, F.getReturnType(), SignatureVTs);
- if (SignatureVTs.size() > 1) {
- report_fatal_error(
- "Import functions with nontrival return types are not supported");
- }
- size_t NumResults = SignatureVTs.size();
- for (auto &Arg : F.args()) {
- ComputeLegalValueVTs(F, TM, Arg.getType(), SignatureVTs);
- }
-
- getTargetStreamer()->emitIndirectFunctionType(F.getName(), SignatureVTs,
- NumResults);
- }
- }
-}
-
-void WebAssemblyAsmPrinter::EmitConstantPool() {
- assert(MF->getConstantPool()->getConstants().empty() &&
- "WebAssembly disables constant pools");
-}
-
-void WebAssemblyAsmPrinter::EmitJumpTableInfo() {
- // Nothing to do; jump tables are incorporated into the instruction stream.
-}
-
void WebAssemblyAsmPrinter::EmitFunctionBodyStart() {
if (!MFI->getParams().empty())
getTargetStreamer()->emitParam(MFI->getParams());
OpenPOWER on IntegriCloud