bloomberg / clangmetatool

A framework for reusing code in Clang tools
https://bloomberg.github.io/clangmetatool/
Apache License 2.0
119 stars 25 forks source link

Move to LLVM-9, retire checks for LLVM-6 and update CI #45

Closed envp closed 4 years ago

envp commented 4 years ago

Issue number of the reported bug or feature request

Internal ticket

Describe your changes

1. Move code to build against LLVM-9

src/collectors/include_graph/include_finder.h, and rc/collectors/include_graph/include_finder.cpp, used the LLVM_VERSION macros to declare overrides for a method.

This was previously introduced because of an API change by LLVM (via #23). These are no longer necessary as LLVM-8 is now the minimum version required for our toolset.

2. Refactor CI

We use a .travis.clang$LLVM_VERSION.Dockerfile for each $LLVM_VERSION we support. I noticed these were somewhat out of sync with the toolchains and libraries installed.

I've merged these two into a single Dockerfile that can specify a default LLVM_VERSION and ubuntu release to build against.

travis.yml has been updated to test with the right build args. This change should allow us to run broader matrix CI builds, if necessary.

3. Change test suite to use death tests where appropriate

As pointed out by @dbeer1 LLVM on ubuntu is built with -fno-exceptions, which conflicts with our code. This issue was exposed when a build against LLVM-9 was attempted, and we failed to catch the exception we tried to throw in our tests (because libstdc++ failed stack unwind information in a parent of the frame that threw the exception)

The function now returns a boolean if successful, and crashes on failure, the tests have been updated to test for this behaviour.

The tool-application-support tests don't work on macOS yet, so I've added a macro to disable them if the target architecture is an apple device, so that it is clear that this is a known issue.

Testing performed

Built and tested with the following parameters, and it passes: