LLVM 22.0.0git
|
#include "llvm/CodeGen/CFIFixup.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/PostOrderIterator.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/iterator_range.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/CodeGen/TargetFrameLowering.h"
#include "llvm/CodeGen/TargetInstrInfo.h"
#include "llvm/CodeGen/TargetSubtargetInfo.h"
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCDwarf.h"
#include "llvm/Target/TargetMachine.h"
#include <iterator>
Go to the source code of this file.
Classes | |
struct | BlockFlags |
struct | InsertionPoint |
Macros | |
#define | DEBUG_TYPE "cfi-fixup" |
Typedefs | |
using | BlockFlagsVector = SmallVector< BlockFlags, 32 > |
Functions | |
INITIALIZE_PASS (CFIFixup, "cfi-fixup", "Insert CFI remember/restore state instructions", false, false) FunctionPass *llvm | |
static bool | isPrologueCFIInstruction (const MachineInstr &MI) |
static bool | containsEpilogue (const MachineBasicBlock &MBB) |
static MachineBasicBlock * | findPrologueEnd (MachineFunction &MF, MachineBasicBlock::iterator &PrologueEnd) |
static BlockFlagsVector | computeBlockInfo (const MachineFunction &MF, const MachineBasicBlock *PrologueBlock) |
static InsertionPoint | insertRememberRestorePair (const InsertionPoint &RememberInsertPt, const InsertionPoint &RestoreInsertPt) |
static InsertionPoint | cloneCfiPrologue (const InsertionPoint &PrologueEnd, const InsertionPoint &DstInsertPt) |
static bool | fixupBlock (MachineBasicBlock &CurrBB, const BlockFlagsVector &BlockInfo, SmallDenseMap< MBBSectionID, InsertionPoint > &InsertionPts, const InsertionPoint &Prologue) |
#define DEBUG_TYPE "cfi-fixup" |
Definition at line 89 of file CFIFixup.cpp.
using BlockFlagsVector = SmallVector<BlockFlags, 32> |
Definition at line 140 of file CFIFixup.cpp.
|
static |
Definition at line 220 of file CFIFixup.cpp.
References llvm::MachineBasicBlock::begin(), llvm::MachineFunction::begin(), llvm::MachineFunction::CloneMachineInstr(), llvm::MachineBasicBlock::end(), End, llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::MachineBasicBlock::getParent(), llvm::MachineBasicBlock::insert(), isPrologueCFIInstruction(), InsertionPoint::Iterator, llvm::make_filter_range(), llvm::make_range(), llvm::map_range(), InsertionPoint::MBB, MBB, and MI.
Referenced by fixupBlock().
|
static |
Definition at line 145 of file CFIFixup.cpp.
References llvm::MachineFunction::begin(), containsEpilogue(), llvm::MachineBasicBlock::getNumber(), llvm::MachineFunction::getNumBlockIDs(), BlockFlags::HasFrameOnEntry, Info, MBB, BlockFlags::Reachable, BlockFlags::StrongNoFrameOnEntry, and llvm::MachineBasicBlock::successors().
Referenced by llvm::CFIFixup::runOnMachineFunction().
|
static |
Definition at line 102 of file CFIFixup.cpp.
References llvm::any_of(), llvm::MachineInstr::FrameDestroy, MBB, MI, and llvm::reverse().
Referenced by computeBlockInfo().
|
static |
Definition at line 110 of file CFIFixup.cpp.
References llvm::MachineBasicBlock::instrs(), isPrologueCFIInstruction(), MBB, MI, and llvm::reverse().
Referenced by llvm::CFIFixup::runOnMachineFunction().
|
static |
Definition at line 245 of file CFIFixup.cpp.
References assert(), llvm::MachineBasicBlock::begin(), cloneCfiPrologue(), llvm::TargetFrameLowering::enableFullCFIFixup(), llvm::TargetSubtargetInfo::getFrameLowering(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::MachineBasicBlock::getNumber(), llvm::MachineBasicBlock::getParent(), llvm::MachineBasicBlock::getSectionID(), llvm::MachineFunction::getSubtarget(), BlockFlags::HasFrameOnExit, Info, insertRememberRestorePair(), llvm::MachineBasicBlock::isBeginSection(), InsertionPoint::MBB, llvm::MachineBasicBlock::predecessors(), BlockFlags::Reachable, and llvm::TargetFrameLowering::resetCFIToInitialState().
Referenced by llvm::CFIFixup::runOnMachineFunction().
INITIALIZE_PASS | ( | CFIFixup | , |
"cfi-fixup" | , | ||
"Insert CFI remember/restore state instructions" | , | ||
false | , | ||
false | |||
) |
Definition at line 93 of file CFIFixup.cpp.
|
static |
Definition at line 195 of file CFIFixup.cpp.
References llvm::MachineInstrBuilder::addCFIIndex(), llvm::MachineFunction::addFrameInst(), llvm::BuildMI(), llvm::MCCFIInstruction::createRememberState(), llvm::MCCFIInstruction::createRestoreState(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::MachineBasicBlock::getParent(), llvm::MachineFunction::getSubtarget(), InsertionPoint::Iterator, InsertionPoint::MBB, and TII.
Referenced by fixupBlock().
|
static |
Definition at line 97 of file CFIFixup.cpp.
References llvm::MachineInstr::FrameSetup, and MI.
Referenced by cloneCfiPrologue(), and findPrologueEnd().