[clang-tools-extra] [clang-doc] Refactor error handling to use ExitOnError (PR #141699)

2025-05-30 Thread Samarth Narang via cfe-commits
snarang181 wrote: I made the requested changes, can the CI workflows be triggered? I do not have access. https://github.com/llvm/llvm-project/pull/141699 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/li

[clang-tools-extra] [clang-doc] Refactor error handling to use ExitOnError (PR #141699)

2025-05-30 Thread Samarth Narang via cfe-commits
https://github.com/snarang181 updated https://github.com/llvm/llvm-project/pull/141699 >From f0b3184f2d4342eb0aacf3a77671556ac2e57650 Mon Sep 17 00:00:00 2001 From: Samarth Narang Date: Tue, 27 May 2025 21:32:41 -0400 Subject: [PATCH 01/17] [clang-doc] Refactor error handling to use ExitOnError

[clang-tools-extra] [clang-doc] Refactor error handling to use ExitOnError (PR #141699)

2025-05-30 Thread Samarth Narang via cfe-commits
snarang181 wrote: Thanks again @ilovepi for the handholding, appreciate it. BTW -- do you know what's going on with the Linux CI? https://github.com/llvm/llvm-project/pull/141699 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.

[clang-tools-extra] [clang-doc] Refactor error handling to use ExitOnError (PR #141699)

2025-05-30 Thread Samarth Narang via cfe-commits
https://github.com/snarang181 updated https://github.com/llvm/llvm-project/pull/141699 >From f0b3184f2d4342eb0aacf3a77671556ac2e57650 Mon Sep 17 00:00:00 2001 From: Samarth Narang Date: Tue, 27 May 2025 21:32:41 -0400 Subject: [PATCH 01/16] [clang-doc] Refactor error handling to use ExitOnError

[clang-tools-extra] [clang-doc] Refactor error handling to use ExitOnError (PR #141699)

2025-05-30 Thread Samarth Narang via cfe-commits
https://github.com/snarang181 updated https://github.com/llvm/llvm-project/pull/141699 >From f0b3184f2d4342eb0aacf3a77671556ac2e57650 Mon Sep 17 00:00:00 2001 From: Samarth Narang Date: Tue, 27 May 2025 21:32:41 -0400 Subject: [PATCH 01/15] [clang-doc] Refactor error handling to use ExitOnError

[clang-tools-extra] [clang-doc] Refactor error handling to use ExitOnError (PR #141699)

2025-05-30 Thread Samarth Narang via cfe-commits
https://github.com/snarang181 updated https://github.com/llvm/llvm-project/pull/141699 >From f0b3184f2d4342eb0aacf3a77671556ac2e57650 Mon Sep 17 00:00:00 2001 From: Samarth Narang Date: Tue, 27 May 2025 21:32:41 -0400 Subject: [PATCH 01/14] [clang-doc] Refactor error handling to use ExitOnError

[clang-tools-extra] [clang-doc] Refactor error handling to use ExitOnError (PR #141699)

2025-05-30 Thread Samarth Narang via cfe-commits
@@ -0,0 +1,29 @@ +/// Invalid output path (%t is a file, not a directory). +// RUN: rm -rf %t && touch %t +// RUN: not clang-doc %s -output=%t/subdir 2>&1 | FileCheck %s +// CHECK: clang-doc error: +// CHECK: {{(Not a directory|no such file or directory)}} + +/// Invalid format op

[clang-tools-extra] [clang-doc] Refactor error handling to use ExitOnError (PR #141699)

2025-05-29 Thread Samarth Narang via cfe-commits
snarang181 wrote: @ilovepi, wrapped the creation of the `Executor` in the error handler, created a helper like you suggested, and added a test case for the creation of the `Executor` failing. https://github.com/llvm/llvm-project/pull/141699 ___ cfe-

[clang-tools-extra] [clang-doc] Refactor error handling to use ExitOnError (PR #141699)

2025-05-29 Thread Samarth Narang via cfe-commits
https://github.com/snarang181 updated https://github.com/llvm/llvm-project/pull/141699 >From 1cddd0889b2aa322e1d1fce1225d6da0f5e8cc20 Mon Sep 17 00:00:00 2001 From: Samarth Narang Date: Tue, 27 May 2025 21:32:41 -0400 Subject: [PATCH 01/12] [clang-doc] Refactor error handling to use ExitOnError

[clang-tools-extra] [clang-doc] Refactor error handling to use ExitOnError (PR #141699)

2025-05-29 Thread Samarth Narang via cfe-commits
@@ -284,10 +284,7 @@ Example usage for a project using a compile commands database: {UserStylesheets.begin(), UserStylesheets.end()}}; if (Format == "html") { -if (auto Err = getHtmlAssetFiles(argv[0], CDCtx)) { - llvm::errs() << toString(std::move(Err)) << "

[clang-tools-extra] [clang-doc] Refactor error handling to use ExitOnError (PR #141699)

2025-05-29 Thread Samarth Narang via cfe-commits
@@ -0,0 +1,12 @@ +// Test: Invalid output path (%t is a file, not a directory) +// RUN: rm -rf %t && echo "not a dir" > %t +// RUN: not clang-doc %s -output=%t/subdir 2>&1 | FileCheck --check-prefix=BAD-OUTPUT %s + +// BAD-OUTPUT: clang-doc error: +// BAD-OUTPUT: {{(Not a directo

[clang-tools-extra] [clang-doc] Refactor error handling to use ExitOnError (PR #141699)

2025-05-29 Thread Samarth Narang via cfe-commits
@@ -371,22 +368,15 @@ Example usage for a project using a compile commands database: sortUsrToInfo(USRToInfo); // Ensure the root output directory exists. - if (std::error_code Err = llvm::sys::fs::create_directories(OutDirectory); - Err != std::error_code()) { -

[clang-tools-extra] [clang-doc] Refactor error handling to use ExitOnError (PR #141699)

2025-05-29 Thread Samarth Narang via cfe-commits
@@ -0,0 +1,12 @@ +// Test: Invalid output path (%t is a file, not a directory) +// RUN: rm -rf %t && echo "not a dir" > %t +// RUN: not clang-doc %s -output=%t/subdir 2>&1 | FileCheck --check-prefix=BAD-OUTPUT %s + +// BAD-OUTPUT: clang-doc error: +// BAD-OUTPUT: {{(Not a directo

[clang-tools-extra] [clang-doc] Refactor error handling to use ExitOnError (PR #141699)

2025-05-29 Thread Samarth Narang via cfe-commits
@@ -0,0 +1,12 @@ +// Test: Invalid output path (%t is a file, not a directory) snarang181 wrote: Thanks for the pointer. https://github.com/llvm/llvm-project/pull/141699 ___ cfe-commits mailing list cfe-commits@lists.

[clang-tools-extra] [clang-doc] Refactor error handling to use ExitOnError (PR #141699)

2025-05-29 Thread Samarth Narang via cfe-commits
https://github.com/snarang181 edited https://github.com/llvm/llvm-project/pull/141699 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-doc] Refactor error handling to use ExitOnError (PR #141699)

2025-05-29 Thread Samarth Narang via cfe-commits
@@ -300,7 +297,7 @@ Example usage for a project using a compile commands database: "these files and continue:\n" << toString(std::move(Err)) << "\n"; else { - llvm::errs() << toString(std::move(Err)) << "\n"; s

[clang-tools-extra] [clang-doc] Refactor error handling to use ExitOnError (PR #141699)

2025-05-29 Thread Samarth Narang via cfe-commits
snarang181 wrote: Also, from the CI test run, I see the Linux build failing. This seems unrelated, right? Does it warrant a rerun? ``` /home/gha/actions-runner/_work/llvm-project/llvm-project/libc/test/src/math/smoke/HypotTest.h:31: FAILURE Failed to match aNaN against LIBC_NAMESPACE::testing:

[clang-tools-extra] [clang-doc] Refactor error handling to use ExitOnError (PR #141699)

2025-05-29 Thread Samarth Narang via cfe-commits
snarang181 wrote: @ilovepi, thanks for the patience and taking out the time to give detailed reviews. I will work on addresing your comments. One word on the tests: I was trying to test some of the other fail conditions but seems like a lot of the error conditions are caught by the parsing ear

[clang-tools-extra] [clang-doc] Refactor error handling to use ExitOnError (PR #141699)

2025-05-29 Thread Samarth Narang via cfe-commits
https://github.com/snarang181 updated https://github.com/llvm/llvm-project/pull/141699 >From b2dc4f8a50d86ecdc5fd27fedd7efde5c6882df5 Mon Sep 17 00:00:00 2001 From: Samarth Narang Date: Tue, 27 May 2025 21:32:41 -0400 Subject: [PATCH 1/7] [clang-doc] Refactor error handling to use ExitOnError

[clang-tools-extra] [clang-doc] Refactor error handling to use ExitOnError (PR #141699)

2025-05-29 Thread Samarth Narang via cfe-commits
snarang181 wrote: @ilovepi -- In the updated version, I have used the `createFileError()` API and checked that the output is reliable. Also, I have renamed the lit test file; in the tests, I create a temporary file using `%t` and then obviously, it cannot create a directory there. Hopefully th

[clang-tools-extra] [clang-doc] Refactor error handling to use ExitOnError (PR #141699)

2025-05-29 Thread Samarth Narang via cfe-commits
https://github.com/snarang181 updated https://github.com/llvm/llvm-project/pull/141699 >From b2dc4f8a50d86ecdc5fd27fedd7efde5c6882df5 Mon Sep 17 00:00:00 2001 From: Samarth Narang Date: Tue, 27 May 2025 21:32:41 -0400 Subject: [PATCH 1/6] [clang-doc] Refactor error handling to use ExitOnError

[clang-tools-extra] [clang-doc] Refactor error handling to use ExitOnError (PR #141699)

2025-05-29 Thread Samarth Narang via cfe-commits
@@ -373,20 +370,16 @@ Example usage for a project using a compile commands database: // Ensure the root output directory exists. if (std::error_code Err = llvm::sys::fs::create_directories(OutDirectory); Err != std::error_code()) { -llvm::errs() << "Failed to cre

[clang-tools-extra] [clang-doc] Refactor error handling to use ExitOnError (PR #141699)

2025-05-28 Thread Samarth Narang via cfe-commits
https://github.com/snarang181 edited https://github.com/llvm/llvm-project/pull/141699 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-doc] Refactor error handling to use ExitOnError (PR #141699)

2025-05-28 Thread Samarth Narang via cfe-commits
@@ -0,0 +1,4 @@ +// RUN: not clang-doc %S/Inputs/basic-project/src/Circle.cpp -output=/root/docs 2>&1 | FileCheck %s snarang181 wrote: Sorry, I might be misunderstanding but won't `llvm::sys::fs::create_directories()` create a valid directory path? Giving the

[clang-tools-extra] [clang-doc] Refactor error handling to use ExitOnError (PR #141699)

2025-05-28 Thread Samarth Narang via cfe-commits
@@ -373,20 +370,16 @@ Example usage for a project using a compile commands database: // Ensure the root output directory exists. if (std::error_code Err = llvm::sys::fs::create_directories(OutDirectory); Err != std::error_code()) { -llvm::errs() << "Failed to cre

[clang-tools-extra] [clang-doc] Refactor error handling to use ExitOnError (PR #141699)

2025-05-28 Thread Samarth Narang via cfe-commits
https://github.com/snarang181 updated https://github.com/llvm/llvm-project/pull/141699 >From b2dc4f8a50d86ecdc5fd27fedd7efde5c6882df5 Mon Sep 17 00:00:00 2001 From: Samarth Narang Date: Tue, 27 May 2025 21:32:41 -0400 Subject: [PATCH 1/2] [clang-doc] Refactor error handling to use ExitOnError

[clang-tools-extra] [clang-doc] Refactor error handling to use ExitOnError (PR #141699)

2025-05-28 Thread Samarth Narang via cfe-commits
https://github.com/snarang181 edited https://github.com/llvm/llvm-project/pull/141699 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-doc] Refactor error handling to use ExitOnError (PR #141699)

2025-05-28 Thread Samarth Narang via cfe-commits
snarang181 wrote: @ilovepi, requesting your review here. https://github.com/llvm/llvm-project/pull/141699 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits