[PATCH] D101439: [clang-cl] Add parsing support for a bunch of new flags

Hans Wennborg via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 3 04:59:49 PDT 2021


hans marked 2 inline comments as done.
hans added inline comments.


================
Comment at: clang/include/clang/Driver/Options.td:6117
 def _SLASH_favor : CLJoined<"favor">;
+def _SLASH_fsanitize_address_use_after_return : CLJoined<"fsanitize-address-use-after-return">;
+def _SLASH_fno_sanitize_address_vcasan_lib : CLJoined<"fno-sanitize-address-vcasan-lib">;
----------------
thakis wrote:
> Can we ask (or check) how this one is implemented? Does it inject a custom __asan_default_options that returns `detect_stack_use_after_return=1` or is it more involved?
They have docs here:
https://docs.microsoft.com/en-us/cpp/sanitizers/asan-building?view=msvc-160#fsanitize-address-use-after-return-compiler-option-experimental

It sounds like unlike Clang, MSVC doesn't turn on the necessary instrumentation for this by default for performance reasons. The flag enables the instrumentation, but the user also needs to set ASAN_OPTIONS to enable it at run-time.


================
Comment at: clang/include/clang/Driver/Options.td:6118
+def _SLASH_fsanitize_address_use_after_return : CLJoined<"fsanitize-address-use-after-return">;
+def _SLASH_fno_sanitize_address_vcasan_lib : CLJoined<"fno-sanitize-address-vcasan-lib">;
 def _SLASH_F : CLJoinedOrSeparate<"F">;
----------------
thakis wrote:
> I guess this one controls library search paths and they have vc libs built with and without asan?
There are some docs here: https://docs.microsoft.com/en-us/cpp/sanitizers/asan-building?view=msvc-160#fno-sanitize-address-vcasan-lib-compiler-option

It's an extra library that implements __asan_set_error_report_callback for a better debugging experience and integration with the IDE, it sounds like.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D101439/new/

https://reviews.llvm.org/D101439



More information about the cfe-commits mailing list