[PATCH] Don't add sanitizer init function directly into module constructors

Ismail Pazarbasi ismail.pazarbasi at gmail.com
Tue Mar 31 15:49:45 PDT 2015


Hi kcc, samsonov, eugenis,

AddressSanitizer creates a function within the module, which calls
`__asan_init`. This function is then added to the module's constructors.
ThreadSanitizer, and MemorySanitizer, however, add their respective init
functions directly to module constructors. This prevents these
sanitizers be used in certain cases, where module constructor must be
implemented in instrumented object itself. This patch unifies how
sanitizer constructor functions are created, and how init functions are
called across all sanitizers.

Moved `checkInterfaceFunction` into ModuleUtils.

http://reviews.llvm.org/D8754

Files:
  include/llvm/Transforms/Utils/ModuleUtils.h
  lib/Transforms/Instrumentation/AddressSanitizer.cpp
  lib/Transforms/Instrumentation/MemorySanitizer.cpp
  lib/Transforms/Instrumentation/SanitizerCoverage.cpp
  lib/Transforms/Instrumentation/ThreadSanitizer.cpp
  lib/Transforms/Utils/ModuleUtils.cpp

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D8754.23018.patch
Type: text/x-patch
Size: 29200 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150331/602a1544/attachment.bin>


More information about the llvm-commits mailing list