LLVM API Documentation
#include <StackProtector.h>
Public Types | |
enum | SSPLayoutKind { SSPLK_None, SSPLK_LargeArray, SSPLK_SmallArray, SSPLK_AddrOf } |
typedef ValueMap< const AllocaInst *, SSPLayoutKind > | SSPLayoutMap |
A mapping of AllocaInsts to their required SSP layout. | |
Public Member Functions | |
StackProtector () | |
StackProtector (const TargetMachine *TM) | |
void | getAnalysisUsage (AnalysisUsage &AU) const override |
SSPLayoutKind | getSSPLayout (const AllocaInst *AI) const |
void | adjustForColoring (const AllocaInst *From, const AllocaInst *To) |
bool | runOnFunction (Function &Fn) override |
Static Public Attributes | |
static char | ID = 0 |
Definition at line 32 of file StackProtector.h.
A mapping of AllocaInsts to their required SSP layout.
Definition at line 48 of file StackProtector.h.
SSPLayoutKind. Stack Smashing Protection (SSP) rules require that vulnerable stack allocations are located close the stack protector.
Definition at line 36 of file StackProtector.h.
llvm::StackProtector::StackProtector | ( | ) | [inline] |
Definition at line 108 of file StackProtector.h.
References llvm::PassRegistry::getPassRegistry(), and llvm::initializeStackProtectorPass().
llvm::StackProtector::StackProtector | ( | const TargetMachine * | TM | ) | [inline] |
Definition at line 112 of file StackProtector.h.
References llvm::PassRegistry::getPassRegistry(), and llvm::initializeStackProtectorPass().
void StackProtector::adjustForColoring | ( | const AllocaInst * | From, |
const AllocaInst * | To | ||
) |
Definition at line 62 of file StackProtector.cpp.
References llvm::ValueMap< KeyT, ValueT, Config >::end(), llvm::ValueMap< KeyT, ValueT, Config >::erase(), llvm::ValueMap< KeyT, ValueT, Config >::find(), I, llvm::ValueMap< KeyT, ValueT, Config >::insert(), llvm::ValueMapIterator< DenseMapT, KeyT >::ValueTypeProxy::second, SSPLK_AddrOf, and SSPLK_LargeArray.
void llvm::StackProtector::getAnalysisUsage | ( | AnalysisUsage & | ) | const [inline, override, virtual] |
getAnalysisUsage - This function should be overriden by passes that need analysis information to do their job. If a pass specifies that it uses a particular analysis result to this function, it can then use the getAnalysis<AnalysisType>() function, below.
Reimplemented from llvm::Pass.
Definition at line 118 of file StackProtector.h.
References llvm::AnalysisUsage::addPreserved().
Definition at line 58 of file StackProtector.cpp.
References llvm::ValueMap< KeyT, ValueT, Config >::lookup(), and SSPLK_None.
bool StackProtector::runOnFunction | ( | Function & | F | ) | [override, virtual] |
runOnFunction - Virtual method overriden by subclasses to do the per-function processing of the pass.
Implements llvm::FunctionPass.
Definition at line 83 of file StackProtector.cpp.
References llvm::AttributeSet::FunctionIndex, llvm::StringRef::getAsInteger(), llvm::AttributeSet::getAttribute(), llvm::Function::getAttributes(), llvm::DominatorTreeWrapperPass::getDomTree(), llvm::GlobalValue::getParent(), llvm::TargetMachine::getSubtargetImpl(), llvm::TargetSubtargetInfo::getTargetLowering(), llvm::Attribute::getValueAsString(), and llvm::Attribute::isStringAttribute().
char StackProtector::ID = 0 [static] |
Definition at line 107 of file StackProtector.h.