Skip to content

Commit 04b23a8

Browse files
Squashed 'cbmc/' changes from 8a7893c..7c1de91
7c1de91 Merge pull request diffblue#2465 from tautschnig/vs-criteria 9480092 Merge pull request diffblue#2437 from tautschnig/vs-empty a025add Merge pull request diffblue#2463 from tautschnig/vs-xref 0f3d345 Remove unused parameter criteria cdb7e52 Merge pull request diffblue#2453 from tautschnig/vs-deprected-uint bb7607d Merge pull request diffblue#2451 from tautschnig/c++-parser a07639d Merge pull request diffblue#2447 from tautschnig/cpp-regression-tests bdac907 Merge pull request diffblue#2459 from tautschnig/cmake-cleanup 261e883 Merge pull request diffblue#2461 from tautschnig/vs-auto 8acbc6c Merge pull request diffblue#2457 from tautschnig/vs-goto-convert bd2547a Merge pull request diffblue#2458 from tautschnig/vs-long-long fbc56db Remove unnecessarily inlined implementations to otherwise empty cpp file 6adcebc Merge pull request diffblue#2456 from tautschnig/vs-reserve a905ac0 Replace lambda by member function reference to silence Visual Studio ce6a297 Use auto to avoid unnecessary signed/unsigned conversion 79ef045 Deprecate get_unsigned_int c528c25 Remove no-longer-existent-files from exclusion lists in CMake files 4c6fc61 Use long-long integer constant as the left-hand side is long long 7dbf60a Remove unused parameters in goto_convert 0482889 Use reserve instead of generating blank strings 5e5e264 Merge pull request diffblue#2441 from tautschnig/vs-concur 8b03ac1 Merge pull request diffblue#2404 from tautschnig/vs-zero-2 18a3070 Merge pull request diffblue#2454 from tautschnig/vs-code-typet 062a886 Merge pull request diffblue#2408 from tautschnig/vs-set-map ccfc4e0 Merge pull request diffblue#2417 from tautschnig/vs-missing-arg 2bf4097 Merge pull request diffblue#2419 from tautschnig/vs-loc-num 7308bf6 Avoid deprecated code_typet() constructor c2a8fb8 Do not use count() when returning a bool 62ec461 Merge pull request diffblue#2360 from smowton/smowton/fix/dont-deref-null-for-class-identifier-v2 5e1f365 C++ parser: actually use parameters dca5b76 Merge pull request diffblue#2413 from tautschnig/vs-cpp-fix ee2421a Test passes 0cf27c6 type_traits requires C++ 11 660ae90 Remove unused parameter from cpp_destructor and fix types 0784f77 Merge pull request diffblue#2125 from smowton/smowton/feature/symex-ignore-null-derefs 001fca0 Merge pull request diffblue#2280 from cesaro/java-concurrency-synchronization 2369df3 Add message handler to remove_instanceof and _exceptions 419bc1b Java instanceof: avoid dereferencing null pointer 9fd3434 Use local-safe-pointers analysis to improve Symex pointer resolution 8078569 Add local-safe-pointers analysis 0062a9c Merge pull request diffblue#2444 from tautschnig/vs-value-set 68ac566 JBMC: Regression tests for synchronized methods c0ee316 JBMC: Support for synchronized methods 7efa7bf JBMC: Regression tests for multi-threaded java programs 4d91aa5 JBMC: Modified the instrumentation of monitorexit/enter instructions 0691f03 JBMC: Zero-initialized 'cproverMonitorCount' component and removed '@lock' field (fixes diffblue#2307) 0b90c17 JBMC: Moved format_classpath.sh to scripts/format_classpath.sh 2a0d2f9 AppVeyor fix: remove existing clones of the java models library. 0c5a497 Merge pull request diffblue#2446 from tautschnig/vs-unlink f4cb6a9 Merge pull request diffblue#2442 from tautschnig/vs-side 5b12b25 Merge pull request diffblue#2445 from tautschnig/vs-simpl 53e35c2 Move side effect out of conditional aab593b Use C++ standard library function instead of POSIX function f5b465d Simplify code to avoid Visual Studio warnings 7621a86 Remove unused parameter in value_set_analysis d50cec0 Remove unused parameter from concurrency_instrumentationt::instrument 475fe20 Merge pull request diffblue#2393 from tautschnig/git-info-cmake-fixes 5cd87c1 Merge pull request diffblue#2436 from tautschnig/vs-zero b4c0e22 Merge pull request diffblue#2410 from tautschnig/vs-deref-type 662d256 Merge pull request diffblue#2431 from tautschnig/vs-with 1aceb6c Merge pull request diffblue#2391 from diffblue/compilation-instructions 7c894e7 Merge pull request diffblue#2402 from tautschnig/vs-no-dummy 822de57 Merge pull request diffblue#2432 from tautschnig/vs-slice a3fe43b Merge pull request diffblue#2427 from tautschnig/vs-read-bin 0ab38e5 Merge pull request diffblue#2433 from tautschnig/vs-is-zero 95396bc Merge pull request diffblue#2438 from tautschnig/vs-partial 551ab81 Merge pull request diffblue#2411 from tautschnig/vs-message-handler 7464904 Merge pull request diffblue#2424 from tautschnig/vs-template 1feaa94 Merge pull request diffblue#2407 from tautschnig/vs-linker 82c7e48 Remove dummy implementations from propt 209d459 Partial-order concurrency: Remove unused parameter 0e3958a Zero-length array warning is C4200 in Visual Studio ed2cf6a Remove unused parameter from float_bvt::is_zero cb54ae5 Remove unused, empty function a5ecfb4 Remove unused parameters in convert_with_* 373636e Remove parameters that read_bin_goto_object_v3 does not use d6bdee6 Merge pull request diffblue#2369 from polgreen/disconnect_unreachable 0498da9 Merge pull request diffblue#2400 from tautschnig/vs-return-type 2eb9156 Merge pull request diffblue#2406 from tautschnig/vs-sizet1 d5ea06f Merge pull request diffblue#2422 from tautschnig/vs-thread-id 609c934 Merge pull request diffblue#2414 from tautschnig/vs-want 9263e43 Merge pull request diffblue#2403 from tautschnig/vs-zero-1 e638f72 CBMC_VERSION: Use generated include files instead of command-line defines 1360f7f CMake refers to Clang on a Mac as AppleClang f27e724 Merge pull request diffblue#2421 from tautschnig/vs-bound ed98fd7 Merge pull request diffblue#2412 from tautschnig/vs-build 16fa26d Merge pull request diffblue#2405 from diffblue/aws-codebuild-jbmc d7dd598 build jbmc on AWS codebuild 001f684 fix compilation instructions 040fd91 Remove unused parameter dereference_type 6ee60cd Do not unnecessarily convert mp_integer to bounded type d605d56 goto-program instruction's location_number is unsigned 9305ebd Remove unused parameter message_handler 4361cc4 goto-instrument/wmm: add missing argument 6256290 Fix return type of nodes_empty 8c2f6e1 Use std::set instead of map as value is never used bd4faad Use std::size_t instead of int to match types at callsites d07d418 Templatize architecture_string to avoid type conversion 9c72f61 Fix type of thread_id to match goto-trace fb512f0 Remove unused paramter in cpp_typecheck_resolvet 2afa919 Explicitly compare int to zero to avoid Visual Studio warning a1be6c8 Remove unused parameter from local_bitvector_analysist::build 4b5677d Bound the number of attempts my_mkstemps tries to compute a file name b8743fa Merge pull request diffblue#2415 from tautschnig/fix-models d7ef0bc Fix coreModels test to match latest java models library 90c56b3 Merge pull request diffblue#2396 from tautschnig/vs-constructor a45e777 Merge pull request diffblue#2397 from tautschnig/vs-indent 38c7889 Merge pull request diffblue#2399 from tautschnig/vs-defined 8324386 Merge pull request diffblue#2401 from tautschnig/vs-make-constant-rec 1c1562e Merge pull request diffblue#2398 from tautschnig/vs-remove-adjust 2bf9de7 Remove empty function make_constant_rec cdb4075 Use defined(...) when testing for defined-ness of macros bef9866 Remove unused function adjust_lhs_object f0ceaf7 expr2c: indent output of code_deadt 576c0a6 Remove constructor declaration that has no implementation 8f6dab8 Merge pull request diffblue#2261 from thk123/bugfix/TG-3652/wrong-generic-type-two-params 262affb Merge pull request diffblue#2350 from thk123/feature/TG-3813/load-specified-methods 122108a Merge pull request diffblue#2387 from diffblue/fix-dist-scripts 1d461c4 version numbers are now followed by git tag 8f93163 increased version number in preparation for release 5.9 8bc9ecf Merge pull request diffblue#2386 from tautschnig/make-version 7b4b8fe Make's file function is only available from 4.2 onwards ca982a5 Merge pull request diffblue#2373 from tautschnig/git-version-output af880a4 Merge pull request diffblue#2382 from tautschnig/missing-dest e149397 Merge pull request diffblue#2384 from tautschnig/quiet-vs 4b124c8 add centered git version to CBMC banner 718e926 Build .release_info files containing the version string 6416372 windowsify compiler options 23455af Print git revision with all --version outputs 7ca835b Added CBMC_VERSION defines to CMake configuration 783fcea Extend lazy-methods-extra-entry-point to support regex methods 1e55404 CI lazy methods take vector of method loaders 2fb9e21 Add utility for checking two vectors are equal without caring about order e1398bc Add tests for generic type erasure 0c874bf Don't have generic type variables as a comment 1f9a5c4 Adding test about the type bd907a4 Diversified the test for multiple fields 6f98511 Merge pull request diffblue#2335 from thk123/bugfix/load-classes-from-opaque-calls ae1535f Do not print version info when linking using Visual Studio 7e7619c Add missing virtual destructor c0dd633 Merge pull request diffblue#2376 from diffblue/gcc_attributes5_KNOWNBUG 3423e44 gcc/clang treat __attribute__((aligned())) differently c509ece Merge pull request diffblue#2379 from tautschnig/fix-bswap e95f59d Don't instantiate abstract types when they are returned from stubs d7d5f63 Disable lazy loading opaque return for symex driven loading 409d892 Don't forcibly instantiate abstract classes a718893 Adding test to ensure methods on return type of opaque function 20645c9 Add classes to needed classes for parameters and returns for opaque calls 9d42bc8 Move method for gathering all instantiated types into ci_lazy_methods_needed b67ae26 Add can_cast_type for symbol_typet 9981fab Correct doxygen documentation 67c056b Unit test for disconnecting unreachable nodes eca3366 Disconnect unreachable nodes in a graph 3126dea Fix bswap_exprt constructor ac02bbc Merge pull request diffblue#2243 from diffblue/no-warning-ptr-array 0ef77c7 Merge pull request diffblue#2377 from diffblue/fix-tests3 b603a63 make test independent of index type 5ca7410 ignore size of arrays on ptr-to-array conversions git-subtree-dir: cbmc git-subtree-split: 7c1de91
1 parent bca7cf1 commit 04b23a8

