[all-commits] [llvm/llvm-project] 2b02df: [ASan] Introduce a flag -asan-constructor-kind to ...

Usama Hameed via All-commits all-commits at lists.llvm.org
Tue Jan 24 15:37:57 PST 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2b02df781928897beb640df24078dc3c4eb2eb14
  Author: usama hameed <u_hameed at apple.com>
  Date:   2023-01-24 (Tue, 24 Jan 2023)

  Changed paths:
    M llvm/include/llvm/Transforms/Instrumentation/AddressSanitizer.h
    M llvm/include/llvm/Transforms/Instrumentation/AddressSanitizerOptions.h
    M llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
    A llvm/test/Instrumentation/AddressSanitizer/no-global-ctors.ll

  Log Message:
  [ASan] Introduce a flag -asan-constructor-kind to control the generation of the Asan module constructor.

By default, ASan generates an asan.module_ctor function that initializes asan and
registers the globals in the module. This function is added to the
@llvm.global_ctors array. Previously, there was no way to control the
generation of this function.

This patch adds a way to control the generation of this function. The
flag -asan-constructor-kind has two options:

global: This is the default option and the default behavior of ASan. It generates an
asan.module_ctor function.
none: This skips the generation of the asan.module_ctor function.


Differential revision: https://reviews.llvm.org/D142505

More information about the All-commits mailing list