================ @@ -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 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits