File indexing completed on 2026-05-10 08:44:38
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #ifndef LLVM_TRANSFORMS_INSTRUMENTATION_ADDRESSSANITIZERCOMMON_H
0014 #define LLVM_TRANSFORMS_INSTRUMENTATION_ADDRESSSANITIZERCOMMON_H
0015
0016 #include "llvm/Analysis/CFG.h"
0017 #include "llvm/Analysis/PostDominators.h"
0018 #include "llvm/IR/Dominators.h"
0019 #include "llvm/IR/Instruction.h"
0020 #include "llvm/IR/IntrinsicInst.h"
0021 #include "llvm/IR/Module.h"
0022
0023 namespace llvm {
0024
0025 class InterestingMemoryOperand {
0026 public:
0027 Use *PtrUse;
0028 bool IsWrite;
0029 Type *OpType;
0030 TypeSize TypeStoreSize = TypeSize::getFixed(0);
0031 MaybeAlign Alignment;
0032
0033 Value *MaybeMask;
0034
0035 Value *MaybeEVL;
0036
0037 Value *MaybeStride;
0038
0039 InterestingMemoryOperand(Instruction *I, unsigned OperandNo, bool IsWrite,
0040 class Type *OpType, MaybeAlign Alignment,
0041 Value *MaybeMask = nullptr,
0042 Value *MaybeEVL = nullptr,
0043 Value *MaybeStride = nullptr)
0044 : IsWrite(IsWrite), OpType(OpType), Alignment(Alignment),
0045 MaybeMask(MaybeMask), MaybeEVL(MaybeEVL), MaybeStride(MaybeStride) {
0046 const DataLayout &DL = I->getDataLayout();
0047 TypeStoreSize = DL.getTypeStoreSizeInBits(OpType);
0048 PtrUse = &I->getOperandUse(OperandNo);
0049 }
0050
0051 Instruction *getInsn() { return cast<Instruction>(PtrUse->getUser()); }
0052
0053 Value *getPtr() { return PtrUse->get(); }
0054 };
0055
0056
0057 void getAddressSanitizerParams(const Triple &TargetTriple, int LongSize,
0058 bool IsKasan, uint64_t *ShadowBase,
0059 int *MappingScale, bool *OrShadowOffset);
0060
0061 }
0062
0063 #endif