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

Ismail Pazarbasi ismail.pazarbasi at gmail.com
Tue May 5 13:56:27 PDT 2015


Thank you for your time!


================
Comment at: include/llvm/Transforms/Utils/ModuleUtils.h:59
@@ -46,1 +58,3 @@
+    Module &M, StringRef CtorName, StringRef InitName,
+    ArrayRef<Type *> InitType, ArrayRef<Value *> InitArgs);
 } // End llvm namespace
----------------
samsonov wrote:
> This is not really `InitType`, this is `InitArgTypes`, right?
Yes, this is `InitArgsType`.

================
Comment at: lib/Transforms/Utils/ModuleUtils.cpp:112
@@ +111,3 @@
+  assert(!InitName.empty() && "Expected init function name");
+  Function *Ctor = Function::Create(
+      FunctionType::get(Type::getVoidTy(M.getContext()), false),
----------------
samsonov wrote:
> assert that two ArrayRef's have equal size?
Yes, I will add assertion. But, IIRC, it is already done by `CreateCall` below. I have a vague recollection of such an assertion.

http://reviews.llvm.org/D8777

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






More information about the llvm-commits mailing list