Age | Commit message (Collapse) | Author | Files | Lines |
|
Update for LLVM 13
See merge request tartan/tartan!12
|
|
scripts: Improve POSIX compatibility
See merge request tartan/tartan!13
|
|
- Size was renamed to Extent
https://github.com/llvm/llvm-project/commit/9b3df78b4c2ab7a7063e532165492e1ffa38d401
../clang-plugin/gerror-checker.cpp:81:10: fatal error: clang/StaticAnalyzer/Core/PathSensitive/DynamicSize.h: No such file or directory
81 | #include <clang/StaticAnalyzer/Core/PathSensitive/DynamicSize.h>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- RValues are called PRValues as per C++11 taxonomy
https://github.com/llvm/llvm-project/commit/aef5d8fdc7d0d348125d5ecf4a13be5888eb1654
../clang-plugin/assertion-extracter.cpp:72:39: error: 'VK_RValue' was not declared in this scope
72 | VK_RValue, OK_Ordinary, SourceLocation (),
| ^~~~~~~~~
|
|
- isIntegerConstantExpr that returns value has been renamed
https://github.com/llvm/llvm-project/commit/36036aa70ec1df7b51b5d30b2dd8090ad2b6e783
../clang-plugin/assertion-extracter.cpp:194:50: error: cannot convert 'llvm::APSInt' to 'const clang::ASTContext&'
194 | expr->isIntegerConstantExpr (bool_expr, context) &&
| ^~~~~~~~~
| |
| llvm::APSInt
|
|
- UnaryOperator::UnaryOperator takes extra arguments:
https://github.com/llvm/llvm-project/commit/f5360d4bb3376347479d86547d21b95d80be786d
../clang-plugin/assertion-extracter.cpp:74:58: error: no matching function for call to 'clang::UnaryOperator::UnaryOperator(clang::Expr*&, clang::UnaryOperatorKind, clang::QualType, clang::ExprValueKind, clang::ExprObjectKind, clang::SourceLocation, bool)'
74 | /* can_overflow = */ false);
| ^
- FPOptions argument of {Unary,Binary}Operator::Create was changed to FPOptionsOverride type:
https://github.com/llvm/llvm-project/commit/f4aaed3bf16b3c07152c7a47d1a363a8267ebcf1
../clang-plugin/assertion-extracter.cpp:74:39: error: cannot convert 'clang::FPOptions' to 'clang::FPOptionsOverride'
74 | FPOptions(context.getLangOpts()));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| clang::FPOptions
- BinaryOperator wants to use a constructor method
https://github.com/llvm/llvm-project/commit/2ba4e3a4598b165245c581c506a813cd4a7dce33
../clang-plugin/assertion-extracter.cpp:85:45: error: no matching function for call to 'clang::BinaryOperator::BinaryOperator(clang::Expr*&, clang::Expr*&, clang::BinaryOperatorKind, clang::QualType, clang::ExprValueKind, clang::ExprObjectKind, clang::SourceLocation, clang::FPOptions)'
85 | FPOptions ());
| ^
- SymbolicRegion::getExtent has been removed
https://github.com/llvm/llvm-project/commit/601687bf731a33364a7de0ece7acd1c17c9dd60d
../clang-plugin/gerror-checker.cpp:707:52: error: 'const class clang::ento::SymbolicRegion' has no member named 'getExtent'
707 | symbolic_allocated_region->getExtent (sval_builder);
| ^~~~~~~~~
|
|
- It switched to C++14
In file included from /nix/store/ida6b9zgxsw5xa7z8s1y0n42z60lzw2q-llvm-11.1.0-dev/include/llvm/ADT/APInt.h:19,
from /nix/store/ida6b9zgxsw5xa7z8s1y0n42z60lzw2q-llvm-11.1.0-dev/include/llvm/ADT/APSInt.h:17,
from /nix/store/w9pancs07lxapsnv8llwkzx73xc1x29l-clang-11.1.0-dev/include/clang/Basic/FixedPoint.h:19,
from /nix/store/w9pancs07lxapsnv8llwkzx73xc1x29l-clang-11.1.0-dev/include/clang/AST/APValue.h:16,
from /nix/store/w9pancs07lxapsnv8llwkzx73xc1x29l-clang-11.1.0-dev/include/clang/AST/Expr.h:16,
from /build/tartan/build/meson-private/tmp46ad89j3/testfile.cpp:2:
/nix/store/ida6b9zgxsw5xa7z8s1y0n42z60lzw2q-llvm-11.1.0-dev/include/llvm/Support/MathExtras.h:396:23: error: 'enable_if_t' in namespace 'std' does not name a template type
396 | constexpr inline std::enable_if_t<(N < 64), bool> isUInt(uint64_t X) {
| ^~~~~~~~~~~
/nix/store/ida6b9zgxsw5xa7z8s1y0n42z60lzw2q-llvm-11.1.0-dev/include/llvm/Support/MathExtras.h:396:18: note: 'std::enable_if_t' is only available from C++14 onwards
- It uses std::make_unique
https://reviews.llvm.org/D66259
../clang-plugin/plugin.cpp:123:30: error: 'make_unique' is not a member of 'llvm'; did you mean 'std::make_unique'?
123 | return llvm::make_unique<MultiplexConsumer> (std::move (consumers));
| ^~~~~~~~~~~
- CheckName type was renamed:
https://github.com/llvm/llvm-project/commit/72649423c043341c770516cd73aecde281730260
../clang-plugin/gerror-checker.h:58:17: error: 'CheckName' does not name a type
58 | CheckName check_name_overwrite_set;
| ^~~~~~~~~
- ASTContext::getConstantArrayType takes an extra argument:
https://github.com/llvm/llvm-project/commit/772e266fbff40a566c9ef2d805c057c4692ac028
../clang-plugin/gsignal-checker.cpp:346:61: error: no matching function for call to 'clang::ASTContext::getConstantArrayType(clang::QualType&, llvm::APInt, clang::ArrayType::ArraySizeModifier, int) const'
346 | return context.getConstantArrayType (element_type,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
347 | llvm::APInt (32, fixed_size),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
348 | ArrayType::ArraySizeModifier::Static,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
349 | 0);
- BugReport was renamed to BasicBugReport
https://github.com/llvm/llvm-project/commit/2f169e7cdd9973d2aa4cba6b0a09126a5e7268ec
../clang-plugin/gerror-checker.cpp:781:40: required from here
/nix/store/i633yj06994wbb89b88nm5kb4pbm8h4r-gcc-11.3.0/include/c++/11.3.0/bits/unique_ptr.h:962:30: error: invalid new-expression of abstract class type 'clang::ento::BugReport'
962 | { return unique_ptr<_Tp>(new _Tp(std::forward<_Args>(__args)...)); }
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Constructors for attributes changed:
https://github.com/llvm/llvm-project/commit/6a24e8068052cd6b48295959ec4c44eb2ef819c5
../clang-plugin/gir-attributes.cpp:297:73: error: no matching function for call to 'clang::WarnUnusedAttr::WarnUnusedAttr(clang::SourceRange, clang::ASTContext&, int)'
297 | func.getASTContext (), 0);
| ^
Using the `Create` method instead of the previos dump since it will set the 0 `spellingListIndex` for us automatically when needed.
|
|
- Do not use which, which is external program that may not be installed.
- Fix other issues found by shellcheck.
|
|
Make tartan-build executable
See merge request tartan/tartan!11
|
|
|
|
all: Fix various typos and incorrect terminology
See merge request tartan/tartan!10
|
|
Done using:
```
codespell \
--builtin clear,rare,usage \
--skip './po/*' --skip './help/*/*.po' --skip './.git/*' --skip './NEWS*' \
--write-changes .
```
and then some manual checking and editing.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
|
|
- build: Meson build system
See merge request tartan/tartan!9
|
|
|
|
These warnings are flagged on Meson's warning_level=3.
|
|
Removes the existing Autotools build system and adds a new Meson one.
Also replaces the shell script test driver with a Python one, since
Meson already brings in a Python dependency.
Common operations:
- ./configure -> meson _build
- make -> ninja -C _build
- make install -> ninja -C _build install
- make check -> meson test -C _build
- make Tartan.pot-update -> ninja -C _build tartan-pot
- make update-po -> ninja -C _build tartan-update-po
To run the tests with coverage enabled and make a coverage report:
- meson _build -Db_coverage=true
- meson test -C _build
- ninja -C _build coverage-html
|
|
docs: Add remark about in-progress checkers
See merge request tartan/tartan!8
|
|
Follow-up from code review discussion on the development principles.
|
|
docs: Add development principles to HACKING
See merge request tartan/tartan!7
|
|
Add a script for processing compile_commands.json
Closes #39
See merge request tartan/tartan!5
|
|
We don’t consistently meet all these principles so far, but it would be
good to have something to aim for with future development.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
|
|
This adds a --typelib-path option to the plugin, which may be given more
than once. Each time the option is given, it adds a path to the list of
typelib search paths.
In order to deal with build directories given as typelib paths, we also
make sure to skip files in the typelib search path without the .typelib
extension.
See: #39
|
|
This seems to be necessary since -plugin-arg-tartan is an analyzer
option.
|
|
This script runs all the compilations listed in a compile_commands.json
file (generated by Meson and CMake) under the Tartan analyzer.
Use this script to analyze a whole project by passing it the compilation
database file generated by Meson or CMake. An example with Meson would
be:
$ meson _build
$ tartan-json _build/compile_commands.json
See: #39
|
|
Add Philip Chimento as co-maintainer
See merge request tartan/tartan!6
|
|
Signed-off-by: Philip Withnall <withnall@endlessm.com>
|
|
Run cleanly on C++ code
See merge request tartan/tartan!4
|
|
Signed-off-by: Philip Withnall <withnall@endlessm.com>
|
|
These are other AST node types that aren't relevant, but we should
account for them nonetheless so that they don't print a warning.
|
|
We assume that in any catch blocks, program state has already been
modified since an exception has been thrown, so we only look for
assertion statements in the try block.
|
|
This type of expression can occur in several instances, but primarily in
C++ where a temporary object is created. In is_assertion_stmt() and
_simplify_boolean_expr(), only consider the expression and ignore the
cleanups.
Adds some machinery to the build system and the test runner script so
that we can have test files in C++, for testing C++-only features.
|
|
Resolve "Support Clang 5.x"
Closes #5
See merge request tartan/tartan!2
|
|
bugs: Remove bugs-everywhere
Closes #2
See merge request tartan/tartan!3
|
|
It had bit-rotted. I’ve imported all the bugs into GitLab, and they can
be found here: https://gitlab.freedesktop.org/tartan/tartan/issues
Signed-off-by: Philip Withnall <withnall@endlessm.com>
Fixes: #2
|
|
The main difference here is that evalCall checkers have changed to take
a CallEvent& parameter rather than a CallExpr* parameter. For version 9
we convert the CallEvent& into a CallExpr* as soon as we receive it.
This may need to be refactored in the future, as CallEvent is the more
modern API and covers syntax that CallExpr doesn't cover, but that is a
large refactor better left for when it becomes necessary or when LLVM 9
becomes the minimum version.
|
|
The main API difference between Clang 7 and 8 that is relevant to us is
the rename of Expr::getLocStart() and Decl::getLocStart() to
getBeginLoc().
|
|
Some minor API changes are needed for this.
We also make 7.0 the minimum required version. It's the version
currently shipped in Debian Stable, so that's a good baseline. (At the
time of writing, 9.0.0 is the latest released version.)
Fixes: #5
|
|
Remove all the guards that checked for earlier versions.
See: #5
|
|
On macOS, clang will unhelpfully print "(framework directory)" after
some of its include paths. Filter this out, so that we don't
accidentally stick it in the tartan command line.
|
|
The previous code seems to be accidentally looking in the srcdir.
|
|
|
|
If $srcdir is a relative path, for example starts with "../", then the
temp files in this script will escape their temp dir. To prevent this,
use $(mktemp -d)/$abs_top_builddir as the temp dir, so that the relative
path has somewhere to go.
|
|
I was told by a Clang static analyzer developer that running the
analyzer without the core checkers enabled is not supported, and I've
seen that it can lead to crashes.
For this we need to make a few changes to the test programs. In
gvariant-iter we need to avoid tripping a warning from a core checker,
and in gerror-api we can remove two tests for cases that a core checker
already detects.
See https://bugs.llvm.org/show_bug.cgi?id=42816
|
|
The fancy quote here is considered part of the variable name, so
brackets are needed to delimit it.
|
|
__vectorcall is a callee-cleanup convention, so assume it is unsafe for
the same reason that the other callee-cleanup conventions are.
|
|
It seems that the surrounding code was updated without updating this
debug-only code.
|
|
According to a comment in configure.ac we don't link against the LLVM
libraries because they're so large and the symbols are resolved anyway
when the plugin is loaded. For that to work, we have to remove the
no-undefined flag, otherwise the linker will complain that all of the
symbols in the LLVM libraries are undefined.
|
|
C++ header files, unlike C header files, can contain a lot of inline
code which often produces compiler warnings when compilers add new
warning detection routines. If the header files are not directly under
your control then it's better to suppress warnings from them.
We do this for include directories that are _not_ /usr/include, since
otherwise we get into trouble with @include_next directives.
|
|
Use the POSIX -E flag to ensure they are treated as extended regular
expressions. They also seem to be overescaped.
|
|
The AX_CODE_COVERAGE broke API a while ago and will no longer build if
updating to the latest version. Instead, include the last known-working
version in a different file (tartan_code_coverage.m4) and rename the
macro to TARTAN_CODE_COVERAGE so it doesn't auto-update.
|
|
One of the downsides of keeping the macros in-tree is that they
periodically need updating.
|