================ @@ -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), + dir_end = llvm::sys::fs::directory_iterator(); ---------------- ilovepi wrote:
I'm not sure this is resolved. I was expecting to see an initialization pattern, similar to the code example I linked, which is much more typical in our codebase. We also have a somewhat mixed policy on the use of `auto` (https://www.llvm.org/docs/CodingStandards.html#use-auto-type-deduction-to-make-code-more-readable). Typically, is more readable to use it in a for loop, or for initializing an iterator, but I'm always hesitant when `auto` is used for multiple initializations. ```c++ for (llvm::sys::fs::directory_iterator DirIt = llvm::sys::fs::directory_iterator( UserAssetPath, Code), DirEnd; ... ``` A using statement may also make this easier to read. 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