diff options
| author | Philip Pfaffe <philip.pfaffe@gmail.com> | 2019-01-03 13:42:44 +0000 |
|---|---|---|
| committer | Philip Pfaffe <philip.pfaffe@gmail.com> | 2019-01-03 13:42:44 +0000 |
| commit | b39a97c8f6c02f5ce9d048849dfae4c3ee26d5ee (patch) | |
| tree | 2c869409a8f53707cc504dbbbf57ed11d9a668cb /llvm/lib/Passes | |
| parent | b0826bdffe48b91d9d1dad7437e2266635c5b7dd (diff) | |
| download | bcm5719-llvm-b39a97c8f6c02f5ce9d048849dfae4c3ee26d5ee.tar.gz bcm5719-llvm-b39a97c8f6c02f5ce9d048849dfae4c3ee26d5ee.zip | |
[NewPM] Port Msan
Summary:
Keeping msan a function pass requires replacing the module level initialization:
That means, don't define a ctor function which calls __msan_init, instead just
declare the init function at the first access, and add that to the global ctors
list.
Changes:
- Pull the actual sanitizer and the wrapper pass apart.
- Add a newpm msan pass. The function pass inserts calls to runtime
library functions, for which it inserts declarations as necessary.
- Update tests.
Caveats:
- There is one test that I dropped, because it specifically tested the
definition of the ctor.
Reviewers: chandlerc, fedor.sergeev, leonardchan, vitalybuka
Subscribers: sdardis, nemanjai, javed.absar, hiraditya, kbarton, bollu, atanasyan, jsji
Differential Revision: https://reviews.llvm.org/D55647
llvm-svn: 350305
Diffstat (limited to 'llvm/lib/Passes')
| -rw-r--r-- | llvm/lib/Passes/PassBuilder.cpp | 2 | ||||
| -rw-r--r-- | llvm/lib/Passes/PassRegistry.def | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Passes/PassBuilder.cpp b/llvm/lib/Passes/PassBuilder.cpp index 4da8f549d9b..2f567262fbb 100644 --- a/llvm/lib/Passes/PassBuilder.cpp +++ b/llvm/lib/Passes/PassBuilder.cpp @@ -88,11 +88,13 @@ #include "llvm/Transforms/IPO/SyntheticCountsPropagation.h" #include "llvm/Transforms/IPO/WholeProgramDevirt.h" #include "llvm/Transforms/InstCombine/InstCombine.h" +#include "llvm/Transforms/Instrumentation.h" #include "llvm/Transforms/Instrumentation/BoundsChecking.h" #include "llvm/Transforms/Instrumentation/CGProfile.h" #include "llvm/Transforms/Instrumentation/ControlHeightReduction.h" #include "llvm/Transforms/Instrumentation/GCOVProfiler.h" #include "llvm/Transforms/Instrumentation/InstrProfiling.h" +#include "llvm/Transforms/Instrumentation/MemorySanitizer.h" #include "llvm/Transforms/Instrumentation/PGOInstrumentation.h" #include "llvm/Transforms/Scalar/ADCE.h" #include "llvm/Transforms/Scalar/AlignmentFromAssumptions.h" diff --git a/llvm/lib/Passes/PassRegistry.def b/llvm/lib/Passes/PassRegistry.def index 97f0d577b30..2d5fc2e99b1 100644 --- a/llvm/lib/Passes/PassRegistry.def +++ b/llvm/lib/Passes/PassRegistry.def @@ -231,6 +231,7 @@ FUNCTION_PASS("verify<regions>", RegionInfoVerifierPass()) FUNCTION_PASS("view-cfg", CFGViewerPass()) FUNCTION_PASS("view-cfg-only", CFGOnlyViewerPass()) FUNCTION_PASS("transform-warning", WarnMissedTransformationsPass()) +FUNCTION_PASS("msan", MemorySanitizerPass()) #undef FUNCTION_PASS #ifndef LOOP_ANALYSIS |

