[llvm] Reduce llvm-gsymutil memory usage (PR #140740)
David Blaikie via llvm-commits
llvm-commits at lists.llvm.org
Tue May 20 13:46:59 PDT 2025
dwblaikie wrote:
> Previous approach with assert(f();return success;) failed tests for release builds, so I created a separate helper. Open to suggestions how to solve this more elegantly.
Yeah, no need for a separate function - but don't do required work inside an assertion, so doing something like this instead... actually, no, since you're getting an `llvm::Error` back, you can't use an assertion to check an `llvm::Error` (otherwise the error will go unchecked in a non-asserts build, and that's bad)
So you should replace the `assert` from the original code, with `cantFail` ( https://llvm.org/docs/ProgrammersManual.html#using-cantfail-to-simplify-safe-callsites ).
https://github.com/llvm/llvm-project/pull/140740
More information about the llvm-commits
mailing list