diff options
| author | Leonard Chan <leonardchan@google.com> | 2018-10-11 18:31:51 +0000 | 
|---|---|---|
| committer | Leonard Chan <leonardchan@google.com> | 2018-10-11 18:31:51 +0000 | 
| commit | 64e21b5cfd7c07154534f4ca8232c3b57f743c53 (patch) | |
| tree | 6ede89cd12c384e820d10b4c748d1557e83f4606 /llvm/lib/Passes | |
| parent | ff23bb66226be8c8017478ce936dc7fc90447259 (diff) | |
| download | bcm5719-llvm-64e21b5cfd7c07154534f4ca8232c3b57f743c53.tar.gz bcm5719-llvm-64e21b5cfd7c07154534f4ca8232c3b57f743c53.zip  | |
[PassManager/Sanitizer] Port of AddresSanitizer pass from legacy to new PassManager
This patch ports the legacy pass manager to the new one to take advantage of
the benefits of the new PM. This involved moving a lot of the declarations for
`AddressSantizer` to a header so that it can be publicly used via
PassRegistry.def which I believe contains all the passes managed by the new PM.
This patch essentially decouples the instrumentation from the legacy PM such
hat it can be used by both legacy and new PM infrastructure.
Differential Revision: https://reviews.llvm.org/D52739
llvm-svn: 344274
Diffstat (limited to 'llvm/lib/Passes')
| -rw-r--r-- | llvm/lib/Passes/PassBuilder.cpp | 3 | ||||
| -rw-r--r-- | llvm/lib/Passes/PassRegistry.def | 2 | 
2 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Passes/PassBuilder.cpp b/llvm/lib/Passes/PassBuilder.cpp index 94afb5409e1..09758dc5651 100644 --- a/llvm/lib/Passes/PassBuilder.cpp +++ b/llvm/lib/Passes/PassBuilder.cpp @@ -61,7 +61,6 @@  #include "llvm/Support/Regex.h"  #include "llvm/Target/TargetMachine.h"  #include "llvm/Transforms/AggressiveInstCombine/AggressiveInstCombine.h" -#include "llvm/Transforms/Instrumentation/CGProfile.h"  #include "llvm/Transforms/IPO/AlwaysInliner.h"  #include "llvm/Transforms/IPO/ArgumentPromotion.h"  #include "llvm/Transforms/IPO/CalledValuePropagation.h" @@ -87,7 +86,9 @@  #include "llvm/Transforms/IPO/SyntheticCountsPropagation.h"  #include "llvm/Transforms/IPO/WholeProgramDevirt.h"  #include "llvm/Transforms/InstCombine/InstCombine.h" +#include "llvm/Transforms/Instrumentation/AddressSanitizerPass.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" diff --git a/llvm/lib/Passes/PassRegistry.def b/llvm/lib/Passes/PassRegistry.def index 8de4541a772..ad03942fb9a 100644 --- a/llvm/lib/Passes/PassRegistry.def +++ b/llvm/lib/Passes/PassRegistry.def @@ -40,6 +40,7 @@ MODULE_ALIAS_ANALYSIS("globals-aa", GlobalsAA())  #define MODULE_PASS(NAME, CREATE_PASS)  #endif  MODULE_PASS("always-inline", AlwaysInlinerPass()) +MODULE_PASS("asan", AddressSanitizerPass(false, false, true))  MODULE_PASS("called-value-propagation", CalledValuePropagationPass())  MODULE_PASS("cg-profile", CGProfilePass())  MODULE_PASS("constmerge", ConstantMergePass()) @@ -147,6 +148,7 @@ FUNCTION_PASS("adce", ADCEPass())  FUNCTION_PASS("add-discriminators", AddDiscriminatorsPass())  FUNCTION_PASS("aggressive-instcombine", AggressiveInstCombinePass())  FUNCTION_PASS("alignment-from-assumptions", AlignmentFromAssumptionsPass()) +FUNCTION_PASS("asan", AddressSanitizerPass(false, false, false))  FUNCTION_PASS("bdce", BDCEPass())  FUNCTION_PASS("bounds-checking", BoundsCheckingPass())  FUNCTION_PASS("break-crit-edges", BreakCriticalEdgesPass())  | 

