#include "llvm/CodeGen/ShadowStackGCLowering.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Analysis/DomTreeUpdater.h"
#include "llvm/CodeGen/GCMetadata.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/Constant.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/GlobalValue.h"
#include "llvm/IR/GlobalVariable.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Type.h"
#include "llvm/IR/Value.h"
#include "llvm/InitializePasses.h"
#include "llvm/Pass.h"
#include "llvm/Support/Casting.h"
#include "llvm/Transforms/Utils/EscapeEnumerator.h"
#include <cassert>
#include <optional>
#include <string>
#include <utility>
#include <vector>
usingnamespacellvm;
#define DEBUG_TYPE …
namespace {
class ShadowStackGCLoweringImpl { … };
class ShadowStackGCLowering : public FunctionPass { … };
}
PreservedAnalyses ShadowStackGCLoweringPass::run(Module &M,
ModuleAnalysisManager &MAM) { … }
char ShadowStackGCLowering::ID = …;
char &llvm::ShadowStackGCLoweringID = …;
INITIALIZE_PASS_BEGIN(ShadowStackGCLowering, DEBUG_TYPE,
"Shadow Stack GC Lowering", false, false)
INITIALIZE_PASS_DEPENDENCY(GCModuleInfo)
INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass)
INITIALIZE_PASS_END(ShadowStackGCLowering, DEBUG_TYPE,
"Shadow Stack GC Lowering", false, false)
FunctionPass *llvm::createShadowStackGCLoweringPass() { … }
ShadowStackGCLowering::ShadowStackGCLowering() : … { … }
Constant *ShadowStackGCLoweringImpl::GetFrameMap(Function &F) { … }
Type *ShadowStackGCLoweringImpl::GetConcreteStackEntryType(Function &F) { … }
bool ShadowStackGCLoweringImpl::doInitialization(Module &M) { … }
bool ShadowStackGCLoweringImpl::IsNullValue(Value *V) { … }
void ShadowStackGCLoweringImpl::CollectRoots(Function &F) { … }
GetElementPtrInst *
ShadowStackGCLoweringImpl::CreateGEP(LLVMContext &Context, IRBuilder<> &B,
Type *Ty, Value *BasePtr, int Idx,
int Idx2, const char *Name) { … }
GetElementPtrInst *ShadowStackGCLoweringImpl::CreateGEP(LLVMContext &Context,
IRBuilder<> &B,
Type *Ty,
Value *BasePtr, int Idx,
const char *Name) { … }
bool ShadowStackGCLoweringImpl::runOnFunction(Function &F,
DomTreeUpdater *DTU) { … }