[compiler-rt] [llvm] [compiler-rt][rtsan] Introduce RTSAN_OPTIONS and flags (PR #107174)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 4 06:11:22 PDT 2024
================
@@ -0,0 +1,66 @@
+//===--- rtsan_flags.cpp - Realtime Sanitizer -------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// This file is a part of RealtimeSanitizer.
+//
+//===----------------------------------------------------------------------===//
+
+#include "rtsan/rtsan_flags.h"
+#include "sanitizer_common/sanitizer_flag_parser.h"
+#include "sanitizer_common/sanitizer_flags.h"
+
+using namespace __sanitizer;
+using namespace __rtsan;
+
+Flags __rtsan::flags_data;
+
+SANITIZER_INTERFACE_WEAK_DEF(const char *, __rtsan_default_options, void) {
+ return "";
+}
+
+static void RegisterRtsanFlags(FlagParser *parser, Flags *f) {
+#define RTSAN_FLAG(Type, Name, DefaultValue, Description) \
+ RegisterFlag(parser, #Name, Description, &f->Name);
+#include "rtsan_flags.inc"
+#undef RTSAN_FLAG
+}
+
+void Flags::SetDefaults() {
----------------
davidtrevelyan wrote:
Can we eliminate this function if we change line 17 of rtsan_flags.h to the following?
```cpp
#define RTSAN_FLAG(Type, Name, DefaultValue, Description) Type Name { DefaultValue };
```
https://github.com/llvm/llvm-project/pull/107174
More information about the llvm-commits
mailing list