================
@@ -131,12 +137,55 @@ std::string GetExecutablePath(const char *Argv0, void 
*MainAddr) {
   return llvm::sys::fs::getMainExecutable(Argv0, MainAddr);
 }
 
+void GetAssetFiles(clang::doc::ClangDocContext &CDCtx) {
+  std::error_code Code;
+  for (auto DirIt = llvm::sys::fs::directory_iterator(
+                std::string(UserAssetPath), Code),
----------------
ilovepi wrote:

Do you need to construct an std::string? Anything convertible to `Twine` should 
work, like a `StringRef`, `SmallString`, `const char*`, etc. Since the 
`UserAssetPath` can't be changed, and won't be deallocated (it's a static 
variable), I don't think you need to worry about lifetimes, which are the big 
concern when the type is not owning. Here its safe, IMO. 

https://github.com/llvm/llvm-project/pull/94717
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to