[clang] [llvm][tblgen] Add `SourcePath` for `emitSourceFileHeader` (PR #65744)

2023-09-25 Thread NAKAMURA Takumi via cfe-commits
" + sys::path::filename(Record.getInputFilename())," In-Reply-To: https://github.com/chapuni approved this pull request. Looks good. At the moment, this doesn't emit `path` but `file name`. Since I'll push reformatting, could you rebase, squash, and retitle before pushing? I guess we could e

[clang] [llvm][tblgen] Add `SourcePath` for `emitSourceFileHeader` (PR #65744)

2023-09-25 Thread Shao-Ce SUN via cfe-commits
" + sys::path::filename(Record.getInputFilename())," In-Reply-To: sunshaoce wrote: Addressed. Thanks! Now it is ``` /*===- TableGen'erated file -*- C++ -*-===*\ |**| |* ValueTypes Sou

[clang] [llvm][tblgen] Add `SourcePath` for `emitSourceFileHeader` (PR #65744)

2023-09-25 Thread Shao-Ce SUN via cfe-commits
" + sys::path::filename(Record.getInputFilename())," In-Reply-To: https://github.com/sunshaoce updated https://github.com/llvm/llvm-project/pull/65744 >From 23d0b738bf40ea44e159f4f8d7355d4d6bc0688d Mon Sep 17 00:00:00 2001 From: Shao-Ce SUN Date: Sat, 23 Sep 2023 11:38:33 +0800 Subject: [PATC

[clang] [llvm][tblgen] Add `SourcePath` for `emitSourceFileHeader` (PR #65744)

2023-09-25 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > I am not sure how to keep only the `llvm-project//Filename` path except > by hard-coding. Or how about only keeping the base file name? This could > limit it to within 80 characters. I'd recommend using this API: https://github.com/llvm/llvm-project/blob/2f23666ae7e4

[clang] [llvm][tblgen] Add `SourcePath` for `emitSourceFileHeader` (PR #65744)

2023-09-25 Thread Shao-Ce SUN via cfe-commits
sunshaoce wrote: I am not sure how to keep only the `llvm-project//Filename` path except by hard-coding. Or how to keep only the base file name? This could limit it to within 80 characters. https://github.com/llvm/llvm-project/pull/65744 ___ cfe-

[clang] [llvm][tblgen] Add `SourcePath` for `emitSourceFileHeader` (PR #65744)

2023-09-25 Thread Aaron Ballman via cfe-commits
@@ -59,4 +60,8 @@ void llvm::emitSourceFileHeader(StringRef Desc, raw_ostream &OS) { printLine(OS, Prefix, ' ', Suffix); printLine(OS, "\\*===", '-', "===*/"); OS << '\n'; + + // Print the path of source file + if (!Record.getInputFilename().empty()) +OS << "// Gen

[clang] [llvm][tblgen] Add `SourcePath` for `emitSourceFileHeader` (PR #65744)

2023-09-25 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni requested changes to this pull request. Hang on, would it expose build paths to installed headers? https://github.com/llvm/llvm-project/pull/65744 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org

[clang] [llvm][tblgen] Add `SourcePath` for `emitSourceFileHeader` (PR #65744)

2023-09-25 Thread NAKAMURA Takumi via cfe-commits
@@ -59,4 +60,8 @@ void llvm::emitSourceFileHeader(StringRef Desc, raw_ostream &OS) { printLine(OS, Prefix, ' ', Suffix); printLine(OS, "\\*===", '-', "===*/"); OS << '\n'; + + // Print the path of source file + if (!Record.getInputFilename().empty()) +OS << "// Gen

[clang] [llvm][tblgen] Add `SourcePath` for `emitSourceFileHeader` (PR #65744)

2023-09-25 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM (fine to land without tests as it only adds comments to generated header files) https://github.com/llvm/llvm-project/pull/65744 ___ cfe-commits mailing list cfe-commits@lists.llvm.org ht

[clang] [llvm][tblgen] Add `SourcePath` for `emitSourceFileHeader` (PR #65744)

2023-09-25 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > @tru I'd ask @AaronBallman. My vote would be to reformat. > > Not as a requirement for this patch, I imagine? If we wanted to reformat the file as an NFC commit (before or after this patch), that would be fine. But let's please not reformat as part of this patch (that

[clang] [llvm][tblgen] Add `SourcePath` for `emitSourceFileHeader` (PR #65744)

2023-09-25 Thread Renato Golin via cfe-commits
rengolin wrote: > @tru I'd ask @AaronBallman. My vote would be to reformat. Not as a requirement for this patch, I imagine? https://github.com/llvm/llvm-project/pull/65744 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/

[clang] [llvm][tblgen] Add `SourcePath` for `emitSourceFileHeader` (PR #65744)

2023-09-25 Thread via cfe-commits
cor3ntin wrote: @tru I'd ask @AaronBallman. My vote would be to reformat. https://github.com/llvm/llvm-project/pull/65744 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm][tblgen] Add `SourcePath` for `emitSourceFileHeader` (PR #65744)

2023-09-25 Thread Tobias Hieta via cfe-commits
tru wrote: Looking at it - it seems like none of Tablegen is correctly clang-formatted. If that's not desired, maybe it should have a local .clang-format file to disable the formatting of these files. Do we have a clang-tblgen maintainer? Couldn't find anything in the codeowners and git log h

[clang] [llvm][tblgen] Add `SourcePath` for `emitSourceFileHeader` (PR #65744)

2023-09-25 Thread Tobias Hieta via cfe-commits
tru wrote: No I don't think it's job's fault. I ran clang-format on this file and it's not formatted at all, so I think when we ask it to just format a patch like we do in the job, it gets a bit confused and give you a bit of non-sense formatting. This is just a limitation of not running forma

[clang] [llvm][tblgen] Add `SourcePath` for `emitSourceFileHeader` (PR #65744)

2023-09-25 Thread Renato Golin via cfe-commits
rengolin wrote: > Is this suggestion correct? Doesn't look right to me. I seems it's suggesting 4 spaces tabs, which isn't what we normally use. Something wrong with the clang-format job, maybe? @tru @tstellar https://github.com/llvm/llvm-project/pull/65744 __

[clang] [llvm][tblgen] Add `SourcePath` for `emitSourceFileHeader` (PR #65744)

2023-09-25 Thread Shao-Ce SUN via cfe-commits
sunshaoce wrote: > ⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️ > > You can test this locally with the following command: > ```shell > git-clang-format --diff b8b4ee6b450766796b162b4811a6b3f723d07268 > d07486764071679c8cbcd5e7c4905eb41b4770b3 -- > clang/utils/TableGen/Cl

[clang] [llvm][tblgen] Add `SourcePath` for `emitSourceFileHeader` (PR #65744)

2023-09-23 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 b8b4ee6b450766796b162b4811a6b3f723d07268 d07486764071679c8cbcd5e7c4905eb41b4770b3 --

[clang] [llvm][tblgen] Add `SourcePath` for `emitSourceFileHeader` (PR #65744)

2023-09-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-mlir-llvm Changes I think this is very helpful for reading generated `.inc` files. --- Patch is 31.85 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/65744.diff 22 Files Affected: - (modified) clang/utils/T

[clang] [llvm][tblgen] Add `SourcePath` for `emitSourceFileHeader` (PR #65744)

2023-09-23 Thread Shao-Ce SUN via cfe-commits
https://github.com/sunshaoce updated https://github.com/llvm/llvm-project/pull/65744 >From 23d0b738bf40ea44e159f4f8d7355d4d6bc0688d Mon Sep 17 00:00:00 2001 From: Shao-Ce SUN Date: Sat, 23 Sep 2023 11:38:33 +0800 Subject: [PATCH 1/2] [llvm][tblgen] Add `SourcePath` for `emitSourceFileHeader`