This helper function creates a ctor function, which calls sanitizer's
init function with given arguments. This constructor is then expected
to be added to module's ctors. The patch helps unifying how sanitizer
constructor functions are created, and how init functions are called
across all sanitizers.
Details
Diff Detail
Event Timeline
Sorry for the late response.
include/llvm/Transforms/Utils/ModuleUtils.h | ||
---|---|---|
54 | This function looks overly complicated to me. Essentially, you create *both* sanitizer initialization function, | |
55 | I'd rather not provide the default argument values - passing {} explicitly is easy. |
Addressed comments:
- Renamed function, and say that it creates both ctor and init functions
- Returned a std::pair<Function *, Function *>
- Removed default arguments
include/llvm/Transforms/Utils/ModuleUtils.h | ||
---|---|---|
54 | I used std::pair at my first attempt, but I didn't want to #include <utility>. |
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.