This is an archive of the discontinued LLVM Phabricator instance.

[MSan] Apply the ctor creation scheme of TSan
ClosedPublic

Authored by philip.pfaffe on Jan 15 2019, 10:56 AM.

Event Timeline

philip.pfaffe created this revision.Jan 15 2019, 10:56 AM
chandlerc accepted this revision.Jan 15 2019, 7:11 PM

LGTM with some minor cleanups!

llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
925

Add a comment at the start of the lambda to remind the reader that this is used when we are the first to try and get the sanitizer ctor/init function to set it up?

931

Strange vertical whitespace here...

932–934

Instead of this pattern, I'd suggest early exit:

if (!ClWithComdat) {
  appendToGlobalCtors(M, cTor, 0);
  return;
}
...
This revision is now accepted and ready to land.Jan 15 2019, 7:11 PM
philip.pfaffe marked 3 inline comments as done.

Address comments and update two missing testcases.

This revision was automatically updated to reflect the committed changes.