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
- Repository
- rL LLVM
Event Timeline
Sorry for the late response.
include/llvm/Transforms/Utils/ModuleUtils.h | ||
---|---|---|
54 ↗ | (On Diff #23069) | This function looks overly complicated to me. Essentially, you create *both* sanitizer initialization function, |
55 ↗ | (On Diff #23069) | 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 ↗ | (On Diff #23069) | I used std::pair at my first attempt, but I didn't want to #include <utility>. |
Thank you for your time!
include/llvm/Transforms/Utils/ModuleUtils.h | ||
---|---|---|
59 ↗ | (On Diff #24862) | Yes, this is InitArgsType. |
lib/Transforms/Utils/ModuleUtils.cpp | ||
112 ↗ | (On Diff #24862) | Yes, I will add assertion. But, IIRC, it is already done by CreateCall below. I have a vague recollection of such an assertion. |