LLVM API Documentation

Defines | Typedefs | Functions | Variables
PrologEpilogInserter.cpp File Reference
#include "PrologEpilogInserter.h"
#include "llvm/ADT/IndexedMap.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/CodeGen/MachineDominators.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineLoopInfo.h"
#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/RegisterScavenging.h"
#include "llvm/CodeGen/StackProtector.h"
#include "llvm/IR/DiagnosticInfo.h"
#include "llvm/IR/InlineAsm.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetFrameLowering.h"
#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetRegisterInfo.h"
#include "llvm/Target/TargetSubtargetInfo.h"
#include <climits>
Include dependency graph for PrologEpilogInserter.cpp:

Go to the source code of this file.

Defines

#define DEBUG_TYPE   "pei"

Typedefs

typedef SmallSetVector< int, 8 > StackObjSet
 StackObjSet - A set of stack object indexes.

Functions

 INITIALIZE_PASS_BEGIN (PEI,"prologepilog","Prologue/Epilogue Insertion", false, false) INITIALIZE_PASS_END(PEI
Prologue Epilogue Insertion
&Frame false 
STATISTIC (NumScavengedRegs,"Number of frame index regs scavenged")
 STATISTIC (NumBytesStackSpace,"Number of bytes used for stack in all functions")
static void AdjustStackOffset (MachineFrameInfo *MFI, int FrameIdx, bool StackGrowsDown, int64_t &Offset, unsigned &MaxAlign)
 AdjustStackOffset - Helper function used to adjust the stack frame offset.
static void AssignProtectedObjSet (const StackObjSet &UnassignedObjs, SmallSet< int, 16 > &ProtectedObjs, MachineFrameInfo *MFI, bool StackGrowsDown, int64_t &Offset, unsigned &MaxAlign)

Variables

static cl::opt< unsignedWarnStackSize ("warn-stack-size", cl::Hidden, cl::init((unsigned)-1), cl::desc("Warn for stack size bigger than the given"" number"))
 prologepilog
Prologue Epilogue Insertion &Frame Finalization
Prologue Epilogue Insertion &Frame false

Define Documentation

#define DEBUG_TYPE   "pei"

Definition at line 49 of file PrologEpilogInserter.cpp.


Typedef Documentation

StackObjSet - A set of stack object indexes.

Definition at line 107 of file PrologEpilogInserter.cpp.


Function Documentation

static void AdjustStackOffset ( MachineFrameInfo MFI,
int  FrameIdx,
bool  StackGrowsDown,
int64_t &  Offset,
unsigned MaxAlign 
) [inline, static]

AdjustStackOffset - Helper function used to adjust the stack frame offset.

Definition at line 403 of file PrologEpilogInserter.cpp.

References llvm::dbgs(), DEBUG, llvm::MachineFrameInfo::getObjectAlignment(), llvm::MachineFrameInfo::getObjectSize(), and llvm::MachineFrameInfo::setObjectOffset().

Referenced by AssignProtectedObjSet().

void LocalStackSlotPass::AssignProtectedObjSet ( const StackObjSet UnassignedObjs,
SmallSet< int, 16 > &  ProtectedObjs,
MachineFrameInfo MFI,
bool  StackGrowsDown,
int64_t &  Offset,
unsigned MaxAlign 
) [static]

AssignProtectedObjSet - Helper function to assign large stack objects (i.e., those required to be close to the Stack Protector) to stack offsets.

Definition at line 432 of file PrologEpilogInserter.cpp.

References AdjustStackOffset(), llvm::SetVector< T, Vector, Set >::begin(), llvm::SetVector< T, Vector, Set >::end(), I, and llvm::SmallSet< T, N, C >::insert().

INITIALIZE_PASS_BEGIN ( PEI  ,
"prologepilog"  ,
"Prologue/Epilogue Insertion"  ,
false  ,
false   
)
Prologue Epilogue Insertion& Frame false STATISTIC ( NumScavengedRegs  ,
"Number of frame index regs scavenged"   
)
STATISTIC ( NumBytesStackSpace  ,
"Number of bytes used for stack in all functions  
)

Variable Documentation

Prologue Epilogue Insertion& Frame false

Definition at line 65 of file PrologEpilogInserter.cpp.

Prologue Epilogue Insertion& Frame Finalization

Definition at line 65 of file PrologEpilogInserter.cpp.

Definition at line 65 of file PrologEpilogInserter.cpp.

cl::opt<unsigned> WarnStackSize("warn-stack-size", cl::Hidden, cl::init((unsigned)-1), cl::desc("Warn for stack size bigger than the given"" number")) [static]