forked from jeremyhu/llvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WebAssembly] Initial WebAssembly backend
This WebAssembly backend is just a skeleton at this time and is not yet functional. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241022 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information
Dan Gohman
committed
Jun 29, 2015
1 parent
ff67629
commit a743413
Showing
56 changed files
with
1,913 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,6 +65,10 @@ N: Hal Finkel | |
E: [email protected] | ||
D: BBVectorize, the loop reroller, alias analysis and the PowerPC target | ||
|
||
N: Dan Gohman | ||
E: [email protected] | ||
D: WebAssembly Backend (lib/Target/WebAssembly/*) | ||
|
||
N: Renato Golin | ||
E: [email protected] | ||
D: ARM Linux support | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -152,8 +152,9 @@ E: [email protected] | |
D: Author of llvmc2 | ||
|
||
N: Dan Gohman | ||
E: dan433584@gmail.com | ||
E: sunfish@mozilla.com | ||
D: Miscellaneous bug fixes | ||
D: WebAssembly Backend | ||
|
||
N: David Goodwin | ||
E: [email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,7 @@ subdirectories = | |
PowerPC | ||
Sparc | ||
SystemZ | ||
WebAssembly | ||
X86 | ||
XCore | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
set(LLVM_TARGET_DEFINITIONS WebAssembly.td) | ||
|
||
tablegen(LLVM WebAssemblyGenMCCodeEmitter.inc -gen-emitter) | ||
tablegen(LLVM WebAssemblyGenSubtargetInfo.inc -gen-subtarget) | ||
add_public_tablegen_target(WebAssemblyCommonTableGen) | ||
|
||
add_llvm_target(WebAssemblyCodeGen | ||
WebAssemblyFrameLowering.cpp | ||
WebAssemblyInstrInfo.cpp | ||
WebAssemblyISelDAGToDAG.cpp | ||
WebAssemblyISelLowering.cpp | ||
WebAssemblyMachineFunctionInfo.cpp | ||
WebAssemblyRegisterInfo.cpp | ||
WebAssemblySelectionDAGInfo.cpp | ||
WebAssemblySubtarget.cpp | ||
WebAssemblyTargetMachine.cpp | ||
WebAssemblyTargetTransformInfo.cpp | ||
) | ||
|
||
add_dependencies(LLVMWebAssemblyCodeGen intrinsics_gen) | ||
|
||
add_subdirectory(InstPrinter) | ||
add_subdirectory(TargetInfo) | ||
add_subdirectory(MCTargetDesc) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
add_llvm_library(LLVMWebAssemblyAsmPrinter | ||
WebAssemblyInstPrinter.cpp | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
;===- ./lib/Target/WebAssembly/InstPrinter/LLVMBuild.txt -------*- Conf -*--===; | ||
; | ||
; The LLVM Compiler Infrastructure | ||
; | ||
; This file is distributed under the University of Illinois Open Source | ||
; License. See LICENSE.TXT for details. | ||
; | ||
;===------------------------------------------------------------------------===; | ||
; | ||
; This is an LLVMBuild description file for the components in this subdirectory. | ||
; | ||
; For more information on the LLVMBuild system, please see: | ||
; | ||
; http://llvm.org/docs/LLVMBuild.html | ||
; | ||
;===------------------------------------------------------------------------===; | ||
|
||
[component_0] | ||
type = Library | ||
name = WebAssemblyAsmPrinter | ||
parent = WebAssembly | ||
required_libraries = MC Support | ||
add_to_library_groups = WebAssembly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
##===- lib/Target/WebAssembly/AsmPrinter/Makefile ----------*- Makefile -*-===## | ||
# | ||
# The LLVM Compiler Infrastructure | ||
# | ||
# This file is distributed under the University of Illinois Open Source | ||
# License. See LICENSE.TXT for details. | ||
# | ||
##===----------------------------------------------------------------------===## | ||
|
||
LEVEL = ../../../.. | ||
LIBRARYNAME = LLVMWebAssemblyAsmPrinter | ||
|
||
# Hack: we need to include 'main' wasm target directory to grab private headers | ||
CPP.Flags += -I$(PROJ_OBJ_DIR)/.. -I$(PROJ_SRC_DIR)/.. | ||
|
||
include $(LEVEL)/Makefile.common |
43 changes: 43 additions & 0 deletions
43
lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
//=- WebAssemblyInstPrinter.cpp - WebAssembly assembly instruction printing -=// | ||
// | ||
// The LLVM Compiler Infrastructure | ||
// | ||
// This file is distributed under the University of Illinois Open Source | ||
// License. See LICENSE.TXT for details. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
/// | ||
/// \file | ||
/// \brief Print MCInst instructions to wasm format. | ||
/// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#include "InstPrinter/WebAssemblyInstPrinter.h" | ||
#include "WebAssembly.h" | ||
#include "llvm/MC/MCExpr.h" | ||
#include "llvm/MC/MCInst.h" | ||
#include "llvm/MC/MCInstrInfo.h" | ||
#include "llvm/MC/MCSubtargetInfo.h" | ||
#include "llvm/MC/MCSymbol.h" | ||
#include "llvm/Support/ErrorHandling.h" | ||
#include "llvm/Support/FormattedStream.h" | ||
#include <cctype> | ||
using namespace llvm; | ||
|
||
#define DEBUG_TYPE "asm-printer" | ||
|
||
WebAssemblyInstPrinter::WebAssemblyInstPrinter(const MCAsmInfo &MAI, | ||
const MCInstrInfo &MII, | ||
const MCRegisterInfo &MRI) | ||
: MCInstPrinter(MAI, MII, MRI) {} | ||
|
||
void WebAssemblyInstPrinter::printRegName(raw_ostream &OS, | ||
unsigned RegNo) const { | ||
llvm_unreachable("TODO: implement printRegName"); | ||
} | ||
|
||
void WebAssemblyInstPrinter::printInst(const MCInst *MI, raw_ostream &OS, | ||
StringRef Annot, | ||
const MCSubtargetInfo &STI) { | ||
llvm_unreachable("TODO: implement printInst"); | ||
} |
Oops, something went wrong.