forked from OSchip/llvm-project
Revert r222997. The newly added compile-time checks are finding missing origins, testcase is being reduced and a PR will be posted shortly.
llvm-svn: 223211
This commit is contained in:
parent
a48bd07e5e
commit
a4acb44995
|
@ -921,8 +921,6 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
|
|||
Value *OriginPtr =
|
||||
getOriginPtrForArgument(&FArg, EntryIRB, ArgOffset);
|
||||
setOrigin(A, EntryIRB.CreateLoad(OriginPtr));
|
||||
} else {
|
||||
setOrigin(A, getCleanOrigin());
|
||||
}
|
||||
}
|
||||
ArgOffset += RoundUpToAlignment(Size, kShadowTLSAlignment);
|
||||
|
@ -942,13 +940,15 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
|
|||
/// \brief Get the origin for a value.
|
||||
Value *getOrigin(Value *V) {
|
||||
if (!MS.TrackOrigins) return nullptr;
|
||||
if (!PropagateShadow) return getCleanOrigin();
|
||||
if (isa<Constant>(V)) return getCleanOrigin();
|
||||
assert((isa<Instruction>(V) || isa<Argument>(V)) &&
|
||||
"Unexpected value type in getOrigin()");
|
||||
Value *Origin = OriginMap[V];
|
||||
assert(Origin && "Missing origin");
|
||||
return Origin;
|
||||
if (isa<Instruction>(V) || isa<Argument>(V)) {
|
||||
Value *Origin = OriginMap[V];
|
||||
if (!Origin) {
|
||||
DEBUG(dbgs() << "NO ORIGIN: " << *V << "\n");
|
||||
Origin = getCleanOrigin();
|
||||
}
|
||||
return Origin;
|
||||
}
|
||||
return getCleanOrigin();
|
||||
}
|
||||
|
||||
/// \brief Get the origin for i-th argument of the instruction I.
|
||||
|
@ -1088,7 +1088,6 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
|
|||
IRB.CreateStore(getCleanShadow(&I), ShadowPtr);
|
||||
|
||||
setShadow(&I, getCleanShadow(&I));
|
||||
setOrigin(&I, getCleanOrigin());
|
||||
}
|
||||
|
||||
void visitAtomicRMWInst(AtomicRMWInst &I) {
|
||||
|
|
Loading…
Reference in New Issue