Open bobhairgrove opened 3 weeks ago
There are some in-tree users of Tooling.h in clang-tools-extra you can use as reference (which are known to build because they're part of normal builds).
I agree it probably doesn't make sense to bootstrap clang in the directions in LibASTMatchersTutorial.rst . You could, anyway, but the gap between a random system compiler and a newly built clang is much smaller than it used to be.
It's very easy for the tutorial files to fall out of date, especially when the tutorial doesn't correspond to some in-tree code. The files in question are clang/docs/LibASTMatchersTutorial.rst and clang/docs/LibTooling.rst in the LLVM tree; patches to clarify would be welcome.
Hi!
This issue may be a good introductory issue for people new to working on LLVM. If you would like to work on this issue, your first steps are:
test/
create fine-grained testing targets, so you can e.g. use make check-clang-ast
to only run Clang's AST tests.git clang-format HEAD~1
to format your changes.If you have any further questions about this issue, don't hesitate to ask via a comment in the thread below.
@llvm/issue-subscribers-good-first-issue
Author: None (bobhairgrove)
Hi, I would like to work on this. Can someone please assign this to me? Thank you.
Nothing written here seems to work for me: https://clang.llvm.org/docs/LibASTMatchersTutorial.html
In my previous post, I describe my frustrating experience building LLVM and Clang from latest sources. After having finally successfully built and installed everything after following a different tutorial found on the LLVM homepage, I went back to the LibASTMatcher tutorial to see if I could continue with the steps starting after the
ninja install
command (which should besudo ninja install
).I didn't have
ccmake
installed (had to runsudo apt install cmake-curses-gui
), so I did that. But I could not figure out where I needed to run this from since the tutorial installed everything immediately under$HOME
and assumes that whoever is trying to use this tutorial would do the same. However, it seems that the step mentioned is to useclang
to (re)compile LLVM using Clang, which isn't really necessary.Then I went to this tutorial and tried to compile the very first example (using
TEST()
andEXPECT_TRUE()
. It doesn't compile, unfortunately, but nothing written there gives me a hint about what is going on. Compiling withg++
should work, but here is the output:Output:
I know that
TEST
andEXPECT_TRUE
are macros defined by Google test framework, but assume that they are somehow pulled in by theTooling.h
header. But perhaps not?Why do the tutorial writers assume that certain tools are already installed without even mentioning the dependencies? Since all of these tutorials are located on the official LLVM and Clang websites, one would assume that they would be better organized and tested...