diff options
| author | Nick Lewycky <nicholas@mxc.ca> | 2014-12-03 05:47:00 +0000 |
|---|---|---|
| committer | Nick Lewycky <nicholas@mxc.ca> | 2014-12-03 05:47:00 +0000 |
| commit | a4acb449955f9cd4e1eae0e7e6e7fe55a88a0de2 (patch) | |
| tree | 2e6b8ca87ccf596caea866c409f86c1de9490f63 | |
| parent | a48bd07e5e5553c100e6e203cd4c2b22752a0e39 (diff) | |
| download | bcm5719-llvm-a4acb449955f9cd4e1eae0e7e6e7fe55a88a0de2.tar.gz bcm5719-llvm-a4acb449955f9cd4e1eae0e7e6e7fe55a88a0de2.zip | |
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
| -rw-r--r-- | llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp index 40e0e013257..15a67d7c697 100644 --- a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp +++ b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp @@ -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) { |

