From 4fc4e42dea2547f40d3672ccf473fc2fbbdfc903 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Mon, 24 Oct 2016 19:49:43 +0000 Subject: [WebAssembly] Add an option to make get_local/set_local explicit. This patch adds a pass, controlled by an option and off by default for now, for making implicit get_local/set_local explicit. This simplifies emitting wasm with MC. Differential Revision: https://reviews.llvm.org/D25836 llvm-svn: 285009 --- llvm/lib/Target/WebAssembly/WebAssemblyUtilities.h | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 llvm/lib/Target/WebAssembly/WebAssemblyUtilities.h (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyUtilities.h') diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyUtilities.h b/llvm/lib/Target/WebAssembly/WebAssemblyUtilities.h new file mode 100644 index 00000000000..eb114403d14 --- /dev/null +++ b/llvm/lib/Target/WebAssembly/WebAssemblyUtilities.h @@ -0,0 +1,34 @@ +//===-- WebAssemblyUtilities - WebAssembly Utility Functions ---*- C++ -*-====// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +/// +/// \file +/// \brief This file contains the declaration of the WebAssembly-specific +/// utility functions. +/// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYUTILITIES_H +#define LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYUTILITIES_H + +namespace llvm { + +class MachineInstr; +class WebAssemblyFunctionInfo; + +namespace WebAssembly { + +bool isArgument(const MachineInstr &MI); +bool isCopy(const MachineInstr &MI); +bool isTee(const MachineInstr &MI); +bool isChild(const MachineInstr &MI, const WebAssemblyFunctionInfo &MFI); + +} // end namespace WebAssembly +} // end namespace llvm + +#endif -- cgit v1.2.3