[libcxx-commits] [PATCH] D155820: [libc++] Optimize internal function in <system_error>
Louis Dionne via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Jul 21 09:53:13 PDT 2023
ldionne added inline comments.
================
Comment at: libcxx/src/system_error.cpp:53
return default_error_condition(code) == condition;
}
----------------
Just to put things in perspective, `system_error` is an exception type. I don't think we should pursue changes just for the sake of optimizing the construction of exception types.
However, mixed with https://github.com/llvm/llvm-project/issues/63985, I think this change could be worthwhile since we would both make this faster (ok, whatever) but also remove an unused function from our ABI surface (which is nice).
So personally I think the approach we should take here is to remove `__init` from our ABI and replace it with a function that is internal to `system_error.cpp` like you did here. Removing `__init` from the ABI will require a bit of preparation work to make sure it's safe but that's something we can help with if you update this patch with the full changes.
Just to set expectations, I would target this for LLVM 18, not LLVM 17.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D155820/new/
https://reviews.llvm.org/D155820
More information about the libcxx-commits
mailing list