7 #ifndef RETDEC_LLVMIR2HLL_LLVM_LLVM_SUPPORT_H
8 #define RETDEC_LLVMIR2HLL_LLVM_LLVM_SUPPORT_H
40 static bool isPredecessorOf(llvm::BasicBlock *pred, llvm::BasicBlock *bb);
41 static bool isInlineAsm(
const llvm::Instruction *i);
43 static const llvm::AllocaInst *
isDirectAlloca(
const llvm::Value *v);
Supportive functions regarding LLVM IR.
Definition: llvm_support.h:37
static bool isPredecessorOf(llvm::BasicBlock *pred, llvm::BasicBlock *bb)
Returns true if pred is a predecessor of bb, false otherwise.
Definition: llvm_support.cpp:57
static bool isBasicBlockLabel(const std::string &str)
Returns true if str has the format of a basic block's label in LLVM IR, false otherwise.
Definition: llvm_support.cpp:293
static bool endWithSameUncondBranch(llvm::BasicBlock *bb1, llvm::BasicBlock *bb2)
Returns true if both bb1 and bb2 end with an unconditional branch to the same basic block,...
Definition: llvm_support.cpp:241
static const llvm::Module * getModuleFromValue(const llvm::Value *v)
Returns the LLVM module corresponding to the given value v.
Definition: llvm_support.cpp:259
static std::size_t getNumberOfUniquePredecessors(llvm::BasicBlock *bb)
Returns the number of unique predecessors of the given basic block.
Definition: llvm_support.cpp:40
std::set< llvm::BasicBlock * > BasicBlockSet
Set of basic blocks.
Definition: llvm_support.h:61
static std::string getBasicBlockLabelPrefix()
Returns the used prefix of labels in LLVM IR.
Definition: llvm_support.cpp:285
static bool isInlinableInst(const llvm::Instruction *i)
Returns true if the given LLVM instruction i is inlinable, false otherwise.
Definition: llvm_support.cpp:96
static const llvm::AllocaInst * isDirectAlloca(const llvm::Value *v)
If v is a direct alloca, it returns v converted into an alloca instruction. Otherwise,...
Definition: llvm_support.cpp:168
static Address getInstAddress(const llvm::Instruction *i)
Get instruction's ASM address from metadata.
Definition: llvm_support.cpp:308
static bool endsWithRetOrUnreachImpl(llvm::BasicBlock *bb, bool indirect)
Implementation of endsWithRetOrUnreach().
Definition: llvm_support.cpp:210
static BasicBlockSet endsWithRetOrUnreachBBSet
Definition: llvm_support.h:70
static bool isInlineAsm(const llvm::Instruction *i)
Returns true if the given LLVM instruction i is a call to an inline asm chunk, false otherwise.
Definition: llvm_support.cpp:76
LLVMSupport & operator=(const LLVMSupport &)=delete
static bool endsWithRetOrUnreach(llvm::BasicBlock *bb, bool indirect=true)
Returns true if bb (indirectly) ends with a return or an unreachable instruction, false otherwise.
Definition: llvm_support.cpp:193
LLVMSupport(const LLVMSupport &)=delete
Definition: itanium_ast_ctypes_parser.h:12
A library providing API for working with back-end IR.
Definition: archive_wrapper.h:19
Aliases for several useful types.