summaryrefslogtreecommitdiffstats
path: root/llvm/include/llvm/Transforms/Instrumentation/MemorySanitizer.h
diff options
context:
space:
mode:
authorPhilip Pfaffe <philip.pfaffe@gmail.com>2019-02-04 21:02:49 +0000
committerPhilip Pfaffe <philip.pfaffe@gmail.com>2019-02-04 21:02:49 +0000
commit0ee6a933cec492b334f357b97402e97b612dd1ff (patch)
tree3449a2dfd88e4b4f77913cbf499375e3ae775cae /llvm/include/llvm/Transforms/Instrumentation/MemorySanitizer.h
parent90d856cd5f4c4bfe415105f6bfc66f05457a334d (diff)
downloadbcm5719-llvm-0ee6a933cec492b334f357b97402e97b612dd1ff.tar.gz
bcm5719-llvm-0ee6a933cec492b334f357b97402e97b612dd1ff.zip
[NewPM][MSan] Add Options Handling
Summary: This patch enables passing options to msan via the passes pipeline, e.e., -passes=msan<recover;kernel;track-origins=4>. Reviewers: chandlerc, fedor.sergeev, leonardchan Subscribers: hiraditya, bollu, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D57640 llvm-svn: 353090
Diffstat (limited to 'llvm/include/llvm/Transforms/Instrumentation/MemorySanitizer.h')
-rw-r--r--llvm/include/llvm/Transforms/Instrumentation/MemorySanitizer.h23
1 files changed, 13 insertions, 10 deletions
diff --git a/llvm/include/llvm/Transforms/Instrumentation/MemorySanitizer.h b/llvm/include/llvm/Transforms/Instrumentation/MemorySanitizer.h
index d97feb1b33e..0739d9e58a6 100644
--- a/llvm/include/llvm/Transforms/Instrumentation/MemorySanitizer.h
+++ b/llvm/include/llvm/Transforms/Instrumentation/MemorySanitizer.h
@@ -18,10 +18,18 @@
namespace llvm {
+struct MemorySanitizerOptions {
+ MemorySanitizerOptions() = default;
+ MemorySanitizerOptions(int TrackOrigins, bool Recover, bool Kernel)
+ : TrackOrigins(TrackOrigins), Recover(Recover), Kernel(Kernel) {}
+ int TrackOrigins = 0;
+ bool Recover = false;
+ bool Kernel = false;
+};
+
// Insert MemorySanitizer instrumentation (detection of uninitialized reads)
-FunctionPass *createMemorySanitizerLegacyPassPass(int TrackOrigins = 0,
- bool Recover = false,
- bool EnableKmsan = false);
+FunctionPass *
+createMemorySanitizerLegacyPassPass(MemorySanitizerOptions Options = {});
/// A function pass for msan instrumentation.
///
@@ -30,17 +38,12 @@ FunctionPass *createMemorySanitizerLegacyPassPass(int TrackOrigins = 0,
/// yet, the pass inserts the declarations. Otherwise the existing globals are
/// used.
struct MemorySanitizerPass : public PassInfoMixin<MemorySanitizerPass> {
- MemorySanitizerPass(int TrackOrigins = 0, bool Recover = false,
- bool EnableKmsan = false)
- : TrackOrigins(TrackOrigins), Recover(Recover), EnableKmsan(EnableKmsan) {
- }
+ MemorySanitizerPass(MemorySanitizerOptions Options) : Options(Options) {}
PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM);
private:
- int TrackOrigins;
- bool Recover;
- bool EnableKmsan;
+ MemorySanitizerOptions Options;
};
}
OpenPOWER on IntegriCloud