[PATCH] Don't add sanitizer init function directly into module constructors
Kostya Serebryany
kcc at google.com
Tue Mar 31 16:27:06 PDT 2015
> > This prevents these sanitizers be used in certain cases,
>
Can you give an example?
Also, please add tests to test/Instrumentation/*Sanitizer
The change touches 3 sanitizers that have 3 different primary maintainers
It might be simpler to split this patch into several:
- move checkInterfaceFunction w/o other functionality changes
- update each of the sanitizers.
================
Comment at: lib/Transforms/Instrumentation/AddressSanitizer.cpp:1220
@@ +1219,3 @@
+ AsanPoisonGlobals = checkInterfaceFunction(
+ "AddressSanitizer",
+ M.getOrInsertFunction(kAsanPoisonGlobalsName, IRB.getVoidTy(), IntptrTy,
----------------
here and below, please use a file-static named constant (e.g. kSanitizerName)
================
Comment at: lib/Transforms/Utils/ModuleUtils.cpp:109
@@ +108,3 @@
+ raw_string_ostream Stream(Err);
+ Stream << Sanitizer << " interface function redefined: " << *FuncOrBitcast;
+ report_fatal_error(Err);
----------------
You can just print "Sanitizer interface function" to make the code simpler.
http://reviews.llvm.org/D8754
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the llvm-commits
mailing list