[PATCH] D125782: [llvm-debuginfo-analyzer] 07 - Compare elements
Carlos Alberto Enciso via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 5 23:50:23 PDT 2022
CarlosAlbertoEnciso added inline comments.
================
Comment at: llvm/include/llvm/DebugInfo/LogicalView/Core/LVCompare.h:75
+ }
+ LVPassTable getPassTable() const { return PassTable; }
+
----------------
psamolysov wrote:
> CarlosAlbertoEnciso wrote:
> > probinson wrote:
> > > Returning a std::vector by value seems inefficient.
> > Good point. Changed.
> What about to add & after const in method declaration to make the method callable on lvalues only? If a method that returns a reference is callable on an rvalue ("temporary"), a returned reference can become dangling immediately after destroying the temporary.
Nice suggestion. Changed to
```
const LVPassTable &getPassTable() const & { return PassTable; }
```
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D125782/new/
https://reviews.llvm.org/D125782
More information about the llvm-commits
mailing list