//=== WebAssemblyLowerRefTypesIntPtrConv.cpp - // Lower IntToPtr and PtrToInt on Reference Types ---===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// /// /// \file /// Lowers IntToPtr and PtrToInt instructions on reference types to /// Trap instructions since they have been allowed to operate /// on non-integral pointers. /// //===----------------------------------------------------------------------===// #include "Utils/WebAssemblyTypeUtilities.h" #include "WebAssembly.h" #include "WebAssemblySubtarget.h" #include "llvm/IR/InstIterator.h" #include "llvm/Pass.h" #include <set> usingnamespacellvm; #define DEBUG_TYPE … namespace { class WebAssemblyLowerRefTypesIntPtrConv final : public FunctionPass { … }; } // end anonymous namespace char WebAssemblyLowerRefTypesIntPtrConv::ID = …; INITIALIZE_PASS(…) FunctionPass *llvm::createWebAssemblyLowerRefTypesIntPtrConv() { … } bool WebAssemblyLowerRefTypesIntPtrConv::runOnFunction(Function &F) { … }