File tree

314 files changed

+3782
-1075
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

314 files changed

+3782
-1075
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Release/*
2828
*.obj
2929
*.a
3030
*.lib
31+
version.h
3132
src/ansi-c/arm_builtin_headers.inc
3233
src/ansi-c/clang_builtin_headers.inc
3334
src/ansi-c/cprover_builtin_headers.inc

CMakeLists.txt

+43
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
1717
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
1818

1919
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR
20+
"${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang" OR
2021
"${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU"
2122
)
2223
# Ensure NDEBUG is not set for release builds
@@ -38,6 +39,48 @@ if(${enable_cbmc_tests})
3839
enable_testing()
3940
endif()
4041

42+
# based on https://cmake.org/pipermail/cmake/2010-July/038015.html
43+
find_package(Git)
44+
if(GIT_FOUND)
45+
file(WRITE ${CMAKE_BINARY_DIR}/version.cmake
46+
"
47+
file(STRINGS \${CBMC_SOURCE_DIR}/config.inc
48+
config_inc_v REGEX \"CBMC_VERSION *= *[0-9\.]+\")
49+
string(REGEX REPLACE \"^CBMC_VERSION *= *\" \"\" CBMC_RELEASE \${config_inc_v})
50+
execute_process(
51+
COMMAND \"${GIT_EXECUTABLE}\" \"describe\" \"--tags\" \"--always\" \"--dirty\"
52+
OUTPUT_VARIABLE GIT_INFO
53+
OUTPUT_STRIP_TRAILING_WHITESPACE
54+
)
55+
configure_file(\${CUR}/version.h.in version.h)
56+
"
57+
)
58+
else()
59+
file(WRITE ${CMAKE_BINARY_DIR}/version.cmake
60+
"
61+
file(STRINGS \${CBMC_SOURCE_DIR}/config.inc
62+
config_inc_v REGEX \"CBMC_VERSION *= *[0-9\.]+\")
63+
string(REGEX REPLACE \"^CBMC_VERSION *= *\" \"\" CBMC_RELEASE \${config_inc_v})
64+
set(GIT_INFO \"n/a\")
65+
configure_file(\${CUR}/version.h.in version.h)
66+
"
67+
)
68+
endif()
69+
70+
macro(git_revision target)
71+
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/version.h.in
72+
"\#define CBMC_VERSION \"@CBMC_RELEASE@ (@GIT_INFO@)\"\n")
73+
add_custom_target(
74+
${target}-version.h
75+
COMMAND ${CMAKE_COMMAND}
76+
-D CBMC_SOURCE_DIR=${CBMC_SOURCE_DIR}
77+
-D CUR=${CMAKE_CURRENT_BINARY_DIR}
78+
-P ${CMAKE_BINARY_DIR}/version.cmake
79+
)
80+
add_dependencies(${target} ${target}-version.h)
81+
endmacro()
82+
include_directories(${CMAKE_CURRENT_BINARY_DIR})
83+
4184
add_subdirectory(src)
4285
add_subdirectory(regression)
4386
add_subdirectory(unit)

CODING_STANDARD.md

+94
Original file line numberDiff line numberDiff line change
@@ -240,3 +240,97 @@ or use a symbolic link. Then, when running git commit, you should get the
240240
linter output (if any) before being prompted to enter a commit message. To
241241
bypass the check (e.g. if there was a false positive), add the option
242242
`--no-verify`.
243+
244+
# CODE COVERAGE
245+
246+
Code coverage metrics are provided using gcov and lcov. Ensure that you have
247+
installed lcov from http://ltp.sourceforge.net/coverage/lcov.php note for
248+
ubuntu lcov is available in the standard apt-get repos.
249+
250+
To get coverage metrics run the following script from the regression directory:
251+
```
252+
get_coverage.sh
253+
```
254+
This will:
255+
1) Rebuild CBMC with gcov enabled
256+
2) Run all the regression tests
257+
3) Collate the coverage metrics
258+
4) Provide an HTML report of the current coverage
259+
260+
# USING CLANG-FORMAT
261+
262+
CBMC uses clang-format to ensure that the formatting of new patches is readable
263+
and consistent. There are two main ways of running clang-format: remotely, and
264+
locally.
265+
266+
## RUNNING CLANG-FORMAT REMOTELY
267+
268+
When patches are submitted to CBMC, they are automatically run through
269+
continuous integration (CI). One of the CI checks will run clang-format over
270+
the diff that your pull request introduces. If clang-format finds formatting
271+
issues at this point, the build will be failed, and a patch will be produced
272+
in the CI output that you can apply to your code so that it conforms to the
273+
style guidelines.
274+
275+
To apply the patch, copy and paste it into a local file (`patch.txt`) and then
276+
run:
277+
```
278+
patch -p1 -i patch.txt
279+
```
280+
Now, you can commit and push the formatting fixes.
281+
282+
## RUNNING CLANG-FORMAT LOCALLY
283+
284+
### INSTALLATION
285+
286+
To avoid waiting until you've made a PR to find formatting issues, you can
287+
install clang-format locally and run it against your code as you are working.
288+
289+
Different versions of clang-format have slightly different behaviors. CBMC uses
290+
clang-format-3.8 as it is available the repositories for Ubuntu 16.04 and
291+
Homebrew.
292+
To install on a Unix-like system, try installing using the system package
293+
manager:
294+
```
295+
apt-get install clang-format-3.8 # Run this on Ubuntu, Debian etc.
296+
brew install [email protected] # Run this on a Mac with Homebrew installed
297+
```
298+
299+
If your platform doesn't have a package for clang-format, you can download a
300+
pre-built binary, or compile clang-format yourself using the appropriate files
301+
from the [LLVM Downloads page](http://releases.llvm.org/download.html).
302+
303+
An installer for Windows (along with a Visual Studio plugin) can be found at
304+
the [LLVM Snapshot Builds page](http://llvm.org/builds/).
305+
306+
### FORMATTING A RANGE OF COMMITS
307+
308+
Clang-format is distributed with a driver script called git-clang-format-3.8.
309+
This script can be used to format git diffs (rather than entire files).
310+
311+
After committing some code, it is recommended to run:
312+
```
313+
git-clang-format-3.8 upstream/develop
314+
```
315+
*Important:* If your branch is based on a branch other than `upstream/develop`,
316+
use the name or checksum of that branch instead. It is strongly recommended to
317+
rebase your work onto the tip of the branch it's based on before running
318+
`git-clang-format` in this way.
319+
320+
### RETROACTIVELY FORMATTING INDIVIDUAL COMMITS
321+
322+
If your works spans several commits and you'd like to keep the formatting
323+
correct in each individual commit, you can automatically rewrite the commits
324+
with correct formatting.
325+
326+
The following command will stop at each commit in the range and run
327+
clang-format on the diff at that point. This rewrites git history, so it's
328+
*unsafe*, and you should back up your branch before running this command:
329+
```
330+
git filter-branch --tree-filter 'git-clang-format-3.8 upstream/develop' \
331+
-- upstream/develop..HEAD
332+
```
333+
*Important*: `upstream/develop` should be changed in *both* places in the
334+
command above if your work is based on a different branch. It is strongly
335+
recommended to rebase your work onto the tip of the branch it's based on before
336+
running `git-clang-format` in this way.

0 commit comments

Comments
 (0)