[clang-tools-extra] [clang-doc] [feat] add --repository-line-prefix argument (PR #131280)
Paul Kirth via cfe-commits
cfe-commits at lists.llvm.org
Sat Mar 22 12:46:27 PDT 2025
================
@@ -490,15 +490,17 @@ genReferencesBlock(const std::vector<Reference> &References,
}
return Out;
}
-
static std::unique_ptr<TagNode>
-writeFileDefinition(const Location &L,
- std::optional<StringRef> RepositoryUrl = std::nullopt) {
- if (!L.IsFileInRootDir && !RepositoryUrl)
+writeFileDefinition(const ClangDocContext &CDCtx, const Location &L) {
+ std::string RepositoryUrl = CDCtx.RepositoryUrl.value_or("");
+ std::string RepositoryLinePrefix = CDCtx.RepositoryLinePrefix.value_or("");
----------------
ilovepi wrote:
Why introduce string copies? You're also making a `SmallString` below using the same data, so its not only extra copy operations, its now heap allocations too.
https://github.com/llvm/llvm-project/pull/131280
More information about the cfe-commits
mailing list