[PATCH] Implement `createSanitizerCtor`, common helper function for all sanitizers

Ismail Pazarbasi ismail.pazarbasi at gmail.com
Sat May 2 15:21:04 PDT 2015


================
Comment at: include/llvm/Transforms/Utils/ModuleUtils.h:54
@@ +53,3 @@
+/// function from it.
+Function *createSanitizerCtor(Module &M, StringRef CtorName, StringRef InitName,
+                              ArrayRef<Type *> InitType = ArrayRef<Type *>(),
----------------
samsonov wrote:
> This function looks overly complicated to me. Essentially, you create *both* sanitizer initialization function,
> and sanitizer module constructor here. Consider splitting this function into two functions. Or rename it accordingly
> and return std::pair<Function *, Function *> to clearly indicate that you create two objects. Note that in the latter case
> you will not need an overload.
I used `std::pair` at my first attempt, but I didn't want to `#include <utility>`.

http://reviews.llvm.org/D8777

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list