From: Joel Fernandes <joel@joelfernandes.org>
To: Nick Desaulniers <ndesaulniers@google.com>
Cc: rcu@vger.kernel.org, nathan@kernel.org, trix@redhat.com,
llvm@lists.linux.dev, linux-kernel@vger.kernel.org,
paulmck@kernel.org
Subject: Re: clangd cannot handle tree_nocb.h
Date: Tue, 18 Apr 2023 20:36:11 +0000 [thread overview]
Message-ID: <20230418203611.GA3640630@google.com> (raw)
In-Reply-To: <CAKwvOd=yQS+0oDC46Hc5D_V0JET8=xbQmAJrpBdg7c4i2EyqHg@mail.gmail.com>
On Fri, Apr 14, 2023 at 03:47:51PM -0700, Nick Desaulniers wrote:
> On Thu, Apr 13, 2023 at 5:53 PM Joel Fernandes <joel@joelfernandes.org> wrote:
> >
> > Hello!
> >
> > I have been trying to get clangd working properly with tree_nocb.h. clangd
> > trips quite badly when trying to build tree_nocb.h to generate ASTs.
>
> Hi Joel,
> Thanks for the report. What are you using clangd for? I'll bet
> something interesting.
Thanks for the response and sorry for the late reply. I am at the OSPM
conference. I use vim and vscode with clangd. In vim, YCM uses it to
highlight compiler errors live while editing, I am pretty happy with it so
far and has been a huge time saver. Enough that now I want to use it for
everything...
I first came across clangd when developing Chrome userspace code which is C++
:). In Chrome, ninja builds can be made to output compile_commands.json.
However, now I noticed the support in the kernel and was like, wow I need to
try it. Further, YCM seems to work much better with it than without :)
> I've never used it myself, so I don't know where to even begin with
> how to reproduce the issue.
Ah ok. :). When I ran get_maintainer on the script, your name popped up and
someone also suggested that you're the goto person for clang on the kernel
(which I kind of already knew ;)
> It might be worth filing a bug upstream at
> https://github.com/llvm/llvm-project/issues
> or internally under the component
> Language Platforms > C++ > Clang > Tools > Clangd
> with detailed steps to reproduce (and what the observed error actually
> is). Feel free to cc me, though I don't know the first thing about
> clangd.
Ok I will consider doing this if needed. One thing I do observe is lack of
good support for header files and it is a known clangd issue [1].
However, the fixes I was proposing can purely be done in the kernel itself
since all it'd require is generating compile_compands.json with the -D<macro>
and editing files to keep clangd happy. I guess one question is, how welcome
would such changes to header files be since they're for tooling and isn't
code that will be compiled outside of clangd.
(Linked issue may not directly related to what I'm saying)
[1] https://discourse.llvm.org/t/header-file-heuristics-issue/1749
Thanks.
next prev parent reply other threads:[~2023-04-18 20:36 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-14 0:53 clangd cannot handle tree_nocb.h Joel Fernandes
2023-04-14 1:11 ` Joel Fernandes
2023-04-14 1:16 ` Joel Fernandes
2023-04-14 22:47 ` Nick Desaulniers
2023-04-18 16:28 ` Nick Desaulniers
2023-04-19 13:00 ` Florent Revest
2023-04-19 20:02 ` Fangrui Song
2023-04-20 11:50 ` David Laight
2023-04-29 6:18 ` Joel Fernandes
2023-04-18 20:36 ` Joel Fernandes [this message]
2023-04-18 20:46 ` Nick Desaulniers
2023-04-18 21:03 ` Joel Fernandes
2023-04-18 21:45 ` Joel Fernandes
2023-04-19 22:55 ` Nick Desaulniers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230418203611.GA3640630@google.com \
--to=joel@joelfernandes.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=paulmck@kernel.org \
--cc=rcu@vger.kernel.org \
--cc=trix@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox