[PATCH] D142505: [ASan] Introduce a flag -asan-constructor-kind to control the generation of the Asan module constructor.
Usama Hameed via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 24 14:47:53 PST 2023
usama54321 added inline comments.
================
Comment at: llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp:355
+ cl::desc("Sets the ASan constructor kind"),
+ cl::values(clEnumValN(AsanCtorKind::None, "none", "No destructors"),
+ clEnumValN(AsanCtorKind::Global, "global",
----------------
vitalybuka wrote:
> why it's about destructors?
Ah that is a typo
================
Comment at: llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp:2481
+ assert(AsanCtorFunction || ConstructorKind == AsanCtorKind::None);
+ IRBuilder<> IRB = AsanCtorFunction ? IRBuilder<>(AsanCtorFunction->getEntryBlock().getTerminator()) : IRBuilder<>(*C);
InstrumentGlobals(IRB, M, &CtorComdat);
----------------
vitalybuka wrote:
> Can you do something like this?
>
> What is the point of instrumenting globals without constructors?
We will be calling asan_init and registering globals manually. I will refactor this
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D142505/new/
https://reviews.llvm.org/D142505
More information about the llvm-commits
mailing list