[PATCH] D96572: [Clang][ASan] Introduce `-fsanitize-address-destructor-kind=` driver & frontend option.

Dan Liew via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 11 19:34:21 PST 2021


delcypher created this revision.
delcypher added reviewers: arphaman, kubamracek, yln, aralisza, kcc, vitalybuka.
Herald added subscribers: dexonsmith, dang.
Herald added a reviewer: jansvoboda11.
delcypher requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

The new `-fsanitize-address-destructor-kind=` option allows control over how module
destructors are emitted by ASan.

The new option is consumed by both the driver and the frontend and is propagated into
codegen options by the frontend.

Both the legacy and new pass manager code have been updated to consume the new option
from the codegen options.

It would be nice if the new utility functions (`AsanDtorKindToString` and
`AsanDtorKindFromString`) could live in LLVM instead of Clang so they could be
consumed by other language frontends. Unfortunately that doesn't work because
the clang driver doesn't link against the LLVM instrumentation library.

rdar://71609176


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D96572

Files:
  clang/include/clang/Basic/CodeGenOptions.def
  clang/include/clang/Basic/CodeGenOptions.h
  clang/include/clang/Basic/Sanitizers.h
  clang/include/clang/Driver/Options.td
  clang/include/clang/Driver/SanitizerArgs.h
  clang/lib/Basic/Sanitizers.cpp
  clang/lib/CodeGen/BackendUtil.cpp
  clang/lib/Driver/SanitizerArgs.cpp
  clang/lib/Frontend/CompilerInvocation.cpp
  clang/test/CodeGen/asan-destructor-kind.cpp
  clang/test/Driver/fsanitize-address-destructor-kind.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D96572.323212.patch
Type: text/x-patch
Size: 12501 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210212/0a25a4e8/attachment.bin>


More information about the cfe-commits mailing list