[clang] [Clang][NFC] Capture by ref to avoid copying std::string (PR #138231)

2025-05-02 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik closed https://github.com/llvm/llvm-project/pull/138231 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][NFC] Capture by ref to avoid copying std::string (PR #138231)

2025-05-02 Thread Shafik Yaghmour via cfe-commits
shafik wrote: > Makes sense, thanks. I just wonder why is BName an owning string? To me it > would make a lot more sense if it was a StringRef owned by the ASTContext. > WDYT? `FD->getASTContext().BuiltinInfo.getName(BId)` returns std::string by value, looking at the API it looks pretty purpo

[clang] [Clang][NFC] Capture by ref to avoid copying std::string (PR #138231)

2025-05-01 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. Makes sense, thanks. I just wonder why is BName an owning string? To me it would make a lot more sense if it was a StringRef owned by the ASTContext. WDYT? https://github.com/llvm/llvm-project/pull/138231 __

[clang] [Clang][NFC] Capture by ref to avoid copying std::string (PR #138231)

2025-05-01 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Shafik Yaghmour (shafik) Changes Static analysis flagged capturing BName by value as opposed to by reference. Updated capture to be by reference. --- Full diff: https://github.com/llvm/llvm-project/pull/138231.diff 1 Files Affected: -

[clang] [Clang][NFC] Capture by ref to avoid copying std::string (PR #138231)

2025-05-01 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik created https://github.com/llvm/llvm-project/pull/138231 Static analysis flagged capturing BName by value as opposed to by reference. Updated capture to be by reference. >From dc52a86f175be704bb571ce160b597a2f4011cac Mon Sep 17 00:00:00 2001 From: Shafik Yaghmour Dat