blob: 305f406bbffc5eef5fe9c6acfc34b9ba8afe272e [file] [log] [blame]
Dan Gohman4fc4e422016-10-24 19:49:43 +00001//===-- WebAssemblyUtilities - WebAssembly Utility Functions ---*- 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 declaration of the WebAssembly-specific
Dan Gohman4fc4e422016-10-24 19:49:43 +000012/// utility functions.
13///
14//===----------------------------------------------------------------------===//
15
16#ifndef LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYUTILITIES_H
17#define LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYUTILITIES_H
18
19namespace llvm {
20
Dan Gohmanf52ee172017-02-27 22:38:58 +000021class MachineBasicBlock;
Dan Gohman4fc4e422016-10-24 19:49:43 +000022class MachineInstr;
Dan Gohmanf52ee172017-02-27 22:38:58 +000023class MachineLoop;
Dan Gohman4fc4e422016-10-24 19:49:43 +000024class WebAssemblyFunctionInfo;
25
26namespace WebAssembly {
27
28bool isArgument(const MachineInstr &MI);
29bool isCopy(const MachineInstr &MI);
30bool isTee(const MachineInstr &MI);
31bool isChild(const MachineInstr &MI, const WebAssemblyFunctionInfo &MFI);
Dan Gohmand934cb82017-02-24 23:18:00 +000032bool isCallIndirect(const MachineInstr &MI);
Dan Gohman4fc4e422016-10-24 19:49:43 +000033
34} // end namespace WebAssembly
Dan Gohmanf52ee172017-02-27 22:38:58 +000035
36/// Return the "bottom" block of a loop. This differs from
37/// MachineLoop::getBottomBlock in that it works even if the loop is
38/// discontiguous.
39MachineBasicBlock *LoopBottom(const MachineLoop *Loop);
40
Dan Gohman4fc4e422016-10-24 19:49:43 +000041} // end namespace llvm
42
43#endif