//===- llvm/CodeGen/GlobalISel/IRTranslator.h - IRTranslator ----*- C++ -*-===// // // 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 /// This file declares the IRTranslator pass. /// This pass is responsible for translating LLVM IR into MachineInstr. /// It uses target hooks to lower the ABI but aside from that, the pass /// generated code is generic. This is the default translator used for /// GlobalISel. /// /// \todo Replace the comments with actual doxygen comments. //===----------------------------------------------------------------------===// #ifndef LLVM_CODEGEN_GLOBALISEL_IRTRANSLATOR_H #define LLVM_CODEGEN_GLOBALISEL_IRTRANSLATOR_H #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/SmallVector.h" #include "llvm/CodeGen/CodeGenCommonISel.h" #include "llvm/CodeGen/FunctionLoweringInfo.h" #include "llvm/CodeGen/GlobalISel/MachineIRBuilder.h" #include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/CodeGen/SwiftErrorValueTracking.h" #include "llvm/CodeGen/SwitchLoweringUtils.h" #include "llvm/Support/Allocator.h" #include "llvm/Support/CodeGen.h" #include <memory> #include <utility> namespace llvm { class AllocaInst; class AssumptionCache; class BasicBlock; class CallInst; class CallLowering; class Constant; class ConstrainedFPIntrinsic; class DataLayout; class DbgDeclareInst; class DbgValueInst; class Instruction; class MachineBasicBlock; class MachineFunction; class MachineInstr; class MachineRegisterInfo; class OptimizationRemarkEmitter; class PHINode; class TargetLibraryInfo; class TargetPassConfig; class User; class Value; // Technically the pass should run on an hypothetical MachineModule, // since it should translate Global into some sort of MachineGlobal. // The MachineGlobal should ultimately just be a transfer of ownership of // the interesting bits that are relevant to represent a global value. // That being said, we could investigate what would it cost to just duplicate // the information from the LLVM IR. // The idea is that ultimately we would be able to free up the memory used // by the LLVM IR as soon as the translation is over. class IRTranslator : public MachineFunctionPass { … }; } // end namespace llvm #endif // LLVM_CODEGEN_GLOBALISEL_IRTRANSLATOR_H