[PATCH] D130888: [Clang] Introduce -fexperimental-sanitize-metadata=
Marco Elver via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Aug 3 08:21:42 PDT 2022
melver added inline comments.
================
Comment at: clang/lib/Driver/SanitizerArgs.cpp:839
+ // Parse -f(no-)?sanitize-metadata.
+ for (const auto *Arg : Args) {
+ if (Arg->getOption().matches(
----------------
MaskRay wrote:
> Use `Args.getLastArg(...)`
This won't work if someone does:
-fsanitize-metadata=feature1 -fsanitize-metadata=feature2
(instead of '-fsanitize-metadata=feature1,feature2')
Added a test case.
================
Comment at: clang/test/Driver/fsanitize-metadata.c:1
+// RUN: %clang -target x86_64-linux-gnu %s -### 2>&1 | FileCheck %s
+// CHECK-NOT: -fexperimental-sanitize-metadata
----------------
MaskRay wrote:
> This RUN line is redundant. For other opt-in features, we don't check that the cc1 command line doesn't have an option.
I've made the negative-presence test more useful by checking -fno- option works.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D130888/new/
https://reviews.llvm.org/D130888
More information about the cfe-commits
mailing list