#include "llvm/Transforms/Utils/MemoryTaggingSupport.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Analysis/CFG.h"
#include "llvm/Analysis/PostDominators.h"
#include "llvm/Analysis/StackSafetyAnalysis.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/BinaryFormat/Dwarf.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/TargetParser/Triple.h"
#include "llvm/Transforms/Utils/PromoteMemToReg.h"
namespace llvm {
namespace memtag {
namespace {
bool maybeReachableFromEachOther(const SmallVectorImpl<IntrinsicInst *> &Insts,
const DominatorTree *DT, const LoopInfo *LI,
size_t MaxLifetimes) { … }
}
bool forAllReachableExits(const DominatorTree &DT, const PostDominatorTree &PDT,
const LoopInfo &LI, const Instruction *Start,
const SmallVectorImpl<IntrinsicInst *> &Ends,
const SmallVectorImpl<Instruction *> &RetVec,
llvm::function_ref<void(Instruction *)> Callback) { … }
bool isStandardLifetime(const SmallVectorImpl<IntrinsicInst *> &LifetimeStart,
const SmallVectorImpl<IntrinsicInst *> &LifetimeEnd,
const DominatorTree *DT, const LoopInfo *LI,
size_t MaxLifetimes) { … }
Instruction *getUntagLocationIfFunctionExit(Instruction &Inst) { … }
void StackInfoBuilder::visit(OptimizationRemarkEmitter &ORE,
Instruction &Inst) { … }
AllocaInterestingness
StackInfoBuilder::getAllocaInterestingness(const AllocaInst &AI) { … }
uint64_t getAllocaSizeInBytes(const AllocaInst &AI) { … }
void alignAndPadAlloca(memtag::AllocaInfo &Info, llvm::Align Alignment) { … }
bool isLifetimeIntrinsic(Value *V) { … }
Value *readRegister(IRBuilder<> &IRB, StringRef Name) { … }
Value *getPC(const Triple &TargetTriple, IRBuilder<> &IRB) { … }
Value *getFP(IRBuilder<> &IRB) { … }
Value *getAndroidSlotPtr(IRBuilder<> &IRB, int Slot) { … }
static DbgAssignIntrinsic *DynCastToDbgAssign(DbgVariableIntrinsic *DVI) { … }
static DbgVariableRecord *DynCastToDbgAssign(DbgVariableRecord *DVR) { … }
void annotateDebugRecords(AllocaInfo &Info, unsigned int Tag) { … }
}
}