[clang] [llvm] [Sanitizer] Make sanitizer passes idempotent (PR #99439)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 29 07:22:31 PDT 2024


================
@@ -12,12 +12,33 @@
 //===----------------------------------------------------------------------===//
 
 #include "llvm/Transforms/Instrumentation.h"
+#include "llvm/IR/DiagnosticInfo.h"
 #include "llvm/IR/IntrinsicInst.h"
 #include "llvm/IR/Module.h"
 #include "llvm/TargetParser/Triple.h"
 
 using namespace llvm;
 
+static cl::opt<bool> ClIgnoreRedundantInstrumentation(
+    "ignore-redundant-instrumentation",
+    cl::desc("Ignore redundant instrumentation"), cl::Hidden, cl::init(false));
+
+/// Check if module has flag attached, if not add the flag.
+bool llvm::checkIfAlreadyInstrumented(Module &M, StringRef flag) {
----------------
nikic wrote:

```suggestion
bool llvm::checkIfAlreadyInstrumented(Module &M, StringRef Flag) {
```

https://github.com/llvm/llvm-project/pull/99439


More information about the llvm-commits mailing list