[WebAssembly] Initial WebAssembly backend
[oota-llvm.git] / lib / Target / WebAssembly / WebAssemblyISelLowering.cpp
1 //=- WebAssemblyISelLowering.cpp - WebAssembly DAG Lowering Implementation -==//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 ///
10 /// \file
11 /// \brief This file implements the WebAssemblyTargetLowering class.
12 ///
13 //===----------------------------------------------------------------------===//
14
15 #include "WebAssemblyISelLowering.h"
16 #include "MCTargetDesc/WebAssemblyMCTargetDesc.h"
17 #include "WebAssemblyMachineFunctionInfo.h"
18 #include "WebAssemblySubtarget.h"
19 #include "WebAssemblyTargetMachine.h"
20 #include "WebAssemblyTargetObjectFile.h"
21 #include "llvm/CodeGen/Analysis.h"
22 #include "llvm/CodeGen/MachineRegisterInfo.h"
23 #include "llvm/CodeGen/SelectionDAG.h"
24 #include "llvm/IR/Function.h"
25 #include "llvm/IR/Intrinsics.h"
26 #include "llvm/Support/CommandLine.h"
27 #include "llvm/Support/Debug.h"
28 #include "llvm/Support/ErrorHandling.h"
29 #include "llvm/Support/raw_ostream.h"
30 #include "llvm/Target/TargetOptions.h"
31 using namespace llvm;
32
33 #define DEBUG_TYPE "wasm-lower"
34
35 WebAssemblyTargetLowering::WebAssemblyTargetLowering(
36     const TargetMachine &TM, const WebAssemblySubtarget &STI)
37     : TargetLowering(TM), Subtarget(&STI) {}
38
39 //===----------------------------------------------------------------------===//
40 // WebAssembly Lowering private implementation.
41 //===----------------------------------------------------------------------===//
42
43 //===----------------------------------------------------------------------===//
44 // Lowering Code
45 //===----------------------------------------------------------------------===//
46
47 //===----------------------------------------------------------------------===//
48 //  Other Lowering Code
49 //===----------------------------------------------------------------------===//
50
51 //===----------------------------------------------------------------------===//
52 //                          WebAssembly Optimization Hooks
53 //===----------------------------------------------------------------------===//
54
55 MCSection *WebAssemblyTargetObjectFile::SelectSectionForGlobal(
56     const GlobalValue *GV, SectionKind Kind, Mangler &Mang,
57     const TargetMachine &TM) const {
58   return getDataSection();
59 }