[clang-tools-extra] Clang doc async (PR #93276)
Paul Kirth via cfe-commits
cfe-commits at lists.llvm.org
Fri May 24 10:11:41 PDT 2024
================
@@ -1049,31 +1047,33 @@ static llvm::Error CopyFile(StringRef FilePath, StringRef OutDirectory) {
std::error_code FileErr = llvm::sys::fs::copy_file(PathRead, PathWrite);
if (FileErr != OK) {
return llvm::createStringError(llvm::inconvertibleErrorCode(),
- "error creating file " +
- llvm::sys::path::filename(FilePath) +
- ": " + FileErr.message() + "\n");
+ "error creating file " + FilePath + ": " +
+ FileErr.message() + "\n");
}
return llvm::Error::success();
}
llvm::Error HTMLGenerator::createResources(ClangDocContext &CDCtx) {
- auto Err = SerializeIndex(CDCtx);
- if (Err)
+ if (auto Err = SerializeIndex(CDCtx)) {
return Err;
- Err = GenIndex(CDCtx);
- if (Err)
+ }
+
+ if (auto Err = GenIndex(CDCtx)) {
return Err;
+ }
for (const auto &FilePath : CDCtx.UserStylesheets) {
- Err = CopyFile(FilePath, CDCtx.OutDirectory);
- if (Err)
+ if (auto Err = CopyFile(FilePath, CDCtx.OutDirectory)) {
return Err;
+ }
}
+
for (const auto &FilePath : CDCtx.FilesToCopy) {
- Err = CopyFile(FilePath, CDCtx.OutDirectory);
- if (Err)
+ if (auto Err = CopyFile(FilePath, CDCtx.OutDirectory)) {
return Err;
+ }
}
+
----------------
ilovepi wrote:
nit: Try to avoid unrelated white space chagnes. If your editor inserts these automatically, you may need to update your config. Also `git clang-format HEAD~` is your friend, but do be sure to use an up-to-date `clang-format`.
https://github.com/llvm/llvm-project/pull/93276
More information about the cfe-commits
mailing list