LLVM
8.0.1
|
#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/Transforms/Utils/Local.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/Support/raw_ostream.h"
#include "llvm/Transforms/IPO.h"
#include <algorithm>
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, CallGraph &CG) |
static void | DeleteBasicBlock (BasicBlock *BB, CallGraph &CG) |
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 (CallGraphSCC &SCC, CallGraph &CG) |
Variables | |
prune | eh |
#define DEBUG_TYPE "prune-eh" |
Definition at line 34 of file PruneEH.cpp.
|
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 231 of file PruneEH.cpp.
References assert(), llvm::BasicBlock::begin(), Callee, llvm::changeToUnreachable(), E, llvm::BasicBlock::end(), llvm::BasicBlock::eraseFromParent(), llvm::UndefValue::get(), llvm::Function::getIntrinsicID(), llvm::ilist_node_with_parent< NodeTy, ParentTy, Options >::getNextNode(), llvm::BasicBlock::getParent(), I, llvm::Function::isIntrinsic(), llvm::Intrinsic::isLeaf(), llvm::Instruction::isTerminator(), llvm::pred_empty(), llvm::CallGraphNode::removeCallEdgeFor(), llvm::succ_begin(), and llvm::succ_end().
Referenced by SimplifyFunction().
INITIALIZE_PASS_BEGIN | ( | PruneEH | , |
"prune-eh" | , | ||
"Remove unused exception handling info" | , | ||
false | , | ||
false | |||
) |
|
static |
Definition at line 63 of file PruneEH.cpp.
References llvm::Function::addFnAttr(), Callee, llvm::SmallPtrSetImpl< PtrType >::count(), llvm::Function::doesNotReturn(), llvm::Function::doesNotThrow(), E, F(), llvm::GlobalValue::hasExactDefinition(), llvm::Function::hasFnAttribute(), I, llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::Instruction::mayThrow(), llvm::Attribute::Naked, llvm::Attribute::NoInline, llvm::Attribute::NoReturn, llvm::Attribute::NoUnwind, and SimplifyFunction().
Definition at line 189 of file PruneEH.cpp.
References llvm::Function::begin(), llvm::canSimplifyInvokeNoUnwind(), DeleteBasicBlock(), E, llvm::Function::end(), I, llvm::pred_empty(), and llvm::removeUnwindEdge().
Referenced by runImpl().
STATISTIC | ( | NumRemoved | , |
"Number of invokes removed" | |||
) |
STATISTIC | ( | NumUnreach | , |
"Number of noreturn calls optimized" | |||
) |
prune eh |
Definition at line 58 of file PruneEH.cpp.