This is an archive of the discontinued LLVM Phabricator instance.

[msan] Don't sanitize "nosanitize" instructions
ClosedPublic

Authored by vitalybuka on Nov 17 2017, 7:24 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

vitalybuka created this revision.Nov 17 2017, 7:24 PM
eugenis added inline comments.Nov 20 2017, 12:51 PM
llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
1344 ↗(On Diff #123458)

what's the point of this using statement?

I think it would be more readable to do this in runOnFunction (see the depth_first loop over basic blocks).

vitalybuka added inline comments.Nov 20 2017, 1:57 PM
llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
1344 ↗(On Diff #123458)

InstVisitor has other overloads of visit()
c++ stops looking for overloads if it found something in the current class
if I add mine here "visit(basic_block)" will try to call mine and fail.
"using" inherit all overloads from parent class, so for basic block still will be able to call the same overload as before.

seems like this visitor exists for things exactly like this, and I see similar usage in other places. moving check into runOnFunction will make us to copy loop over instructions which does not look more readable to me. I'd prefer to keep as much as possible logic in InstVisitor. I guess we have own look for bblocks in runOnFunction only to have depth_first.

eugenis accepted this revision.Nov 20 2017, 2:06 PM
This revision is now accepted and ready to land.Nov 20 2017, 2:06 PM
This revision was automatically updated to reflect the committed changes.
llvm/trunk/lib/Transforms/Instrumentation/MemorySanitizer.cpp