[clang] [clang][ExtractAPI][NFC] pass params by const reference (PR #94820)

2024-06-10 Thread Daniel Grumberg via cfe-commits
daniel-grumberg wrote: Thanks for looking at these, I think it would be best to try and leverage move semantics where possible if we are going to change this code. https://github.com/llvm/llvm-project/pull/94820 ___ cfe-commits mailing list cfe-commit

[clang] [clang][ExtractAPI][NFC] pass params by const reference (PR #94820)

2024-06-10 Thread Daniel Grumberg via cfe-commits
@@ -240,7 +241,7 @@ class DeclarationFragments { class AccessControl { public: - AccessControl(std::string Access) : Access(Access) {} daniel-grumberg wrote: Again I would prefer if we kept the value semantic ones and use `std::move` https://github.com/llvm

[clang] [clang][ExtractAPI][NFC] pass params by const reference (PR #94820)

2024-06-10 Thread Daniel Grumberg via cfe-commits
@@ -199,7 +199,8 @@ class DeclarationFragments { return *this; } - DeclarationFragments &replace(std::string NewSpelling, unsigned Position) { daniel-grumberg wrote: I would prefer to keep the value semantics version and instead move assign the value,

[clang] [clang][ExtractAPI][NFC] pass params by const reference (PR #94820)

2024-06-07 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Erick Velez (evelez7) Changes Change some parameters in DeclarationFragments.h to be passed by const reference. Caught by cppcheck. Fixes #92756 but doesn't address return value `RT` for `getTopLevelRecords`. I'm not sure we'd want a con

[clang] [clang][ExtractAPI][NFC] pass params by const reference (PR #94820)

2024-06-07 Thread Erick Velez via cfe-commits
https://github.com/evelez7 created https://github.com/llvm/llvm-project/pull/94820 Change some parameters in DeclarationFragments.h to be passed by const reference. Caught by cppcheck. Fixes #92756 but doesn't address return value `RT` for `getTopLevelRecords`. I'm not sure we'd want a const