[PATCH] D91385: [DFSan][NewPM] Handle dfsan under NPM

Arthur Eubanks via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 12 13:24:36 PST 2020


aeubanks created this revision.
aeubanks added reviewers: ychen, leonardchan, asbirlea.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
aeubanks requested review of this revision.

14/16 check-dfsan tests failed with NPM enabled, now all pass.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D91385

Files:
  clang/lib/CodeGen/BackendUtil.cpp


Index: clang/lib/CodeGen/BackendUtil.cpp
===================================================================
--- clang/lib/CodeGen/BackendUtil.cpp
+++ clang/lib/CodeGen/BackendUtil.cpp
@@ -65,6 +65,7 @@
 #include "llvm/Transforms/Instrumentation.h"
 #include "llvm/Transforms/Instrumentation/AddressSanitizer.h"
 #include "llvm/Transforms/Instrumentation/BoundsChecking.h"
+#include "llvm/Transforms/Instrumentation/DataFlowSanitizer.h"
 #include "llvm/Transforms/Instrumentation/GCOVProfiler.h"
 #include "llvm/Transforms/Instrumentation/HWAddressSanitizer.h"
 #include "llvm/Transforms/Instrumentation/InstrProfiling.h"
@@ -1295,6 +1296,14 @@
     HWASanPass(SanitizerKind::HWAddress, false);
     HWASanPass(SanitizerKind::KernelHWAddress, true);
 
+    if (LangOpts.Sanitize.has(SanitizerKind::DataFlow)) {
+      PB.registerOptimizerLastEPCallback(
+          [this](ModulePassManager &MPM, PassBuilder::OptimizationLevel Level) {
+            MPM.addPass(
+                DataFlowSanitizerPass(LangOpts.SanitizerBlacklistFiles));
+          });
+    }
+
     if (Optional<GCOVOptions> Options = getGCOVOptions(CodeGenOpts, LangOpts))
       PB.registerPipelineStartEPCallback(
           [Options](ModulePassManager &MPM,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91385.304954.patch
Type: text/x-patch
Size: 1229 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201112/5ffc66e3/attachment.bin>


More information about the cfe-commits mailing list