diff options
author | wren romano <2998727+wrengr@users.noreply.github.com> | 2023-08-22 20:02:19 -0700 |
---|---|---|
committer | Aart Bik <ajcbik@google.com> | 2023-08-22 20:31:15 -0700 |
commit | f5b974b7835a27de7c5d6142e935f2f95da997a3 (patch) | |
tree | 88e3df3835f041278b2f9bdc68724e1759860993 /flang/lib/Frontend/CompilerInvocation.cpp | |
parent | 78921a64f74facb4a2aa1552a89d2e7c579884d1 (diff) | |
download | llvm-f5b974b7835a27de7c5d6142e935f2f95da997a3.zip llvm-f5b974b7835a27de7c5d6142e935f2f95da997a3.tar.gz llvm-f5b974b7835a27de7c5d6142e935f2f95da997a3.tar.bz2 |
[mlir][sparse] Adding `{Var,DimLvlExpr,DimSpec,LvlSpec,DimLvlMap}::str` methods
These methods are needed for use with `Diagnostic::operator<<` etc.
The definitions follow the pattern of `Diagnostic::str` by simply wrapping the underlying `print(raw_ostream)` method. Although there is some overhead for constructing the `std::string`, this seems like the overall most-efficient option: since this overhead only occurs on the error path (under the current intended usage). An alternative approach would be to have one method construct a `Twine` directly, and then have the print method pass the twine to the stream; however, that would mean introducing the overhead of twine construction on the common/happy path of simply printing things out.
Reviewed By: aartbik
Differential Revision: https://reviews.llvm.org/D157643
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions