LLVM  13.0.0git
Macros | Functions | Variables
PruneEH.cpp File Reference
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/CallGraph.h"
#include "llvm/Analysis/CallGraphSCCPass.h"
#include "llvm/Analysis/EHPersonalities.h"
#include "llvm/IR/CFG.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/InlineAsm.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/InitializePasses.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/IPO.h"
#include "llvm/Transforms/Utils/CallGraphUpdater.h"
#include "llvm/Transforms/Utils/Local.h"
#include <algorithm>
Include dependency graph for PruneEH.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "prune-eh"
 

Functions

 STATISTIC (NumRemoved, "Number of invokes removed")
 
 STATISTIC (NumUnreach, "Number of noreturn calls optimized")
 
static bool SimplifyFunction (Function *F, CallGraphUpdater &CGU)
 
static void DeleteBasicBlock (BasicBlock *BB, CallGraphUpdater &CGU)
 DeleteBasicBlock - remove the specified basic block from the program, updating the callgraph to reflect any now-obsolete edges due to calls that exist in the BB. More...
 
 INITIALIZE_PASS_BEGIN (PruneEH, "prune-eh", "Remove unused exception handling info", false, false) INITIALIZE_PASS_END(PruneEH
 
static bool runImpl (CallGraphUpdater &CGU, SetVector< Function * > &Functions)
 

Variables

prune eh
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "prune-eh"

Definition at line 37 of file PruneEH.cpp.

Function Documentation

◆ DeleteBasicBlock()

static void DeleteBasicBlock ( BasicBlock BB,
CallGraphUpdater CGU 
)
static

DeleteBasicBlock - remove the specified basic block from the program, updating the callgraph to reflect any now-obsolete edges due to calls that exist in the BB.

Definition at line 227 of file PruneEH.cpp.

References assert(), BB, Callee, llvm::changeToUnreachable(), llvm::numbers::e, E, llvm::UndefValue::get(), llvm::ilist_node_with_parent< NodeTy, ParentTy, Options >::getNextNode(), i, I, llvm::Intrinsic::isLeaf(), llvm::Instruction::isTerminator(), llvm::pred_empty(), llvm::CallGraphUpdater::removeCallSite(), llvm::succ_begin(), and llvm::succ_end().

Referenced by SimplifyFunction().

◆ INITIALIZE_PASS_BEGIN()

INITIALIZE_PASS_BEGIN ( PruneEH  ,
"prune-eh ,
"Remove unused exception handling info ,
false  ,
false   
)

◆ runImpl()

static bool runImpl ( CallGraphUpdater CGU,
SetVector< Function * > &  Functions 
)
static

Definition at line 65 of file PruneEH.cpp.

References assert(), BB, Callee, F, I, llvm::Instruction::mayThrow(), and SimplifyFunction().

◆ SimplifyFunction()

static bool SimplifyFunction ( Function F,
CallGraphUpdater CGU 
)
static

◆ STATISTIC() [1/2]

STATISTIC ( NumRemoved  ,
"Number of invokes removed  
)

◆ STATISTIC() [2/2]

STATISTIC ( NumUnreach  ,
"Number of noreturn calls optimized"   
)

Variable Documentation

◆ eh

prune eh

Definition at line 60 of file PruneEH.cpp.