[clang-tools-extra] Add new tool: clang-read-diagnostics (PR #118522)

2024-12-10 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 closed https://github.com/llvm/llvm-project/pull/118522 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Add new tool: clang-read-diagnostics (PR #118522)

2024-12-06 Thread Yuxuan Chen via cfe-commits
yuxuanchen1997 wrote: > > > so we don't need to carry around multiple implementations of > > > machine-readable diagnostic information. > > > > > > I just realized that we also have `-diagnostic-log-file` as a cc1 flag. > > This logs into an XML. Is this preferred to the binary format or no?

[clang-tools-extra] Add new tool: clang-read-diagnostics (PR #118522)

2024-12-06 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > so we don't need to carry around multiple implementations of > > machine-readable diagnostic information. > > I just realized that we also have `-diagnostic-log-file` as a cc1 flag. This > logs into an XML. Is this preferred to the binary format or no? I don't think ei

[clang-tools-extra] Add new tool: clang-read-diagnostics (PR #118522)

2024-12-06 Thread Yuxuan Chen via cfe-commits
yuxuanchen1997 wrote: > so we don't need to carry around multiple implementations of machine-readable > diagnostic information. I just realized that we also have `-diagnostic-log-file` as a cc1 flag. This logs into an XML. Is this preferred to the binary format or no? https://github.com/llvm

[clang-tools-extra] Add new tool: clang-read-diagnostics (PR #118522)

2024-12-06 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > I'd like to understand the motivation for the tool a bit better. IMO, the > > goal should be to deprecate serialized diagnostics because we are now able > > to emit diagnostics to SARIF instead, and the whole point to SARIF is to be > > a machine-readable interchange fo

[clang-tools-extra] Add new tool: clang-read-diagnostics (PR #118522)

2024-12-06 Thread Yuxuan Chen via cfe-commits
yuxuanchen1997 wrote: > I'd like to understand the motivation for the tool a bit better. IMO, the > goal should be to deprecate serialized diagnostics because we are now able to > emit diagnostics to SARIF instead, and the whole point to SARIF is to be a > machine-readable interchange format f

[clang-tools-extra] Add new tool: clang-read-diagnostics (PR #118522)

2024-12-06 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: I'd like to understand the motivation for the tool a bit better. IMO, the goal should be to deprecate serialized diagnostics because we are now able to emit diagnostics to SARIF instead, and the whole point to SARIF is to be a machine-readable interch

[clang-tools-extra] Add new tool: clang-read-diagnostics (PR #118522)

2024-12-04 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 updated https://github.com/llvm/llvm-project/pull/118522 >From 5860f5f25e04930c72dcdb9f0ee4d7386cbcb3d3 Mon Sep 17 00:00:00 2001 From: Yuxuan Chen Date: Mon, 2 Dec 2024 15:15:30 -0800 Subject: [PATCH 01/12] start working on the new tool --- .../clang-read-dia

[clang-tools-extra] Add new tool: clang-read-diagnostics (PR #118522)

2024-12-04 Thread Jon Roelofs via cfe-commits
jroelofs wrote: Looks okay to me, but let me tag some clang-tools-extra folks for a second look. https://github.com/llvm/llvm-project/pull/118522 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cf

[clang-tools-extra] Add new tool: clang-read-diagnostics (PR #118522)

2024-12-04 Thread Jon Roelofs via cfe-commits
@@ -0,0 +1,15 @@ +// REQUIRES: clang +// RUN: not %clang %s -serialize-diagnostics %s.diag jroelofs wrote: recommend putting the new file under `%t` instead of `%s`, so this doesn't pollute the source dir. https://github.com/llvm/llvm-project/pull/118522 __

[clang-tools-extra] Add new tool: clang-read-diagnostics (PR #118522)

2024-12-04 Thread Yuxuan Chen via cfe-commits
yuxuanchen1997 wrote: > > Looking at the test failure, it appears that when only building > > `check-clang-tools`, no `clang` binary was built. So the test driver cannot > > find `clang`. Maybe this diagnostics binary file should be checked in for > > the test? That will not catch future error

[clang-tools-extra] Add new tool: clang-read-diagnostics (PR #118522)

2024-12-04 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 updated https://github.com/llvm/llvm-project/pull/118522 >From 5860f5f25e04930c72dcdb9f0ee4d7386cbcb3d3 Mon Sep 17 00:00:00 2001 From: Yuxuan Chen Date: Mon, 2 Dec 2024 15:15:30 -0800 Subject: [PATCH 01/11] start working on the new tool --- .../clang-read-dia

[clang-tools-extra] Add new tool: clang-read-diagnostics (PR #118522)

2024-12-04 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 updated https://github.com/llvm/llvm-project/pull/118522 >From 5860f5f25e04930c72dcdb9f0ee4d7386cbcb3d3 Mon Sep 17 00:00:00 2001 From: Yuxuan Chen Date: Mon, 2 Dec 2024 15:15:30 -0800 Subject: [PATCH 01/10] start working on the new tool --- .../clang-read-dia

[clang-tools-extra] Add new tool: clang-read-diagnostics (PR #118522)

2024-12-04 Thread Jon Roelofs via cfe-commits
jroelofs wrote: > Looking at the test failure, it appears that when only building > `check-clang-tools`, no `clang` binary was built. So the test driver cannot > find `clang`. Maybe this diagnostics binary file should be checked in for the > test? That will not catch future errors if the diagn

[clang-tools-extra] Add new tool: clang-read-diagnostics (PR #118522)

2024-12-04 Thread Yuxuan Chen via cfe-commits
yuxuanchen1997 wrote: Looking at the test failure, it appears that when only building `check-clang-tools`, no `clang` binary was built. So the test driver cannot find `clang`. Maybe this diagnostics binary file should be checked in for the test? That will not catch future errors if the diagnos

[clang-tools-extra] Add new tool: clang-read-diagnostics (PR #118522)

2024-12-03 Thread Jon Roelofs via cfe-commits
@@ -0,0 +1,14 @@ +// RUN: %clang %s -serialize-diagnostics %s.diag || true jroelofs wrote: ```suggestion // RUN: not %clang %s -serialize-diagnostics %s.diag ``` https://github.com/llvm/llvm-project/pull/118522 ___ cfe

[clang-tools-extra] Add new tool: clang-read-diagnostics (PR #118522)

2024-12-03 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 updated https://github.com/llvm/llvm-project/pull/118522 >From 5860f5f25e04930c72dcdb9f0ee4d7386cbcb3d3 Mon Sep 17 00:00:00 2001 From: Yuxuan Chen Date: Mon, 2 Dec 2024 15:15:30 -0800 Subject: [PATCH 1/8] start working on the new tool --- .../clang-read-diagn

[clang-tools-extra] Add new tool: clang-read-diagnostics (PR #118522)

2024-12-03 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 updated https://github.com/llvm/llvm-project/pull/118522 >From 5860f5f25e04930c72dcdb9f0ee4d7386cbcb3d3 Mon Sep 17 00:00:00 2001 From: Yuxuan Chen Date: Mon, 2 Dec 2024 15:15:30 -0800 Subject: [PATCH 1/7] start working on the new tool --- .../clang-read-diagn

[clang-tools-extra] Add new tool: clang-read-diagnostics (PR #118522)

2024-12-03 Thread Yuxuan Chen via cfe-commits
@@ -0,0 +1,10 @@ +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..) yuxuanchen1997 wrote: Oops... Copied from a boilerplate. https://github.com/llvm/llvm-project/pull/118522 ___ cfe-commits mailing list cfe-commits@

[clang-tools-extra] Add new tool: clang-read-diagnostics (PR #118522)

2024-12-03 Thread Jon Roelofs via cfe-commits
@@ -0,0 +1,129 @@ +//=== ClangReadDiagnostics.cpp - clang-read-diagnostics tool --===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang-tools-extra] Add new tool: clang-read-diagnostics (PR #118522)

2024-12-03 Thread Jon Roelofs via cfe-commits
@@ -0,0 +1,10 @@ +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..) jroelofs wrote: I'm not sure this is necessary. https://github.com/llvm/llvm-project/pull/118522 ___ cfe-commits mailing list cfe-commits@lists.llvm

[clang-tools-extra] Add new tool: clang-read-diagnostics (PR #118522)

2024-12-03 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 updated https://github.com/llvm/llvm-project/pull/118522 >From 5860f5f25e04930c72dcdb9f0ee4d7386cbcb3d3 Mon Sep 17 00:00:00 2001 From: Yuxuan Chen Date: Mon, 2 Dec 2024 15:15:30 -0800 Subject: [PATCH 1/6] start working on the new tool --- .../clang-read-diagn

[clang-tools-extra] Add new tool: clang-read-diagnostics (PR #118522)

2024-12-03 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff bee33b5291a28aec76e98c0da25349266c7b653c e045e2db7367a0168d6fd40eace481d2074e91af --e

[clang-tools-extra] Add new tool: clang-read-diagnostics (PR #118522)

2024-12-03 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tools-extra Author: Yuxuan Chen (yuxuanchen1997) Changes As of today, one can make clang serialize diagnostics to a file with the flag `-serialize-diagnostics`. For example: ``` // file errors_and_warning.c #include int forgot_return()

[clang-tools-extra] Add new tool: clang-read-diagnostics (PR #118522)

2024-12-03 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 created https://github.com/llvm/llvm-project/pull/118522 As of today, one can make clang serialize diagnostics to a file with the flag `-serialize-diagnostics`. For example: ``` // file errors_and_warning.c #include int forgot_return() {} int main() { pri