//===------------ RISCVLandingPadSetup.cpp ---------------------------------==// // // 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 // //===----------------------------------------------------------------------===// // // This is a RISC-V pass to setup landing pad labels for indirect jumps. // Currently this pass only supports fixed labels. // //===----------------------------------------------------------------------===// #include "RISCV.h" #include "RISCVInstrInfo.h" #include "RISCVSubtarget.h" #include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/InitializePasses.h" usingnamespacellvm; #define DEBUG_TYPE … #define PASS_NAME … extern cl::opt<uint32_t> PreferredLandingPadLabel; namespace { class RISCVLandingPadSetup : public MachineFunctionPass { … }; } // end anonymous namespace bool RISCVLandingPadSetup::runOnMachineFunction(MachineFunction &MF) { … } INITIALIZE_PASS(…) char RISCVLandingPadSetup::ID = …; FunctionPass *llvm::createRISCVLandingPadSetupPass() { … }