Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
LGTM. I have a slight preference for llvm::unique_function<> instead of Optional<std::function<>>, but if you have a reason to prefer what's in the patch that's fine with me.
llvm/include/llvm/Linker/IRMover.h | ||
---|---|---|
79–80 | What about using llvm::unique_function instead? You can pass nullptr to this parameter. You'd want document here in the API that nullptr was an acceptable input. (Not sure on tradeoffs between unique_function<> and Optional<function<>>... I have the general impression that unique_function is a bit nicer since it can take move-only function objects.) |
Comment Actions
TIL; was using llvm::Optional out of naivete of llvm::unique_function. Thanks for the recommendation.
What about using llvm::unique_function instead? You can pass nullptr to this parameter. You'd want document here in the API that nullptr was an acceptable input.
(Not sure on tradeoffs between unique_function<> and Optional<function<>>... I have the general impression that unique_function is a bit nicer since it can take move-only function objects.)