summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2022-05-17Merge branch 'llvm-update' into 'master'HEADmasterPhilip Withnall9-72/+72
Update for LLVM 13 See merge request tartan/tartan!12
2022-05-17Merge branch 'no-which' into 'master'Philip Withnall2-16/+16
scripts: Improve POSIX compatibility See merge request tartan/tartan!13
2022-05-17Update for LLVM 13Jan Tojnar3-7/+7
- 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 (), | ^~~~~~~~~
2022-05-17Update for LLVM 12Jan Tojnar3-15/+13
- 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
2022-05-17Update for LLVM 11Jan Tojnar3-22/+20
- 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); | ^~~~~~~~~
2022-05-17Update for LLVM 10Jan Tojnar7-37/+41
- 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.
2022-05-17scripts: Improve POSIX compatibilityJan Tojnar2-16/+16
- Do not use which, which is external program that may not be installed. - Fix other issues found by shellcheck.
2021-12-23Merge branch 'tbx' into 'master'Philip Withnall1-0/+0
Make tartan-build executable See merge request tartan/tartan!11
2021-12-19Make tartan-build executableJan Tojnar1-0/+0
2020-06-18Merge branch 'codespell' into 'master'Philip Chimento1-1/+1
all: Fix various typos and incorrect terminology See merge request tartan/tartan!10
2020-06-18all: Fix various typos and incorrect terminologyPhilip Withnall1-1/+1
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>
2020-01-22Merge branch 'meson' into 'master'Philip Withnall37-2917/+377
- build: Meson build system See merge request tartan/tartan!9
2020-01-21gvariant-new: Correct spacing in expected error messagePhilip Chimento1-1/+1
2020-01-21build: Address compiler warningsPhilip Chimento4-11/+11
These warnings are flagged on Meson's warning_level=3.
2020-01-21build: Meson build systemPhilip Chimento32-2905/+365
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
2020-01-09Merge branch 'experimental-checkers-docs' into 'master'Philip Withnall1-1/+2
docs: Add remark about in-progress checkers See merge request tartan/tartan!8
2020-01-08docs: Add remark about in-progress checkersPhilip Chimento1-1/+2
Follow-up from code review discussion on the development principles.
2019-12-24Merge branch 'development-docs' into 'master'Philip Chimento1-0/+32
docs: Add development principles to HACKING See merge request tartan/tartan!7
2019-12-20Merge branch '39-compile-commands-json' into 'master'Philip Withnall4-8/+87
Add a script for processing compile_commands.json Closes #39 See merge request tartan/tartan!5
2019-12-20docs: Add development principles to HACKINGPhilip Withnall1-0/+32
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>
2019-12-19clang-plugin: Add option to provide extra typelib pathsPhilip Chimento1-8/+13
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
2019-12-19scripts: Escape plugin options with -XanalyzerPhilip Chimento1-0/+6
This seems to be necessary since -plugin-arg-tartan is an analyzer option.
2019-12-19scripts: Add tartan-json, a script for processing compile_commands.jsonPhilip Chimento2-0/+68
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
2019-12-18Merge branch 'another-philip' into 'master'P. F. Chimento2-1/+8
Add Philip Chimento as co-maintainer See merge request tartan/tartan!6
2019-12-17docs: Add Philip Chimento as co-maintainerPhilip Withnall2-0/+7
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-12-17Merge branch 'run-cleanly-on-c++' into 'master'Philip Withnall5-6/+103
Run cleanly on C++ code See merge request tartan/tartan!4
2019-12-17docs: Update my contact addressPhilip Withnall1-1/+1
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-12-16assertion: Decline to handle various other types of C++ expressionPhilip Chimento1-0/+26
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.
2019-12-16assertion: Handle C++ try statementsPhilip Chimento2-0/+29
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.
2019-12-16assertion: Handle ExprWithCleanupsPhilip Chimento5-6/+48
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.
2019-12-16Merge branch '5-upgrade-clang' into 'master'Philip Withnall35-574/+499
Resolve "Support Clang 5.x" Closes #5 See merge request tartan/tartan!2
2019-12-16Merge branch '2-bugs-everywhere' into 'master'Philip Withnall278-8607/+0
bugs: Remove bugs-everywhere Closes #2 See merge request tartan/tartan!3
2019-12-16bugs: Remove bugs-everywherePhilip Withnall278-8607/+0
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
2019-12-16clang-plugin: Support LLVM 9.0Philip Chimento3-2/+22
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.
2019-12-16clang-plugin: Support LLVM 8.0Philip Chimento7-43/+281
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().
2019-12-16clang-plugin: Update to LLVM 7.0Philip Chimento9-25/+25
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
2019-12-16clang-plugin: Require LLVM 4.0 or laterPhilip Chimento10-222/+7
Remove all the guards that checked for earlier versions. See: #5
2019-12-16tests: Fix for aberrant output on macOS clangPhilip Chimento1-1/+2
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.
2019-12-16tests: Look for built tartan plugin in builddirPhilip Chimento1-1/+1
The previous code seems to be accidentally looking in the srcdir.
2019-12-16tests: Look for template files in srcdirPhilip Chimento1-2/+2
2019-12-16tests: Handle srcdir that is relative to builddirPhilip Chimento2-1/+3
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.
2019-12-16scripts: Always enable core checkersPhilip Chimento3-22/+14
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
2019-12-14scripts: Fix variable name delimitationPhilip Chimento1-1/+1
The fancy quote here is considered part of the variable name, so brackets are needed to delimit it.
2019-12-14gsignal: Assume __vectorcall is unsafe for GObject signalsPhilip Chimento1-3/+4
__vectorcall is a callee-cleanup convention, so assume it is unsafe for the same reason that the other callee-cleanup conventions are.
2019-12-14gerror: Fix undefined variable in debug codePhilip Chimento1-2/+2
It seems that the surrounding code was updated without updating this debug-only code.
2019-12-14build: Remove no-undefined flagPhilip Chimento1-1/+0
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.
2019-12-14build: Mark LLVM headers as "system headers"Philip Chimento1-2/+2
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.
2019-12-14build: Make version compare regular expressions portablePhilip Chimento2-5/+5
Use the POSIX -E flag to ensure they are treated as extended regular expressions. They also seem to be overescaped.
2019-12-11build: Include known-working copy of AX_CODE_COVERAGEPhilip Chimento3-273/+265
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.
2019-12-11m4: Update macros from autoconf-archivePhilip Chimento15-390/+285
One of the downsides of keeping the macros in-tree is that they periodically need updating.