[cfe-dev] ASTImporter patches and improvements, please help

Gábor Márton via cfe-dev cfe-dev at lists.llvm.org
Sat Dec 1 08:00:37 PST 2018


Dear LLDB Developers,

There is an ongoing activity to improve ASTImporter in Clang to make it
support
C++ (and C) completely and correctly.  Our team works on cross translation
unit
(CTU) static analysis where we use the in-tree Clang static analyzer in
combination with the ASTImporter (via the scan-build.py script or
CodeChecker).
In the past 18 months we have committed more than 70 patches to make the
ASTImporter better.  Our primary target is Linux and we do run the LLDB
tests
on Linux before we commit.  Unfortunately, quite recently 3 of these patches
broke the LLDB macOS buildbots (green.lab.llvm.org/green/view/LLDB) and this
caused some turmoil.  We are very sorry about this and we are making
actions to
avoid such inconveniences in the future: We ordered a Mac Mini, until it
arrives we are using a borrowed Mac Book. We are going to create a CI job
which
will execute the macOS LLDB test suite for a specific patch. Besides this,
for
every patch we are going to monitor the macOS buildbots once they are
committed.

However, we are experiencing problems both with the buildbots and with the
LLDB
tests, therefore we are asking help from the LLDB community in the
following:

(1) Apparently, the green lab macOS buildbots are not displayed in the build
bot console (http://lab.llvm.org:8011/console). More importantly they are
not
capable of sending emails to the authors of the commit in case of failure.
Would it be possible to setup the these buildbots to send out the emails for
the authors?

(2) We are facing difficulties with the LLDB lit tests both on macOS and on
Linux. E.g. on a fresh macOS mojave install, checking out master LLVM,
Clang,
LLDB and then executing ninja check-lldb fails immediately.  On Linux we
experienced that some tests fail because they try to read a non-existent
register. Some tests fail non-deterministically because they can't kill a
process or a timeout is not long enough. Some tests fail because of a linker
error of libcxx. We would like to address all these issues. Would you like
to
discuss these issues on lldb-dev or should we create a bugzilla ticket for
each?

(3) ASTImporter unit tests and lit tests in Clang for the LLDB specific
usage
are very-very limited.  LLDB uses the so called "minimal" import, but none
of
the unit tests exercises that (CTU uses the full import).  We should have a
unit test suite where the LLDB use cases are covered, e.g. after a minimal
import an `importDefinition` is called. Also, a test double which implements
the ExternalASTSource could be used.  I believe it would be possible to
cover
with the unit tests all LLDB/macOS related scenarios and these tests could
run
on Linux too.  We do something similar in case of windows: we execute all
unit
tests with "-fdelayed-template-parsing" and with "-fms-compatibility" too. I
think, the more unit tests we have in Clang the sooner we catch the LLDB
specific importer errors.  I am asking the LLDB community's help here,
because
we lack the domain knowledge in LLDB so we don't know what expectations
should
we write in each unit test cases.  (About lit tests, there is
clang-import-test
but its coverage seems pretty low and I don't know if that really exercises
all
LLDB use cases.)

I think that from a better ASTImporter the LLDB debugger can benefit too:
the
`expr` command might give better experience by supporting more C++
constructs
and by giving better diagnostics.

Thank you,
Gabor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20181201/529fa3e1/attachment.html>


More information about the cfe-dev mailing list