Lines Matching defs:MS
423 MemorySanitizer &MS;
443 MemorySanitizerVisitor(Function &F, MemorySanitizer &MS)
444 : F(F), MS(MS), VAHelper(CreateVarArgHelper(F, MS, *this)) {
445 bool SanitizeFunction = !MS.BL->isIn(F) && F.getAttributes().hasAttribute(
476 if (MS.TrackOrigins) {
495 MS.OriginStoreWeights);
517 MS.ColdCallWeights);
520 if (MS.TrackOrigins) {
523 MS.OriginTLS);
525 CallInst *Call = IRB.CreateCall(MS.WarningFn);
527 IRB.CreateCall(MS.EmptyAsm);
535 MS.initializeCallbacks(*F.getParent());
536 if (!MS.TD) return false;
557 PHINode *PNO = MS.TrackOrigins ? cast<PHINode>(getOrigin(PN)) : 0;
593 uint32_t EltSize = MS.TD->getTypeSizeInBits(VT->getElementType());
594 return VectorType::get(IntegerType::get(*MS.C, EltSize),
601 StructType *Res = StructType::get(*MS.C, Elements, ST->isPacked());
605 uint32_t TypeSize = MS.TD->getTypeSizeInBits(OrigTy);
606 return IntegerType::get(*MS.C, TypeSize);
612 return IntegerType::get(*MS.C, vt->getBitWidth());
631 IRB.CreateAnd(IRB.CreatePointerCast(Addr, MS.IntptrTy),
632 ConstantInt::get(MS.IntptrTy, ~MS.ShadowMask));
642 IRB.CreateAnd(IRB.CreatePointerCast(Addr, MS.IntptrTy),
643 ConstantInt::get(MS.IntptrTy, ~MS.ShadowMask));
646 ConstantInt::get(MS.IntptrTy, MS.OriginOffset));
648 IRB.CreateAnd(Add, ConstantInt::get(MS.IntptrTy, ~3ULL));
657 Value *Base = IRB.CreatePointerCast(MS.ParamTLS, MS.IntptrTy);
658 Base = IRB.CreateAdd(Base, ConstantInt::get(MS.IntptrTy, ArgOffset));
666 if (!MS.TrackOrigins) return 0;
667 Value *Base = IRB.CreatePointerCast(MS.ParamOriginTLS, MS.IntptrTy);
668 Base = IRB.CreateAdd(Base, ConstantInt::get(MS.IntptrTy, ArgOffset));
669 return IRB.CreateIntToPtr(Base, PointerType::get(MS.OriginTy, 0),
675 Value *Base = IRB.CreatePointerCast(MS.RetvalTLS, MS.IntptrTy);
683 return MS.RetvalOriginTLS;
694 if (!MS.TrackOrigins) return;
733 return Constant::getNullValue(MS.OriginTy);
772 ? MS.TD->getTypeAllocSize(AI->getType()->getPointerElementType())
773 : MS.TD->getTypeAllocSize(AI->getType());
783 ArgAlign = MS.TD->getABITypeAlignment(EltType);
797 if (MS.TrackOrigins) {
818 if (!MS.TrackOrigins) return 0;
876 if (MS.TrackOrigins) {
1053 if (MSV->MS.TrackOrigins) {
1070 Value *OpOrigin = MSV->MS.TrackOrigins ? MSV->getOrigin(V) : 0;
1082 if (MSV->MS.TrackOrigins) {
1094 if (!MS.TrackOrigins) return;
1121 Value *V1 = IRB.CreateBitCast(V, Type::getIntNTy(*MS.C, srcSizeInBits));
1123 IRB.CreateIntCast(V1, Type::getIntNTy(*MS.C, dstSizeInBits), false);
1357 MS.MemmoveFn,
1360 IRB.CreateIntCast(I.getArgOperand(2), MS.IntptrTy, false));
1371 MS.MemcpyFn,
1374 IRB.CreateIntCast(I.getArgOperand(2), MS.IntptrTy, false));
1382 MS.MemsetFn,
1385 IRB.CreateIntCast(I.getArgOperand(2), MS.IntptrTy, false));
1435 if (MS.TrackOrigins)
1462 if (MS.TrackOrigins) {
1629 Size = MS.TD->getTypeAllocSize(A->getType()->getPointerElementType());
1632 getShadowPtr(A, Type::getInt8Ty(*MS.C), IRB),
1635 Size = MS.TD->getTypeAllocSize(A->getType());
1639 if (MS.TrackOrigins)
1683 if (MS.TrackOrigins)
1695 if (MS.TrackOrigins)
1705 if (MS.TrackOrigins)
1706 setOrigin(&I, IRB.CreatePHI(MS.OriginTy, I.getNumIncomingValues(),
1713 uint64_t Size = MS.TD->getTypeAllocSize(I.getAllocatedType());
1715 IRB.CreateCall2(MS.MsanPoisonStackFn,
1717 ConstantInt::get(MS.IntptrTy, Size));
1719 Value *ShadowBase = getShadowPtr(&I, Type::getInt8PtrTy(*MS.C), IRB);
1724 if (PoisonStack && MS.TrackOrigins) {
1737 IRB.CreateCall3(MS.MsanSetAllocaOriginFn,
1739 ConstantInt::get(MS.IntptrTy, Size),
1749 if (MS.TrackOrigins) {
1833 MemorySanitizer &MS;
1840 VarArgAMD64Helper(Function &F, MemorySanitizer &MS,
1842 : F(F), MS(MS), MSV(MSV), VAArgTLSCopy(0), VAArgOverflowSize(0) { }
1889 uint64_t ArgSize = MS.TD->getTypeAllocSize(A->getType());
1897 IRB.CreateStore(OverflowSize, MS.VAArgOverflowSizeTLS);
1903 Value *Base = IRB.CreatePointerCast(MS.VAArgTLS, MS.IntptrTy);
1904 Base = IRB.CreateAdd(Base, ConstantInt::get(MS.IntptrTy, ArgOffset));
1939 VAArgOverflowSize = IRB.CreateLoad(MS.VAArgOverflowSizeTLS);
1941 IRB.CreateAdd(ConstantInt::get(MS.IntptrTy, AMD64FpEndOffset),
1943 VAArgTLSCopy = IRB.CreateAlloca(Type::getInt8Ty(*MS.C), CopySize);
1944 IRB.CreateMemCpy(VAArgTLSCopy, MS.VAArgTLS, CopySize, 8);
1956 IRB.CreateAdd(IRB.CreatePtrToInt(VAListTag, MS.IntptrTy),
1957 ConstantInt::get(MS.IntptrTy, 16)),
1958 Type::getInt64PtrTy(*MS.C));
1967 IRB.CreateAdd(IRB.CreatePtrToInt(VAListTag, MS.IntptrTy),
1968 ConstantInt::get(MS.IntptrTy, 8)),
1969 Type::getInt64PtrTy(*MS.C));
1982 VarArgNoOpHelper(Function &F, MemorySanitizer &MS,