blob: 0f045088d3ce0b506e95d15396fbec81a0d19a03 [file] [log] [blame]
Dan Gohman10e730a2015-06-29 23:51:55 +00001//===-- WebAssembly.h - Top-level interface for WebAssembly ----*- C++ -*-===//
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
Adrian Prantl5f8f34e42018-05-01 15:54:18 +000011/// This file contains the entry points for global functions defined in
Dan Gohman10e730a2015-06-29 23:51:55 +000012/// the LLVM WebAssembly back-end.
13///
14//===----------------------------------------------------------------------===//
15
16#ifndef LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLY_H
17#define LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLY_H
18
Derek Schufff41f67d2016-08-01 21:34:04 +000019#include "llvm/PassRegistry.h"
Dan Gohman10e730a2015-06-29 23:51:55 +000020#include "llvm/Support/CodeGen.h"
21
22namespace llvm {
23
24class WebAssemblyTargetMachine;
Derek Schufff41f67d2016-08-01 21:34:04 +000025class ModulePass;
Dan Gohman10e730a2015-06-29 23:51:55 +000026class FunctionPass;
27
Dan Gohman0cfb5f82016-05-10 04:24:02 +000028// LLVM IR passes.
Derek Schuffccdceda2016-08-18 15:27:25 +000029ModulePass *createWebAssemblyLowerEmscriptenEHSjLj(bool DoEH, bool DoSjLj);
Sam Cleggbafe6902017-12-15 00:17:10 +000030ModulePass *createWebAssemblyLowerGlobalDtors();
Dan Gohman1b637452017-01-07 00:34:54 +000031ModulePass *createWebAssemblyFixFunctionBitcasts();
Dan Gohman81719f82015-11-25 16:55:01 +000032FunctionPass *createWebAssemblyOptimizeReturned();
33
Dan Gohman0cfb5f82016-05-10 04:24:02 +000034// ISel and immediate followup passes.
Dan Gohman10e730a2015-06-29 23:51:55 +000035FunctionPass *createWebAssemblyISelDag(WebAssemblyTargetMachine &TM,
36 CodeGenOpt::Level OptLevel);
Dan Gohman1cf96c02015-12-09 16:23:59 +000037FunctionPass *createWebAssemblyArgumentMove();
Dan Gohmanbb372242016-01-26 03:39:31 +000038FunctionPass *createWebAssemblySetP2AlignOperands();
Dan Gohman10e730a2015-06-29 23:51:55 +000039
Dan Gohman0cfb5f82016-05-10 04:24:02 +000040// Late passes.
41FunctionPass *createWebAssemblyReplacePhysRegs();
42FunctionPass *createWebAssemblyPrepareForLiveIntervals();
43FunctionPass *createWebAssemblyOptimizeLiveIntervals();
Dan Gohman81719f82015-11-25 16:55:01 +000044FunctionPass *createWebAssemblyStoreResults();
Dan Gohman1462faa2015-11-16 16:18:28 +000045FunctionPass *createWebAssemblyRegStackify();
46FunctionPass *createWebAssemblyRegColoring();
Dan Gohman4fc4e422016-10-24 19:49:43 +000047FunctionPass *createWebAssemblyExplicitLocals();
Dan Gohmand7a2eea2016-03-09 02:01:14 +000048FunctionPass *createWebAssemblyFixIrreducibleControlFlow();
Heejin Ahn4934f762018-06-25 01:07:11 +000049FunctionPass *createWebAssemblyLateEHPrepare();
Dan Gohmanf52ee172017-02-27 22:38:58 +000050FunctionPass *createWebAssemblyCFGSort();
Dan Gohman950a13c2015-09-16 16:51:30 +000051FunctionPass *createWebAssemblyCFGStackify();
Dan Gohmanf0b165a2015-12-05 03:03:35 +000052FunctionPass *createWebAssemblyLowerBrUnless();
Dan Gohmancf4748f2015-11-12 17:04:33 +000053FunctionPass *createWebAssemblyRegNumbering();
Dan Gohman81719f82015-11-25 16:55:01 +000054FunctionPass *createWebAssemblyPeephole();
Derek Schuff6f697832016-10-21 16:38:07 +000055FunctionPass *createWebAssemblyCallIndirectFixup();
Dan Gohman950a13c2015-09-16 16:51:30 +000056
Jacob Gravelle40926452018-03-30 20:36:58 +000057// PassRegistry initialization declarations.
58void initializeWebAssemblyLowerEmscriptenEHSjLjPass(PassRegistry &);
59void initializeLowerGlobalDtorsPass(PassRegistry &);
60void initializeFixFunctionBitcastsPass(PassRegistry &);
61void initializeOptimizeReturnedPass(PassRegistry &);
62void initializeWebAssemblyArgumentMovePass(PassRegistry &);
63void initializeWebAssemblySetP2AlignOperandsPass(PassRegistry &);
64void initializeWebAssemblyReplacePhysRegsPass(PassRegistry &);
65void initializeWebAssemblyPrepareForLiveIntervalsPass(PassRegistry &);
66void initializeWebAssemblyOptimizeLiveIntervalsPass(PassRegistry &);
67void initializeWebAssemblyStoreResultsPass(PassRegistry &);
68void initializeWebAssemblyRegStackifyPass(PassRegistry &);
69void initializeWebAssemblyRegColoringPass(PassRegistry &);
70void initializeWebAssemblyExplicitLocalsPass(PassRegistry &);
71void initializeWebAssemblyFixIrreducibleControlFlowPass(PassRegistry &);
Heejin Ahn4934f762018-06-25 01:07:11 +000072void initializeWebAssemblyLateEHPreparePass(PassRegistry &);
Heejin Ahn04c48942018-06-25 01:20:21 +000073void initializeWebAssemblyExceptionInfoPass(PassRegistry &);
Jacob Gravelle40926452018-03-30 20:36:58 +000074void initializeWebAssemblyCFGSortPass(PassRegistry &);
75void initializeWebAssemblyCFGStackifyPass(PassRegistry &);
76void initializeWebAssemblyLowerBrUnlessPass(PassRegistry &);
77void initializeWebAssemblyRegNumberingPass(PassRegistry &);
78void initializeWebAssemblyPeepholePass(PassRegistry &);
79void initializeWebAssemblyCallIndirectFixupPass(PassRegistry &);
80
Dan Gohman10e730a2015-06-29 23:51:55 +000081} // end namespace llvm
82
83#endif