Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
DIVINE
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
paradise
mirror
DIVINE
Compare Revisions
c41d23cbb3ce5d1aafa613adf7ccd0ca6160eec4...192f10e2a618cf64c0746e223a3e1d3431e7b5c6
Source
192f10e2a618cf64c0746e223a3e1d3431e7b5c6
Select Git revision
...
Target
c41d23cbb3ce5d1aafa613adf7ccd0ca6160eec4
Select Git revision
Compare
Commits (395)
bdcaa488
doc: Add overview of RST.
Aug 22, 2019
77c40212
doc: Finally update the year to 2019.
Aug 22, 2019
de7c73cf
VM: Add comments to eval.hpp.
Aug 23, 2019
4cf1f4a8
VM: Add comments to eval*.tpp and value.hpp.
Aug 23, 2019
072e711b
lart: Introduce annotation pass.
May 18, 2019
5cbb338d
lart: Introduce annotations to attributes lowering pass.
May 18, 2019
cb3658b3
lart: Use annotation pass in other passes instead of annotation enumeration.
May 18, 2019
0e35b13e
rst: Rework tristate domain to use new interface.
May 14, 2019
65cc58d7
bricks: Rework brick-smt RPN representation.
May 14, 2019
25c5e417
bricks: Introduce RPNView.
May 21, 2019
7f55acc5
lart: Use annotation string instead of structure.
May 21, 2019
8da38ac3
rst: Introduce term domain.
May 21, 2019
87cc4a9e
smt: Implement RPN stack machine.
May 21, 2019
1c9c51c4
smt: Rework smt extract to work with RPN representation.
May 21, 2019
27d93ad1
smt: Let smt builders work with RPN formula representation.
May 21, 2019
589e9aa0
mc: Use RPN evaluator in tracing of assumes.
May 21, 2019
7bf0e0b4
rst: Fix tristate construction.
May 21, 2019
1dabb262
rst: Move abstraction to __dios::rst::abstract namespace.
May 30, 2019
5f712643
lart: Introduce abstraction initialization pass.
May 31, 2019
64419102
lart: Introduce simplified annotation lowering pass.
May 31, 2019
a432bc51
lart: Add metadata to calls that return abstract value.
Jun 02, 2019
7fa81a04
lart: Rework value propagation analysis.
Jun 06, 2019
ea27b3b2
lart: Rename VPA to DataFlowAnalysis.
Jun 06, 2019
43434b9f
lart: Add indices to abstract operations.
Jun 07, 2019
e899590b
rst: Introduce base class for abstract domains.
Jun 10, 2019
784af76c
rst: Introduce single value domain.
Jun 10, 2019
83f80df4
rst: Add C interface to tristate domain.
Jun 10, 2019
f1b6bef2
rst: Change stash return type to void pointer.
Jun 11, 2019
bdd95161
rst: Enable parametrization of the unit domain return type.
Jun 11, 2019
ff5273fe
rst: Change lift_one interface in the unit domain.
Jun 19, 2019
cfddd701
rst: Rework term domain to maintain domain index in the first byte of rpn.
Jun 19, 2019
3437b708
lart: Represent domain table by uniform 2 dimensional array.
Jun 19, 2019
d19b6dce
lart: Simplify data flow analysis to the bare bone propagation.
Jun 19, 2019
7d2f83bb
lart: Obliterate concretization pass.
Jun 19, 2019
2e184c74
lart: Generate abstract operations for branches instead of placeholders.
Jun 19, 2019
9f4ba241
lart: Remove obsolete abstraction memory cleanup pass.
Jun 19, 2019
77f5cb90
lart: Rename lart placeholders to abstract operations.
Jun 19, 2019
caa7c0ba
lart: Obliterate obsolete code around abstract domains.
Jun 19, 2019
1108e8c8
lart: Move support for dual metadata to the rest of the metadata related code.
Jun 19, 2019
a5d8f19c
lart: Simplify syntactic abstraction pass.
Jun 19, 2019
4d59a57a
lart: Handle abstract operations instead of placeholders in the tainting pass.
Jun 19, 2019
6effd174
lart: Synthesize lifters to use domain virtual table dispatch.
Jun 19, 2019
23ecffd2
dios: Implement term domain operations.
Jul 19, 2019
032140d6
dios: Introduce generic freeze and thaw functions.
Jul 19, 2019
45a8ffc3
dios: Fix addition of negated constraints to the path condition.
Jul 19, 2019
02301a39
dios: Rename constructors of symbolic values.
Jul 19, 2019
7f99417f
bricks: Extend support of rpn formula representation.
Jul 19, 2019
84bc0e72
lart: Extend data flow analysis to support calls and memory manipulation.
Jul 19, 2019
037a1952
lart: Fix branching instrumentation.
Jul 19, 2019
2d84fa69
lart: Clean up llvm metadata utilities.
Jul 19, 2019
5d874e0c
lart: Implement new stashing instrumentation.
Jul 19, 2019
c95a7186
lart: Introduce map to track pairs of dual abstract/concrete operations.
Jul 19, 2019
967115eb
lart: Introduce generic freeze/thaw instrumentation.
Jul 19, 2019
387be2bc
lart: Implement syntactic abstraction of faultable operations.
Jul 19, 2019
5bdfe9c8
lart: Refactor taint instrumentation to work with faultable operations.
Jul 19, 2019
7e90eae7
lart: Synthesize lifters for faultable operations.
Jul 19, 2019
5cee472b
lart: Erase lart helper intrinsics after successful abstraction.
Jul 19, 2019
f2e1ea54
lart: Generalize llvm utilities for transformation passes.
Jul 19, 2019
da377422
smt: Ignore casts of values to the same bitwidth.
Jul 19, 2019
160b5c98
smt: Let smt builder deduce bitwidth of non-leaf formula nodes.
Jul 19, 2019
a5a83e62
lart: Fix data-flow analysis of pointer types.
Jul 24, 2019
9e3490ed
lart: Rework wrapping of abstract values in data-flow analysis.
Jul 25, 2019
414a97dc
lart: Fix return value propagation.
Jul 25, 2019
f6789f0d
lart: Fix tobool taint generation.
Jul 25, 2019
153bbde5
lart: Annotate atomic abstract operations by interrupt.skipcfl tag.
Jul 29, 2019
9138a6cd
lart: Obliterate obsolete freeze/thaw taint generation.
Jul 29, 2019
3e3fa447
lart: Refactor synthesize pass.
Jul 29, 2019
d37d9ed1
smt: Fix order of arguments of binary operations.
Jul 29, 2019
9fae8f2b
lart: Test taints before calling freeze or thaw.
Jul 29, 2019
b78c730e
lart: Do not annotate bitcasts in data flow analysis.
Aug 05, 2019
9fc4eb99
lart: Enable bidirectional DFA through cast instructions.
Aug 05, 2019
691d7883
lart: Synthesize domain specific thaw lifters.
Aug 05, 2019
e05fbcc6
lart: Forbid annotation of abstract constants.
Aug 05, 2019
c16c3b62
lart: Refactor data flow analysis.
Aug 07, 2019
21de586e
lart: Implement propagation through GEP instructions.
Aug 07, 2019
5d22fa59
lart: Fix annotation of abstract scalar arguments.
Aug 07, 2019
40db9d5c
lart: Enable DFA to propagate through ptrtoint/inttoptr.
Aug 07, 2019
cb1c0d2d
test: Turn off mstring tests.
Aug 07, 2019
234b2bc5
lart: Introduce simple output argument propagation.
Aug 07, 2019
062f4d22
test: Temporarily mark symbolic float test as todo.
Aug 07, 2019
08799e54
lart: Clean up SFINAE in tainting pass.
Aug 07, 2019
6d846983
lart: Enable pruning of propagation according to ignore annotations.
Aug 07, 2019
311f8cc4
lart: Fix backward propagation of repeated output argument.
Aug 07, 2019
3fac1077
lart: Remove 'union' abstract operation.
Aug 07, 2019
63237c11
lart: Memorize stashed arguments bundle types.
Aug 07, 2019
f8090b1b
lart: Detect fixed point of recursive backward propagation.
Aug 07, 2019
e215380e
lart: Enable propagation from global variables.
Aug 07, 2019
ddf75635
lart: Update abstraction related interrupt instrumentation.
Aug 07, 2019
be34030f
mc: Fix tracing of assumes.
Aug 07, 2019
aa7737d6
lart: Temporarily turn off abstraction unit tests.
Aug 07, 2019
9adfcfc9
bricks: Add missing switch case to symbolic bitwidth identification.
Aug 08, 2019
312d71ce
lart: Fix annotation of trapfn functions.
Aug 08, 2019
0f5b5696
test: Fix construction of abstract star.
Aug 08, 2019
0a4ee3a9
rts: Fix merging of mstring blocks with the same character.
Aug 08, 2019
b6e59b29
rst: Let content domain GEP instruction take a signed offset.
Aug 08, 2019
a34da80f
rst: Remove outdated abstractions.
Aug 08, 2019
73b6641d
dios: Introduce header file with constructors of abstract values.
Aug 08, 2019
e5d0ba95
rst: Add missing constructors of abstract values.
Aug 08, 2019
849568d0
rst: Fix naming of abstract 'unit' constructors.
Aug 08, 2019
13686b45
dios: Refactor rst common stuff.
Aug 08, 2019
295 additional commits have been omitted to prevent performance issues.
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
616 changed files
with
23999 additions
and
25164 deletions
+23999
-25164
.gitlab-ci.yml
.gitlab-ci.yml
+36
-0
Makefile
Makefile
+7
-5
bricks/brick-assert
bricks/brick-assert
+56
-51
bricks/brick-benchmark
bricks/brick-benchmark
+1
-1
bricks/brick-bitlevel
bricks/brick-bitlevel
+15
-12
bricks/brick-cmd
bricks/brick-cmd
+33
-13
bricks/brick-cons
bricks/brick-cons
+76
-3
bricks/brick-data
bricks/brick-data
+0
-191
bricks/brick-except
bricks/brick-except
+49
-15
bricks/brick-fs
bricks/brick-fs
+6
-4
bricks/brick-gnuplot
bricks/brick-gnuplot
+1
-1
bricks/brick-hash
bricks/brick-hash
+40
-10
bricks/brick-hashset
bricks/brick-hashset
+3
-1
bricks/brick-llvm-link
bricks/brick-llvm-link
+20
-1
bricks/brick-mem
bricks/brick-mem
+35
-15
bricks/brick-proc
bricks/brick-proc
+2
-2
bricks/brick-ptr
bricks/brick-ptr
+4
-1
bricks/brick-sha2
bricks/brick-sha2
+48
-46
bricks/brick-shelltest
bricks/brick-shelltest
+31
-39
bricks/brick-shmem
bricks/brick-shmem
+4
-0
bricks/brick-smt
bricks/brick-smt
+964
-738
bricks/brick-trace
bricks/brick-trace
+36
-7
bricks/brick-tuple
bricks/brick-tuple
+0
-3
bricks/brick-unittest
bricks/brick-unittest
+67
-34
dios/CMakeLists.txt
dios/CMakeLists.txt
+3
-1
dios/arch/divm/metadata.cpp
dios/arch/divm/metadata.cpp
+1
-1
dios/arch/divm/reschedule.cpp
dios/arch/divm/reschedule.cpp
+2
-2
dios/arch/divm/setjmp.cpp
dios/arch/divm/setjmp.cpp
+1
-1
dios/arch/divm/stack.cpp
dios/arch/divm/stack.cpp
+2
-2
dios/hostabi.pl
dios/hostabi.pl
+44
-74
dios/include/rst/base.hpp
dios/include/rst/base.hpp
+24
-0
dios/include/rst/common-domain.def
dios/include/rst/common-domain.def
+0
-78
dios/include/rst/common.hpp
dios/include/rst/common.hpp
+289
-0
dios/include/rst/constant.hpp
dios/include/rst/constant.hpp
+276
-0
dios/include/rst/content-domain.def
dios/include/rst/content-domain.def
+0
-22
dios/include/rst/content.h
dios/include/rst/content.h
+0
-22
dios/include/rst/domains.h
dios/include/rst/domains.h
+31
-11
dios/include/rst/empty-abstraction.h
dios/include/rst/empty-abstraction.h
+0
-100
dios/include/rst/float-domain.def
dios/include/rst/float-domain.def
+0
-45
dios/include/rst/formula.h
dios/include/rst/formula.h
+0
-37
dios/include/rst/integer-domain.def
dios/include/rst/integer-domain.def
+0
-52
dios/include/rst/lart.h
dios/include/rst/lart.h
+2
-2
dios/include/rst/mstring.h
dios/include/rst/mstring.h
+0
-30
dios/include/rst/segmentation.h
dios/include/rst/segmentation.h
+0
-597
dios/include/rst/star.h
dios/include/rst/star.h
+0
-23
dios/include/rst/string-domain.def
dios/include/rst/string-domain.def
+0
-31
dios/include/rst/sym.h
dios/include/rst/sym.h
+0
-17
dios/include/rst/term.hpp
dios/include/rst/term.hpp
+348
-0
dios/include/rst/tristate.h
dios/include/rst/tristate.h
+0
-19
dios/include/rst/tristate.hpp
dios/include/rst/tristate.hpp
+49
-0
dios/include/rst/unit.hpp
dios/include/rst/unit.hpp
+127
-0
dios/include/rst/zero.h
dios/include/rst/zero.h
+0
-22
dios/include/signal.h
dios/include/signal.h
+8
-9
dios/include/stdlib.h
dios/include/stdlib.h
+1
-0
dios/include/sys/cdefs.h
dios/include/sys/cdefs.h
+2
-0
dios/include/sys/select.h
dios/include/sys/select.h
+1
-1
dios/include/sys/task.h
dios/include/sys/task.h
+1
-1
dios/include/unistd.h
dios/include/unistd.h
+2
-2
dios/include/util/map.hpp
dios/include/util/map.hpp
+20
-27
dios/libc/_PDCLIB/glue.c
dios/libc/_PDCLIB/glue.c
+5
-5
dios/libc/_PDCLIB/stubs.cpp
dios/libc/_PDCLIB/stubs.cpp
+6
-2
dios/libc/pthread/pthread-core.cpp
dios/libc/pthread/pthread-core.cpp
+0
-5
dios/libc/string/memcpy.c
dios/libc/string/memcpy.c
+1
-1
dios/libc/string/memmove.c
dios/libc/string/memmove.c
+1
-1
dios/libc/string/strcmp.c
dios/libc/string/strcmp.c
+1
-1
dios/libc/string/strcpy.c
dios/libc/string/strcpy.c
+1
-1
dios/libc/string/strlen.c
dios/libc/string/strlen.c
+1
-1
dios/libc/sys/metadata.cpp
dios/libc/sys/metadata.cpp
+1
-1
dios/libc/sys/start.cpp
dios/libc/sys/start.cpp
+22
-35
dios/libc/sys/trace.cpp
dios/libc/sys/trace.cpp
+1
-1
dios/libcxx/CMakeLists.txt
dios/libcxx/CMakeLists.txt
+88
-64
dios/libcxx/CREDITS.TXT
dios/libcxx/CREDITS.TXT
+6
-2
dios/libcxx/LICENSE.TXT
dios/libcxx/LICENSE.TXT
+237
-2
dios/libcxx/cmake/Modules/CheckLibcxxAtomic.cmake
dios/libcxx/cmake/Modules/CheckLibcxxAtomic.cmake
+7
-5
dios/libcxx/cmake/Modules/HandleLibCXXABI.cmake
dios/libcxx/cmake/Modules/HandleLibCXXABI.cmake
+18
-15
dios/libcxx/cmake/Modules/HandleLibcxxFlags.cmake
dios/libcxx/cmake/Modules/HandleLibcxxFlags.cmake
+47
-8
dios/libcxx/cmake/config-ix.cmake
dios/libcxx/cmake/config-ix.cmake
+20
-10
dios/libcxx/include/CMakeLists.txt
dios/libcxx/include/CMakeLists.txt
+20
-20
dios/libcxx/include/__bit_reference
dios/libcxx/include/__bit_reference
+17
-18
dios/libcxx/include/__bsd_locale_defaults.h
dios/libcxx/include/__bsd_locale_defaults.h
+3
-4
dios/libcxx/include/__bsd_locale_fallbacks.h
dios/libcxx/include/__bsd_locale_fallbacks.h
+3
-4
dios/libcxx/include/__config
dios/libcxx/include/__config
+130
-157
dios/libcxx/include/__config_site.in
dios/libcxx/include/__config_site.in
+4
-4
dios/libcxx/include/__debug
dios/libcxx/include/__debug
+16
-39
dios/libcxx/include/__errc
dios/libcxx/include/__errc
+3
-4
dios/libcxx/include/__functional_03
dios/libcxx/include/__functional_03
+3
-4
dios/libcxx/include/__functional_base
dios/libcxx/include/__functional_base
+8
-9
dios/libcxx/include/__functional_base_03
dios/libcxx/include/__functional_base_03
+3
-4
dios/libcxx/include/__hash_table
dios/libcxx/include/__hash_table
+15
-15
dios/libcxx/include/__libcpp_version
dios/libcxx/include/__libcpp_version
+1
-1
dios/libcxx/include/__locale
dios/libcxx/include/__locale
+55
-25
dios/libcxx/include/__mutex_base
dios/libcxx/include/__mutex_base
+19
-30
dios/libcxx/include/__node_handle
dios/libcxx/include/__node_handle
+5
-7
dios/libcxx/include/__nullptr
dios/libcxx/include/__nullptr
+3
-4
dios/libcxx/include/__sso_allocator
dios/libcxx/include/__sso_allocator
+3
-4
dios/libcxx/include/__std_stream
dios/libcxx/include/__std_stream
+3
-4
dios/libcxx/include/__string
dios/libcxx/include/__string
+3
-4
dios/libcxx/include/__threading_support
dios/libcxx/include/__threading_support
+104
-16
dios/libcxx/include/__tree
dios/libcxx/include/__tree
+91
-127
dios/libcxx/include/__tuple
dios/libcxx/include/__tuple
+31
-37
dios/libcxx/include/__undef_macros
dios/libcxx/include/__undef_macros
+3
-4
dios/libcxx/include/algorithm
dios/libcxx/include/algorithm
+215
-244
dios/libcxx/include/any
dios/libcxx/include/any
+4
-5
dios/libcxx/include/array
dios/libcxx/include/array
+17
-19
dios/libcxx/include/atomic
dios/libcxx/include/atomic
+811
-257
dios/libcxx/include/bit
dios/libcxx/include/bit
+339
-32
dios/libcxx/include/bitset
dios/libcxx/include/bitset
+5
-6
dios/libcxx/include/cassert
dios/libcxx/include/cassert
+3
-4
dios/libcxx/include/ccomplex
dios/libcxx/include/ccomplex
+3
-4
dios/libcxx/include/cctype
dios/libcxx/include/cctype
+3
-4
dios/libcxx/include/cerrno
dios/libcxx/include/cerrno
+3
-4
dios/libcxx/include/cfenv
dios/libcxx/include/cfenv
+3
-4
dios/libcxx/include/cfloat
dios/libcxx/include/cfloat
+3
-4
dios/libcxx/include/charconv
dios/libcxx/include/charconv
+21
-22
dios/libcxx/include/chrono
dios/libcxx/include/chrono
+47
-62
dios/libcxx/include/cinttypes
dios/libcxx/include/cinttypes
+3
-4
dios/libcxx/include/ciso646
dios/libcxx/include/ciso646
+3
-4
dios/libcxx/include/climits
dios/libcxx/include/climits
+3
-4
dios/libcxx/include/clocale
dios/libcxx/include/clocale
+3
-4
dios/libcxx/include/cmath
dios/libcxx/include/cmath
+30
-5
dios/libcxx/include/codecvt
dios/libcxx/include/codecvt
+3
-4
dios/libcxx/include/compare
dios/libcxx/include/compare
+3
-4
dios/libcxx/include/complex
dios/libcxx/include/complex
+5
-6
dios/libcxx/include/complex.h
dios/libcxx/include/complex.h
+3
-4
dios/libcxx/include/condition_variable
dios/libcxx/include/condition_variable
+3
-4
dios/libcxx/include/csetjmp
dios/libcxx/include/csetjmp
+3
-4
dios/libcxx/include/csignal
dios/libcxx/include/csignal
+3
-4
dios/libcxx/include/cstdarg
dios/libcxx/include/cstdarg
+3
-4
dios/libcxx/include/cstdbool
dios/libcxx/include/cstdbool
+3
-4
dios/libcxx/include/cstddef
dios/libcxx/include/cstddef
+3
-4
dios/libcxx/include/cstdint
dios/libcxx/include/cstdint
+3
-4
dios/libcxx/include/cstdio
dios/libcxx/include/cstdio
+3
-4
dios/libcxx/include/cstdlib
dios/libcxx/include/cstdlib
+3
-4
dios/libcxx/include/cstring
dios/libcxx/include/cstring
+3
-4
dios/libcxx/include/ctgmath
dios/libcxx/include/ctgmath
+3
-4
dios/libcxx/include/ctime
dios/libcxx/include/ctime
+3
-4
dios/libcxx/include/ctype.h
dios/libcxx/include/ctype.h
+3
-4
dios/libcxx/include/cwchar
dios/libcxx/include/cwchar
+3
-4
dios/libcxx/include/cwctype
dios/libcxx/include/cwctype
+3
-4
dios/libcxx/include/deque
dios/libcxx/include/deque
+15
-16
dios/libcxx/include/errno.h
dios/libcxx/include/errno.h
+3
-4
dios/libcxx/include/exception
dios/libcxx/include/exception
+6
-15
dios/libcxx/include/experimental/__config
dios/libcxx/include/experimental/__config
+10
-5
dios/libcxx/include/experimental/__memory
dios/libcxx/include/experimental/__memory
+3
-4
dios/libcxx/include/experimental/algorithm
dios/libcxx/include/experimental/algorithm
+3
-4
dios/libcxx/include/experimental/any
dios/libcxx/include/experimental/any
+0
-21
dios/libcxx/include/experimental/chrono
dios/libcxx/include/experimental/chrono
+0
-21
dios/libcxx/include/experimental/coroutine
dios/libcxx/include/experimental/coroutine
+6
-7
dios/libcxx/include/experimental/deque
dios/libcxx/include/experimental/deque
+3
-4
dios/libcxx/include/experimental/filesystem
dios/libcxx/include/experimental/filesystem
+3
-4
dios/libcxx/include/experimental/forward_list
dios/libcxx/include/experimental/forward_list
+3
-4
dios/libcxx/include/experimental/functional
dios/libcxx/include/experimental/functional
+6
-10
dios/libcxx/include/experimental/iterator
dios/libcxx/include/experimental/iterator
+3
-4
dios/libcxx/include/experimental/list
dios/libcxx/include/experimental/list
+3
-4
dios/libcxx/include/experimental/map
dios/libcxx/include/experimental/map
+3
-4
dios/libcxx/include/experimental/memory_resource
dios/libcxx/include/experimental/memory_resource
+3
-4
dios/libcxx/include/experimental/numeric
dios/libcxx/include/experimental/numeric
+0
-21
dios/libcxx/include/experimental/optional
dios/libcxx/include/experimental/optional
+0
-21
dios/libcxx/include/experimental/propagate_const
dios/libcxx/include/experimental/propagate_const
+3
-4
dios/libcxx/include/experimental/ratio
dios/libcxx/include/experimental/ratio
+0
-21
dios/libcxx/include/experimental/regex
dios/libcxx/include/experimental/regex
+3
-4
dios/libcxx/include/experimental/set
dios/libcxx/include/experimental/set
+3
-4
dios/libcxx/include/experimental/simd
dios/libcxx/include/experimental/simd
+3
-4
dios/libcxx/include/experimental/string
dios/libcxx/include/experimental/string
+3
-4
dios/libcxx/include/experimental/string_view
dios/libcxx/include/experimental/string_view
+0
-21
dios/libcxx/include/experimental/system_error
dios/libcxx/include/experimental/system_error
+0
-21
dios/libcxx/include/experimental/tuple
dios/libcxx/include/experimental/tuple
+0
-21
dios/libcxx/include/experimental/type_traits
dios/libcxx/include/experimental/type_traits
+8
-9
dios/libcxx/include/experimental/unordered_map
dios/libcxx/include/experimental/unordered_map
+3
-4
dios/libcxx/include/experimental/unordered_set
dios/libcxx/include/experimental/unordered_set
+3
-4
dios/libcxx/include/experimental/utility
dios/libcxx/include/experimental/utility
+3
-4
dios/libcxx/include/experimental/vector
dios/libcxx/include/experimental/vector
+3
-4
dios/libcxx/include/ext/__hash
dios/libcxx/include/ext/__hash
+16
-18
dios/libcxx/include/ext/hash_map
dios/libcxx/include/ext/hash_map
+38
-40
dios/libcxx/include/ext/hash_set
dios/libcxx/include/ext/hash_set
+16
-18
dios/libcxx/include/fenv.h
dios/libcxx/include/fenv.h
+116
-0
dios/libcxx/include/filesystem
dios/libcxx/include/filesystem
+19
-13
dios/libcxx/include/float.h
dios/libcxx/include/float.h
+3
-4
dios/libcxx/include/forward_list
dios/libcxx/include/forward_list
+45
-32
dios/libcxx/include/fstream
dios/libcxx/include/fstream
+11
-12
dios/libcxx/include/functional
dios/libcxx/include/functional
+106
-34
dios/libcxx/include/future
dios/libcxx/include/future
+8
-13
dios/libcxx/include/initializer_list
dios/libcxx/include/initializer_list
+4
-5
dios/libcxx/include/inttypes.h
dios/libcxx/include/inttypes.h
+8
-4
dios/libcxx/include/iomanip
dios/libcxx/include/iomanip
+8
-9
dios/libcxx/include/ios
dios/libcxx/include/ios
+37
-19
dios/libcxx/include/iosfwd
dios/libcxx/include/iosfwd
+3
-4
dios/libcxx/include/iostream
dios/libcxx/include/iostream
+3
-4
dios/libcxx/include/istream
dios/libcxx/include/istream
+514
-381
dios/libcxx/include/iterator
dios/libcxx/include/iterator
+141
-106
dios/libcxx/include/limits
dios/libcxx/include/limits
+4
-5
dios/libcxx/include/limits.h
dios/libcxx/include/limits.h
+3
-4
dios/libcxx/include/list
dios/libcxx/include/list
+86
-72
dios/libcxx/include/locale
dios/libcxx/include/locale
+7
-14
dios/libcxx/include/locale.h
dios/libcxx/include/locale.h
+3
-4
dios/libcxx/include/map
dios/libcxx/include/map
+86
-18
dios/libcxx/include/math.h
dios/libcxx/include/math.h
+93
-50
dios/libcxx/include/memory
dios/libcxx/include/memory
+160
-243
dios/libcxx/include/module.modulemap
dios/libcxx/include/module.modulemap
+4
-1
dios/libcxx/include/mutex
dios/libcxx/include/mutex
+20
-12
dios/libcxx/include/new
dios/libcxx/include/new
+28
-14
dios/libcxx/include/numeric
dios/libcxx/include/numeric
+73
-11
dios/libcxx/include/optional
dios/libcxx/include/optional
+60
-54
dios/libcxx/include/ostream
dios/libcxx/include/ostream
+8
-4
dios/libcxx/include/queue
dios/libcxx/include/queue
+13
-14
dios/libcxx/include/random
dios/libcxx/include/random
+11
-12
dios/libcxx/include/ratio
dios/libcxx/include/ratio
+3
-4
dios/libcxx/include/regex
dios/libcxx/include/regex
+89
-46
dios/libcxx/include/scoped_allocator
dios/libcxx/include/scoped_allocator
+3
-4
dios/libcxx/include/set
dios/libcxx/include/set
+87
-11
dios/libcxx/include/setjmp.h
dios/libcxx/include/setjmp.h
+3
-4
dios/libcxx/include/shared_mutex
dios/libcxx/include/shared_mutex
+3
-4
dios/libcxx/include/span
dios/libcxx/include/span
+139
-112
dios/libcxx/include/sstream
dios/libcxx/include/sstream
+4
-5
dios/libcxx/include/stack
dios/libcxx/include/stack
+8
-9
dios/libcxx/include/stdbool.h
dios/libcxx/include/stdbool.h
+3
-4
dios/libcxx/include/stddef.h
dios/libcxx/include/stddef.h
+3
-4
dios/libcxx/include/stdexcept
dios/libcxx/include/stdexcept
+31
-5
dios/libcxx/include/stdint.h
dios/libcxx/include/stdint.h
+8
-4
dios/libcxx/include/stdio.h
dios/libcxx/include/stdio.h
+3
-4
dios/libcxx/include/stdlib.h
dios/libcxx/include/stdlib.h
+9
-32
dios/libcxx/include/streambuf
dios/libcxx/include/streambuf
+3
-4
dios/libcxx/include/string
dios/libcxx/include/string
+36
-41
dios/libcxx/include/string.h
dios/libcxx/include/string.h
+3
-4
dios/libcxx/include/string_view
dios/libcxx/include/string_view
+20
-21
dios/libcxx/include/strstream
dios/libcxx/include/strstream
+3
-4
dios/libcxx/include/support/android/locale_bionic.h
dios/libcxx/include/support/android/locale_bionic.h
+3
-4
dios/libcxx/include/support/fuchsia/xlocale.h
dios/libcxx/include/support/fuchsia/xlocale.h
+3
-4
dios/libcxx/include/support/ibm/limits.h
dios/libcxx/include/support/ibm/limits.h
+3
-4
dios/libcxx/include/support/ibm/locale_mgmt_aix.h
dios/libcxx/include/support/ibm/locale_mgmt_aix.h
+3
-4
dios/libcxx/include/support/ibm/support.h
dios/libcxx/include/support/ibm/support.h
+3
-4
dios/libcxx/include/support/ibm/xlocale.h
dios/libcxx/include/support/ibm/xlocale.h
+3
-4
dios/libcxx/include/support/musl/xlocale.h
dios/libcxx/include/support/musl/xlocale.h
+3
-4
dios/libcxx/include/support/newlib/xlocale.h
dios/libcxx/include/support/newlib/xlocale.h
+3
-4
dios/libcxx/include/support/solaris/floatingpoint.h
dios/libcxx/include/support/solaris/floatingpoint.h
+3
-4
dios/libcxx/include/support/solaris/wchar.h
dios/libcxx/include/support/solaris/wchar.h
+3
-4
dios/libcxx/include/support/solaris/xlocale.h
dios/libcxx/include/support/solaris/xlocale.h
+3
-4
dios/libcxx/include/support/win32/limits_msvc_win32.h
dios/libcxx/include/support/win32/limits_msvc_win32.h
+3
-4
dios/libcxx/include/support/win32/locale_win32.h
dios/libcxx/include/support/win32/locale_win32.h
+3
-4
dios/libcxx/include/support/xlocale/__nop_locale_mgmt.h
dios/libcxx/include/support/xlocale/__nop_locale_mgmt.h
+3
-4
dios/libcxx/include/support/xlocale/__posix_l_fallback.h
dios/libcxx/include/support/xlocale/__posix_l_fallback.h
+3
-4
dios/libcxx/include/support/xlocale/__strtonum_fallback.h
dios/libcxx/include/support/xlocale/__strtonum_fallback.h
+3
-4
dios/libcxx/include/support/xlocale/xlocale.h
dios/libcxx/include/support/xlocale/xlocale.h
+0
-0
dios/libcxx/include/system_error
dios/libcxx/include/system_error
+3
-4
dios/libcxx/include/tgmath.h
dios/libcxx/include/tgmath.h
+3
-4
dios/libcxx/include/thread
dios/libcxx/include/thread
+13
-73
dios/libcxx/include/tuple
dios/libcxx/include/tuple
+87
-68
dios/libcxx/include/type_traits
dios/libcxx/include/type_traits
+431
-1240
dios/libcxx/include/typeindex
dios/libcxx/include/typeindex
+3
-4
dios/libcxx/include/typeinfo
dios/libcxx/include/typeinfo
+190
-76
dios/libcxx/include/unordered_map
dios/libcxx/include/unordered_map
+173
-28
dios/libcxx/include/unordered_set
dios/libcxx/include/unordered_set
+145
-20
dios/libcxx/include/utility
dios/libcxx/include/utility
+27
-30
dios/libcxx/include/valarray
dios/libcxx/include/valarray
+22
-10
dios/libcxx/include/variant
dios/libcxx/include/variant
+65
-13
dios/libcxx/include/vector
dios/libcxx/include/vector
+23
-19
dios/libcxx/include/version
dios/libcxx/include/version
+11
-6
dios/libcxx/include/wchar.h
dios/libcxx/include/wchar.h
+3
-4
dios/libcxx/include/wctype.h
dios/libcxx/include/wctype.h
+3
-4
dios/libcxx/lib/abi/CHANGELOG.TXT
dios/libcxx/lib/abi/CHANGELOG.TXT
+279
-1
dios/libcxx/lib/abi/x86_64-apple-darwin.v1.abilist
dios/libcxx/lib/abi/x86_64-apple-darwin.v1.abilist
+2422
-2360
dios/libcxx/lib/abi/x86_64-apple-darwin.v2.abilist
dios/libcxx/lib/abi/x86_64-apple-darwin.v2.abilist
+2378
-2315
dios/libcxx/lib/abi/x86_64-unknown-linux-gnu.v1.abilist
dios/libcxx/lib/abi/x86_64-unknown-linux-gnu.v1.abilist
+1919
-1861
dios/libcxx/lib/libc++abi-new-delete.exp
dios/libcxx/lib/libc++abi-new-delete.exp
+14
-2
dios/libcxx/lib/libc++abi.exp
dios/libcxx/lib/libc++abi.exp
+0
-160
dios/libcxx/lib/libc++abi2.exp
dios/libcxx/lib/libc++abi2.exp
+0
-303
dios/libcxx/lib/libc++sjlj-abi.exp
dios/libcxx/lib/libc++sjlj-abi.exp
+0
-160
dios/libcxx/src/CMakeLists.txt
dios/libcxx/src/CMakeLists.txt
+495
-0
dios/libcxx/src/algorithm.cpp
dios/libcxx/src/algorithm.cpp
+8
-4
dios/libcxx/src/any.cpp
dios/libcxx/src/any.cpp
+3
-4
dios/libcxx/src/bind.cpp
dios/libcxx/src/bind.cpp
+3
-4
dios/libcxx/src/charconv.cpp
dios/libcxx/src/charconv.cpp
+47
-120
dios/libcxx/src/chrono.cpp
dios/libcxx/src/chrono.cpp
+22
-9
dios/libcxx/src/condition_variable.cpp
dios/libcxx/src/condition_variable.cpp
+9
-9
dios/libcxx/src/condition_variable_destructor.cpp
dios/libcxx/src/condition_variable_destructor.cpp
+46
-0
dios/libcxx/src/debug.cpp
dios/libcxx/src/debug.cpp
+27
-67
dios/libcxx/src/exception.cpp
dios/libcxx/src/exception.cpp
+4
-6
dios/libcxx/src/experimental/memory_resource.cpp
dios/libcxx/src/experimental/memory_resource.cpp
+20
-14
dios/libcxx/src/filesystem/directory_iterator.cpp
dios/libcxx/src/filesystem/directory_iterator.cpp
+7
-5
dios/libcxx/src/filesystem/filesystem_common.h
dios/libcxx/src/filesystem/filesystem_common.h
+3
-4
dios/libcxx/src/filesystem/int128_builtins.cpp
dios/libcxx/src/filesystem/int128_builtins.cpp
+3
-4
dios/libcxx/src/filesystem/operations.cpp
dios/libcxx/src/filesystem/operations.cpp
+32
-10
dios/libcxx/src/functional.cpp
dios/libcxx/src/functional.cpp
+3
-4
dios/libcxx/src/future.cpp
dios/libcxx/src/future.cpp
+3
-4
dios/libcxx/src/hash.cpp
dios/libcxx/src/hash.cpp
+5
-14
dios/libcxx/src/include/apple_availability.h
dios/libcxx/src/include/apple_availability.h
+3
-4
dios/libcxx/src/include/atomic_support.h
dios/libcxx/src/include/atomic_support.h
+3
-4
dios/libcxx/src/include/config_elast.h
dios/libcxx/src/include/config_elast.h
+5
-4
dios/libcxx/src/include/refstring.h
dios/libcxx/src/include/refstring.h
+3
-4
dios/libcxx/src/ios.cpp
dios/libcxx/src/ios.cpp
+9
-19
dios/libcxx/src/iostream.cpp
dios/libcxx/src/iostream.cpp
+24
-4
dios/libcxx/src/locale.cpp
dios/libcxx/src/locale.cpp
+9
-18
dios/libcxx/src/memory.cpp
dios/libcxx/src/memory.cpp
+6
-4
dios/libcxx/src/mutex.cpp
dios/libcxx/src/mutex.cpp
+24
-22
dios/libcxx/src/mutex_destructor.cpp
dios/libcxx/src/mutex_destructor.cpp
+51
-0
dios/libcxx/src/new.cpp
dios/libcxx/src/new.cpp
+13
-18
dios/libcxx/src/optional.cpp
dios/libcxx/src/optional.cpp
+3
-4
dios/libcxx/src/random.cpp
dios/libcxx/src/random.cpp
+3
-4
dios/libcxx/src/regex.cpp
dios/libcxx/src/regex.cpp
+3
-4
dios/libcxx/src/shared_mutex.cpp
dios/libcxx/src/shared_mutex.cpp
+6
-4
dios/libcxx/src/stdexcept.cpp
dios/libcxx/src/stdexcept.cpp
+7
-92
dios/libcxx/src/string.cpp
dios/libcxx/src/string.cpp
+40
-107
dios/libcxx/src/strstream.cpp
dios/libcxx/src/strstream.cpp
+3
-4
dios/libcxx/src/support/runtime/exception_fallback.ipp
dios/libcxx/src/support/runtime/exception_fallback.ipp
+3
-4
dios/libcxx/src/support/runtime/exception_glibcxx.ipp
dios/libcxx/src/support/runtime/exception_glibcxx.ipp
+3
-4
dios/libcxx/src/support/runtime/exception_libcxxabi.ipp
dios/libcxx/src/support/runtime/exception_libcxxabi.ipp
+3
-4
dios/libcxx/src/support/runtime/exception_libcxxrt.ipp
dios/libcxx/src/support/runtime/exception_libcxxrt.ipp
+3
-4
dios/libcxx/src/support/runtime/exception_msvc.ipp
dios/libcxx/src/support/runtime/exception_msvc.ipp
+5
-6
dios/libcxx/src/support/runtime/exception_pointer_cxxabi.ipp
dios/libcxx/src/support/runtime/exception_pointer_cxxabi.ipp
+3
-4
dios/libcxx/src/support/runtime/exception_pointer_glibcxx.ipp
.../libcxx/src/support/runtime/exception_pointer_glibcxx.ipp
+3
-4
dios/libcxx/src/support/runtime/exception_pointer_msvc.ipp
dios/libcxx/src/support/runtime/exception_pointer_msvc.ipp
+3
-4
dios/libcxx/src/support/runtime/exception_pointer_unimplemented.ipp
...x/src/support/runtime/exception_pointer_unimplemented.ipp
+3
-4
dios/libcxx/src/support/runtime/new_handler_fallback.ipp
dios/libcxx/src/support/runtime/new_handler_fallback.ipp
+3
-4
dios/libcxx/src/support/runtime/stdexcept_default.ipp
dios/libcxx/src/support/runtime/stdexcept_default.ipp
+64
-0
dios/libcxx/src/support/runtime/stdexcept_vcruntime.ipp
dios/libcxx/src/support/runtime/stdexcept_vcruntime.ipp
+16
-0
dios/libcxx/src/support/solaris/xlocale.cpp
dios/libcxx/src/support/solaris/xlocale.cpp
+3
-4
dios/libcxx/src/support/win32/locale_win32.cpp
dios/libcxx/src/support/win32/locale_win32.cpp
+11
-5
dios/libcxx/src/support/win32/support.cpp
dios/libcxx/src/support/win32/support.cpp
+13
-4
dios/libcxx/src/support/win32/thread_win32.cpp
dios/libcxx/src/support/win32/thread_win32.cpp
+4
-5
dios/libcxx/src/system_error.cpp
dios/libcxx/src/system_error.cpp
+3
-4
dios/libcxx/src/thread.cpp
dios/libcxx/src/thread.cpp
+9
-6
dios/libcxx/src/typeinfo.cpp
dios/libcxx/src/typeinfo.cpp
+8
-9
dios/libcxx/src/utility.cpp
dios/libcxx/src/utility.cpp
+3
-4
dios/libcxx/src/valarray.cpp
dios/libcxx/src/valarray.cpp
+7
-4
dios/libcxx/src/variant.cpp
dios/libcxx/src/variant.cpp
+3
-4
dios/libcxx/src/vector.cpp
dios/libcxx/src/vector.cpp
+3
-4
dios/libcxx/utils/cat_files.py
dios/libcxx/utils/cat_files.py
+3
-4
dios/rst/common.cpp
dios/rst/common.cpp
+2
-5
dios/rst/constant.cpp
dios/rst/constant.cpp
+24
-0
dios/rst/content.cpp
dios/rst/content.cpp
+0
-57
dios/rst/formula.cpp
dios/rst/formula.cpp
+0
-40
dios/rst/lart.cpp
dios/rst/lart.cpp
+32
-5
dios/rst/mstring.cpp
dios/rst/mstring.cpp
+0
-243
dios/rst/star.cpp
dios/rst/star.cpp
+0
-88
dios/rst/sym.cpp
dios/rst/sym.cpp
+0
-262
dios/rst/term.cpp
dios/rst/term.cpp
+56
-0
dios/rst/tristate.cpp
dios/rst/tristate.cpp
+13
-22
dios/rst/unit.cpp
dios/rst/unit.cpp
+39
-0
dios/rst/weakmem.cpp
dios/rst/weakmem.cpp
+3
-3
dios/rst/zero.cpp
dios/rst/zero.cpp
+0
-5
dios/sys/sched_base.hpp
dios/sys/sched_base.hpp
+1
-1
dios/vfs/base.cpp
dios/vfs/base.cpp
+1
-1
dios/vfs/socket.hpp
dios/vfs/socket.hpp
+1
-1
divine/CMakeLists.txt
divine/CMakeLists.txt
+1
-0
divine/cc/cc1.cpp
divine/cc/cc1.cpp
+25
-35
divine/cc/cc1.hpp
divine/cc/cc1.hpp
+3
-3
divine/cc/driver.cpp
divine/cc/driver.cpp
+2
-1
divine/cc/driver.hpp
divine/cc/driver.hpp
+0
-2
divine/cc/link.cpp
divine/cc/link.cpp
+3
-1
divine/cc/native.cpp
divine/cc/native.cpp
+2
-2
divine/cc/native.hpp
divine/cc/native.hpp
+1
-1
divine/cc/options.cpp
divine/cc/options.cpp
+10
-7
divine/cc/options.hpp
divine/cc/options.hpp
+1
-0
divine/cc/vfs.hpp
divine/cc/vfs.hpp
+3
-3
divine/dbg/node.cpp
divine/dbg/node.cpp
+6
-6
divine/dbg/node.hpp
divine/dbg/node.hpp
+2
-0
divine/mc/bitcode.cpp
divine/mc/bitcode.cpp
+12
-0
divine/mc/bitcode.hpp
divine/mc/bitcode.hpp
+3
-17
divine/mc/builder.hpp
divine/mc/builder.hpp
+0
-146
divine/mc/context.hpp
divine/mc/context.hpp
+2
-3
divine/mc/ctx-assume.hpp
divine/mc/ctx-assume.hpp
+1
-2
divine/mc/draw.hpp
divine/mc/draw.hpp
+1
-0
divine/mc/job.tpp
divine/mc/job.tpp
+1
-1
divine/mc/liveness.hpp
divine/mc/liveness.hpp
+1
-0
divine/mc/safety.hpp
divine/mc/safety.hpp
+0
-28
divine/mc/t-builder.hpp
divine/mc/t-builder.hpp
+165
-0
divine/mc/t-common.hpp
divine/mc/t-common.hpp
+34
-0
divine/mc/t-machine.hpp
divine/mc/t-machine.hpp
+2
-1
divine/mc/t-safety.hpp
divine/mc/t-safety.hpp
+44
-0
divine/mem/base.hpp
divine/mem/base.hpp
+1
-1
divine/mem/definedness.hpp
divine/mem/definedness.hpp
+1
-1
divine/mem/metadata.hpp
divine/mem/metadata.hpp
+8
-12
divine/mem/pointers.hpp
divine/mem/pointers.hpp
+4
-4
divine/mem/taint.hpp
divine/mem/taint.hpp
+1
-1
divine/mem/types.hpp
divine/mem/types.hpp
+4
-4
divine/mem/usermeta.hpp
divine/mem/usermeta.hpp
+3
-3
divine/mem/util.tpp
divine/mem/util.tpp
+1
-1
divine/sim/cli.hpp
divine/sim/cli.hpp
+3
-3
divine/sim/command.hpp
divine/sim/command.hpp
+5
-1
divine/sim/dispatch.cpp
divine/sim/dispatch.cpp
+26
-14
divine/sim/exec.cpp
divine/sim/exec.cpp
+1
-1
divine/sim/parser.cpp
divine/sim/parser.cpp
+6
-1
divine/sim/sim.cpp
divine/sim/sim.cpp
+3
-4
divine/sim/var.cpp
divine/sim/var.cpp
+2
-2
divine/smt/builder-common.hpp
divine/smt/builder-common.hpp
+20
-15
divine/smt/builder-smtlib.cpp
divine/smt/builder-smtlib.cpp
+97
-79
divine/smt/builder-smtlib.hpp
divine/smt/builder-smtlib.hpp
+5
-4
divine/smt/builder-stp.cpp
divine/smt/builder-stp.cpp
+85
-74
divine/smt/builder-stp.hpp
divine/smt/builder-stp.hpp
+18
-6
divine/smt/builder-z3.cpp
divine/smt/builder-z3.cpp
+128
-108
divine/smt/builder-z3.hpp
divine/smt/builder-z3.hpp
+5
-4
divine/smt/builder.hpp
divine/smt/builder.hpp
+0
-1
divine/smt/extract.cpp
divine/smt/extract.cpp
+1
-27
divine/smt/extract.hpp
divine/smt/extract.hpp
+5
-3
divine/smt/rpn.hpp
divine/smt/rpn.hpp
+159
-0
divine/smt/solver.cpp
divine/smt/solver.cpp
+40
-45
divine/smt/union-find.hpp
divine/smt/union-find.hpp
+115
-0
divine/ui/cli.cpp
divine/ui/cli.cpp
+14
-6
divine/ui/cli.hpp
divine/ui/cli.hpp
+2
-18
divine/ui/die.cpp
divine/ui/die.cpp
+104
-0
divine/ui/die.hpp
divine/ui/die.hpp
+39
-5
divine/ui/parser.hpp
divine/ui/parser.hpp
+9
-8
divine/vm/constants.cpp
divine/vm/constants.cpp
+1
-1
divine/vm/divm.h
divine/vm/divm.h
+2
-2
divine/vm/eval-fault.hpp
divine/vm/eval-fault.hpp
+4
-3
divine/vm/eval-hyper.tpp
divine/vm/eval-hyper.tpp
+1
-1
divine/vm/eval-intrin.tpp
divine/vm/eval-intrin.tpp
+1
-1
divine/vm/eval-ops.tpp
divine/vm/eval-ops.tpp
+5
-0
divine/vm/eval-slot.tpp
divine/vm/eval-slot.tpp
+5
-2
divine/vm/eval.hpp
divine/vm/eval.hpp
+30
-5
divine/vm/eval.tpp
divine/vm/eval.tpp
+6
-8
divine/vm/lx-type.hpp
divine/vm/lx-type.hpp
+1
-1
divine/vm/program.cpp
divine/vm/program.cpp
+10
-17
divine/vm/setup.hpp
divine/vm/setup.hpp
+1
-1
divine/vm/value.hpp
divine/vm/value.hpp
+6
-0
doc/AUTHORS
doc/AUTHORS
+1
-1
doc/CMakeLists.txt
doc/CMakeLists.txt
+1
-1
doc/COPYING
doc/COPYING
+1
-1
doc/internals/14_rst.md
doc/internals/14_rst.md
+119
-0
doc/manual/about.txt
doc/manual/about.txt
+1
-1
doc/website/CMakeLists.txt
doc/website/CMakeLists.txt
+1
-1
doc/website/template.html
doc/website/template.html
+1
-1
lart/abstract/annotation.cpp
lart/abstract/annotation.cpp
+45
-0
lart/abstract/annotation.h
lart/abstract/annotation.h
+2
-3
lart/abstract/assume.cpp
lart/abstract/assume.cpp
+8
-5
lart/abstract/branching.cpp
lart/abstract/branching.cpp
+25
-18
lart/abstract/cleanup.cpp
lart/abstract/cleanup.cpp
+21
-30
lart/abstract/concretization.cpp
lart/abstract/concretization.cpp
+0
-241
lart/abstract/dfa.cpp
lart/abstract/dfa.cpp
+337
-0
lart/abstract/dfa.h
lart/abstract/dfa.h
+216
-0
lart/abstract/domain.cpp
lart/abstract/domain.cpp
+2
-339
lart/abstract/domain.h
lart/abstract/domain.h
+1
-111
lart/abstract/init.cpp
lart/abstract/init.cpp
+343
-0
lart/abstract/init.h
lart/abstract/init.h
+76
-0
lart/abstract/interrupt.cpp
lart/abstract/interrupt.cpp
+12
-12
lart/abstract/meta.cpp
lart/abstract/meta.cpp
+28
-94
lart/abstract/meta.h
lart/abstract/meta.h
+26
-35
lart/abstract/operation.cpp
lart/abstract/operation.cpp
+158
-0
lart/abstract/operation.h
lart/abstract/operation.h
+207
-0
lart/abstract/operation.tpp
lart/abstract/operation.tpp
+118
-0
lart/abstract/passes.h
lart/abstract/passes.h
+11
-8
lart/abstract/placeholder.cpp
lart/abstract/placeholder.cpp
+0
-34
lart/abstract/placeholder.tpp
lart/abstract/placeholder.tpp
+0
-360
lart/abstract/stash.cpp
lart/abstract/stash.cpp
+184
-68
lart/abstract/stash.h
lart/abstract/stash.h
+16
-13
lart/abstract/syntactic.cpp
lart/abstract/syntactic.cpp
+86
-40
lart/abstract/synthesize.cpp
lart/abstract/synthesize.cpp
+267
-246
lart/abstract/tainting.cpp
lart/abstract/tainting.cpp
+424
-283
lart/abstract/tainting.h
lart/abstract/tainting.h
+14
-101
lart/abstract/test.h
lart/abstract/test.h
+13
-5
lart/abstract/util.cpp
lart/abstract/util.cpp
+26
-50
lart/abstract/util.h
lart/abstract/util.h
+341
-39
lart/abstract/vpa.cpp
lart/abstract/vpa.cpp
+0
-495
lart/abstract/vpa.h
lart/abstract/vpa.h
+0
-42
lart/divine/abstrub.cpp
lart/divine/abstrub.cpp
+99
-0
lart/divine/functionmeta.cpp
lart/divine/functionmeta.cpp
+5
-3
lart/divine/fusectors.cpp
lart/divine/fusectors.cpp
+142
-0
lart/divine/indirectionstubber.cpp
lart/divine/indirectionstubber.cpp
+227
-0
lart/divine/indirectionstubber.h
lart/divine/indirectionstubber.h
+97
-0
lart/divine/interrupt.cpp
lart/divine/interrupt.cpp
+18
-6
lart/divine/passes.h
lart/divine/passes.h
+5
-2
lart/divine/stubs.cpp
lart/divine/stubs.cpp
+17
-21
lart/divine/stubs.h
lart/divine/stubs.h
+14
-0
lart/driver.h
lart/driver.h
+3
-0
lart/reduction/mask.cpp
lart/reduction/mask.cpp
+8
-3
lart/support/annotate.cpp
lart/support/annotate.cpp
+110
-0
lart/support/annotate.h
lart/support/annotate.h
+130
-0
lart/support/lowerselect.cpp
lart/support/lowerselect.cpp
+15
-10
lart/support/lowerselect.h
lart/support/lowerselect.h
+12
-2
lart/support/metadata.h
lart/support/metadata.h
+7
-0
lart/support/util.h
lart/support/util.h
+8
-1
lld/lib/CMakeLists.txt
lld/lib/CMakeLists.txt
+1
-1
llvm/cmake/modules/AddLLVM.cmake
llvm/cmake/modules/AddLLVM.cmake
+5
-0
releng/cmake/FindZ3.cmake
releng/cmake/FindZ3.cmake
+1
-1
releng/install-rpath.cmake
releng/install-rpath.cmake
+217
-161
stp/lib/Interface/CMakeLists.txt
stp/lib/Interface/CMakeLists.txt
+0
-14
test/CMakeLists.txt
test/CMakeLists.txt
+1
-1
test/README
test/README
+7
-16
test/abstract/constant-casts.cpp
test/abstract/constant-casts.cpp
+21
-0
test/abstract/constant-shifts.cpp
test/abstract/constant-shifts.cpp
+17
-0
test/abstract/constant-simple-a.cpp
test/abstract/constant-simple-a.cpp
+15
-0
test/abstract/mstring-a.cpp
test/abstract/mstring-a.cpp
+1
-1
test/abstract/mstring-access-a.cpp
test/abstract/mstring-access-a.cpp
+1
-1
test/abstract/mstring-call-a.cpp
test/abstract/mstring-call-a.cpp
+1
-1
test/abstract/mstring-constructor-a.cpp
test/abstract/mstring-constructor-a.cpp
+1
-1
test/abstract/mstring-memcpy-a.cpp
test/abstract/mstring-memcpy-a.cpp
+1
-1
test/abstract/mstring-null-termination-a.cpp
test/abstract/mstring-null-termination-a.cpp
+1
-1
test/abstract/mstring-offset-a.cpp
test/abstract/mstring-offset-a.cpp
+1
-1
test/abstract/mstring-store-a.cpp
test/abstract/mstring-store-a.cpp
+1
-1
test/abstract/mstring-store-b.cpp
test/abstract/mstring-store-b.cpp
+1
-1
test/abstract/mstring-strcat-a.cpp
test/abstract/mstring-strcat-a.cpp
+1
-1
test/abstract/mstring-strcat-b.cpp
test/abstract/mstring-strcat-b.cpp
+1
-1
test/abstract/mstring-strcat-libc.pkg.cpp
test/abstract/mstring-strcat-libc.pkg.cpp
+1
-1
test/abstract/mstring-strchr-a.cpp
test/abstract/mstring-strchr-a.cpp
+1
-1
test/abstract/mstring-strchr-b.cpp
test/abstract/mstring-strchr-b.cpp
+1
-1
test/abstract/mstring-strcmp-a.cpp
test/abstract/mstring-strcmp-a.cpp
+1
-1
test/abstract/mstring-strcmp-b.cpp
test/abstract/mstring-strcmp-b.cpp
+1
-1
test/abstract/mstring-strcmp-c.cpp
test/abstract/mstring-strcmp-c.cpp
+1
-1
test/abstract/mstring-strcmp-libc.pkg.cpp
test/abstract/mstring-strcmp-libc.pkg.cpp
+1
-1
test/abstract/mstring-strcpy-a.cpp
test/abstract/mstring-strcpy-a.cpp
+1
-1
test/abstract/mstring-strcpy-b.cpp
test/abstract/mstring-strcpy-b.cpp
+1
-1
test/abstract/mstring-strcpy-c.cpp
test/abstract/mstring-strcpy-c.cpp
+1
-1
test/abstract/mstring-strcpy-libc.pkg.cpp
test/abstract/mstring-strcpy-libc.pkg.cpp
+1
-1
test/abstract/mstring-strlen-libc.pkg.cpp
test/abstract/mstring-strlen-libc.pkg.cpp
+1
-1
test/abstract/mstring-strlen.cpp
test/abstract/mstring-strlen.cpp
+1
-1
test/abstract/star-simple-a.cpp
test/abstract/star-simple-a.cpp
+1
-1
test/abstract/sym-split-construct.cpp
test/abstract/sym-split-construct.cpp
+1
-1
test/abstract/sym-split-memcpy.cpp
test/abstract/sym-split-memcpy.cpp
+1
-1
test/abstract/sym-split-strcat.cpp
test/abstract/sym-split-strcat.cpp
+1
-1
test/abstract/sym-split-strchr.cpp
test/abstract/sym-split-strchr.cpp
+1
-1
test/abstract/sym-split-strcmp.cpp
test/abstract/sym-split-strcmp.cpp
+1
-1
test/abstract/sym-split-strcpy.cpp
test/abstract/sym-split-strcpy.cpp
+1
-1
test/abstract/sym-split-strlen.cpp
test/abstract/sym-split-strlen.cpp
+1
-1
test/abstract/sym-split-write.cpp
test/abstract/sym-split-write.cpp
+1
-1
test/bricks/bitlevel.bt
test/bricks/bitlevel.bt
+14
-0
test/bricks/brick-assert.bt
test/bricks/brick-assert.bt
+0
-2
test/bricks/brick-benchmark.bt
test/bricks/brick-benchmark.bt
+0
-2
test/bricks/brick-bitlevel.bt
test/bricks/brick-bitlevel.bt
+0
-5
test/bricks/brick-cmd.bt
test/bricks/brick-cmd.bt
+0
-1
test/bricks/brick-commandline.bt
test/bricks/brick-commandline.bt
+0
-1
test/bricks/brick-data.bt
test/bricks/brick-data.bt
+0
-1
test/bricks/brick-except.bt
test/bricks/brick-except.bt
+0
-1
test/bricks/brick-fs.bt
test/bricks/brick-fs.bt
+0
-2
test/bricks/brick-gnuplot.bt
test/bricks/brick-gnuplot.bt
+0
-1
test/bricks/brick-hash.bt
test/bricks/brick-hash.bt
+0
-4
test/bricks/brick-hashset.bt
test/bricks/brick-hashset.bt
+0
-1
test/bricks/brick-hlist.bt
test/bricks/brick-hlist.bt
+0
-1
test/bricks/brick-llvm.bt
test/bricks/brick-llvm.bt
+0
-1
test/bricks/brick-mem.bt
test/bricks/brick-mem.bt
+0
-2
test/bricks/brick-mmap.bt
test/bricks/brick-mmap.bt
+0
-2
test/bricks/brick-parse.bt
test/bricks/brick-parse.bt
+0
-1
test/bricks/brick-proc.bt
test/bricks/brick-proc.bt
+0
-2
test/bricks/brick-query.bt
test/bricks/brick-query.bt
+0
-1
test/bricks/brick-rpc.bt
test/bricks/brick-rpc.bt
+0
-1
test/bricks/brick-shelltest.bt
test/bricks/brick-shelltest.bt
+0
-2
test/bricks/brick-shmem.bt
test/bricks/brick-shmem.bt
+0
-1
test/bricks/brick-smt.bt
test/bricks/brick-smt.bt
+0
-1
test/bricks/brick-string.bt
test/bricks/brick-string.bt
+0
-1
test/bricks/brick-tuple.bt
test/bricks/brick-tuple.bt
+0
-1
test/bricks/brick-types.bt
test/bricks/brick-types.bt
+0
-1
test/bricks/brick-unittest.bt
test/bricks/brick-unittest.bt
+0
-1
test/bricks/cmd.bt
test/bricks/cmd.bt
+15
-0
test/bricks/commandline.bt
test/bricks/commandline.bt
+11
-0
test/bricks/compact.bt
test/bricks/compact.bt
+7
-0
test/bricks/compose.bt
test/bricks/compose.bt
+2
-0
test/bricks/cxa_demangle.helper.cpp
test/bricks/cxa_demangle.helper.cpp
+0
-5005
test/bricks/data.bt
test/bricks/data.bt
+23
-0
test/bricks/fs.bt
test/bricks/fs.bt
+14
-0
test/bricks/hash.bt
test/bricks/hash.bt
+9
-0
test/bricks/hashset.bt
test/bricks/hashset.bt
+46
-0
test/bricks/hlist.bt
test/bricks/hlist.bt
+4
-0
test/bricks/llvm-link.bt
test/bricks/llvm-link.bt
+8
-0
test/bricks/mem.bt
test/bricks/mem.bt
+12
-0
test/bricks/mmap.bt
test/bricks/mmap.bt
+4
-0
test/bricks/parse.bt
test/bricks/parse.bt
+2
-0
test/bricks/proc.bt
test/bricks/proc.bt
+11
-0
test/bricks/ptr.bt
test/bricks/ptr.bt
+17
-0
test/bricks/query.bt
test/bricks/query.bt
+21
-0
test/bricks/rpc.bt
test/bricks/rpc.bt
+5
-0
test/bricks/sha2.bt
test/bricks/sha2.bt
+3
-0
test/bricks/shmem.bt
test/bricks/shmem.bt
+7
-0
test/bricks/smt.bt
test/bricks/smt.bt
+4
-0
test/bricks/string.bt
test/bricks/string.bt
+8
-0
test/bricks/tuple.bt
test/bricks/tuple.bt
+19
-0
test/bricks/types.bt
test/bricks/types.bt
+28
-0
test/bricks/unitreg.pkg.cpp
test/bricks/unitreg.pkg.cpp
+16
-0
test/bricks/unittest.bt
test/bricks/unittest.bt
+5
-0
test/bricks/yaml.bt
test/bricks/yaml.bt
+13
-0
test/demo/deadlock.c
test/demo/deadlock.c
+1
-1
test/dios/internal/map.cpp
test/dios/internal/map.cpp
+1
-1
test/dioscc/static-dynamic.sh
test/dioscc/static-dynamic.sh
+21
-0
test/divbench-import
test/divbench-import
+1
-0
test/lang-c/global-ctors-dtors-return-type.c
test/lang-c/global-ctors-dtors-return-type.c
+33
-0
test/lang-c/global-ctors-dtors.c
test/lang-c/global-ctors-dtors.c
+1
-1
test/lang-c/longjmp-complex-args.c
test/lang-c/longjmp-complex-args.c
+34
-0
test/lang-cpp/exception-catchspec-error.cpp
test/lang-cpp/exception-catchspec-error.cpp
+1
-1
test/lang-cpp/exception-catchspec-error2.cpp
test/lang-cpp/exception-catchspec-error2.cpp
+1
-1
test/lang-cpp/exception-uncaught-thread.cpp
test/lang-cpp/exception-uncaught-thread.cpp
+1
-1
test/lang-cpp/exception-uncaught.cpp
test/lang-cpp/exception-uncaught.cpp
+1
-1
test/lang-cpp/nounwind.cpp
test/lang-cpp/nounwind.cpp
+1
-1
test/lart/abstrub-a.c
test/lart/abstrub-a.c
+11
-0
test/lart/abstrub-b.c
test/lart/abstrub-b.c
+12
-0
test/lib/brick-unpack
test/lib/brick-unpack
+39
-35
test/lib/check
test/lib/check
+7
-6
test/lib/pkgc-unpack
test/lib/pkgc-unpack
+1
-1
test/lib/testcase
test/lib/testcase
+3
-2
test/lib/testsuite
test/lib/testsuite
+1
-1
test/lib/verify
test/lib/verify
+88
-34
test/misc/help.sh
test/misc/help.sh
+2
-0
test/pthread/div/create-invalid-1.c
test/pthread/div/create-invalid-1.c
+13
-0
test/pthread/div/create-invalid-2.c
test/pthread/div/create-invalid-2.c
+10
-0
test/pthread/div/create-invalid-3.c
test/pthread/div/create-invalid-3.c
+8
-0
test/sim/call-choose.sh
test/sim/call-choose.sh
+1
-1
test/sim/call-dbg.sh
test/sim/call-dbg.sh
+1
-1
test/svcomp/array/data_structures_set_multi_proc_false.c
test/svcomp/array/data_structures_set_multi_proc_false.c
+3
-3
test/svcomp/array/standard_copy8_false.pkg.c
test/svcomp/array/standard_copy8_false.pkg.c
+1
-1
test/svcomp/pthread/buggy_simple_loop1_vf_false.c
test/svcomp/pthread/buggy_simple_loop1_vf_false.c
+1
-1
test/svcomp/recursion/afterrec_2calls_false.c
test/svcomp/recursion/afterrec_2calls_false.c
+1
-1
test/svcomp/systemc/token_ring.02_false.cil.c
test/svcomp/systemc/token_ring.02_false.cil.c
+1
-1
test/sym/float-a.pkg.cpp
test/sym/float-a.pkg.cpp
+1
-1
test/sym/float-b.pkg.cpp
test/sym/float-b.pkg.cpp
+1
-1
test/sym/float-d.pkg.cpp
test/sym/float-d.pkg.cpp
+1
-1
test/verify/capture-list.cpp
test/verify/capture-list.cpp
+2
-0
test/vm/indirectbr-invalid.c
test/vm/indirectbr-invalid.c
+1
-1
tools/bench-common.sql
tools/bench-common.sql
+17
-0
tools/bench-external.cpp
tools/bench-external.cpp
+4
-4
tools/bench-postgres.sql
tools/bench-postgres.sql
+45
-0
tools/bench-report.cpp
tools/bench-report.cpp
+249
-146
tools/bench-run.cpp
tools/bench-run.cpp
+1
-1
tools/divbench.cpp
tools/divbench.cpp
+14
-11
tools/divbench.hpp
tools/divbench.hpp
+54
-1
tools/divcc.cpp
tools/divcc.cpp
+4
-2
tools/divcheck.cpp
tools/divcheck.cpp
+2
-0
tools/divcheck.hpp
tools/divcheck.hpp
+39
-26
tools/divine.cpp
tools/divine.cpp
+4
-77
tools/runtime-cc.cpp
tools/runtime-cc.cpp
+1
-1
No files found.
.gitlab-ci.yml
0 → 100644
View file @
192f10e2
# common configuration parts
.common
:
&common
before_script
:
-
rm -rf .git
# ups
tags
:
-
shared-fi
.debian
:
&debian
image
:
cxx:latest
script
:
-
apt-get update >& apt.log
-
make prerequisites >& prerequisites.log
-
make toolchain >& toolchain.log
-
make CMAKE_EXTRA="-DOPT_Z3=OFF" >& build.log
-
make unit >& unit.log
-
make functional >& functional.log
artifacts
:
paths
:
-
"
*.log"
expire_in
:
1 month
when
:
always
# actual builds
build_clang
:
<<
:
*common
<<
:
*debian
variables
:
CC
:
"
clang"
CXX
:
"
clang++"
build_gcc
:
<<
:
*common
<<
:
*debian
variables
:
CC
:
"
gcc"
CXX
:
"
g++"
Makefile
View file @
192f10e2
...
...
@@ -2,6 +2,7 @@ GENERATOR != if ninja --version > /dev/null 2>&1 || \
ninja-build
--version
>
/dev/null 2>&1
;
then
echo
Ninja
;
else
echo
Unix Makefiles
;
fi
# fallback
GENERATOR
?=
Unix Makefiles
.CURDIR
?=
$(CURDIR)
-include
/etc/divine.make
# for system-wide config
-include
local.make
...
...
@@ -14,7 +15,7 @@ PREFIX ?= /opt/divine
RELEASE_BUILD_TYPE
?=
RelWithDebInfo
MAKEFLAGS
?=
--no-print-directory
OBJ
?=
$(
PWD
)
/_build.
OBJ
?=
$
(
.CURDIR
)
/_build.
BENCH_NAME
?=
$(LOGNAME)
EXTRA
!=
if
test
"
$(GENERATOR)
"
=
Ninja
&&
test
-n
"
$(VERBOSE)
"
;
then
echo
-v
-d
explain
;
fi
;
\
if
test
-n
"
$(JOBS)
"
;
then
echo
-j
$(JOBS)
;
fi
...
...
@@ -22,7 +23,7 @@ EXTRA != if test "$(GENERATOR)" = Ninja && test -n "$(VERBOSE)"; then echo -v -d
TOOLDIR
=
$(OBJ)
toolchain
CLANG
=
$(TOOLDIR)
/clang/
RTBIN
=
$(TOOLDIR)
/dios
RTSRC
=
$(
PWD
)
/dios
RTSRC
=
$
(
.CURDIR
)
/dios
LIBUNWIND_LDIR
=
$(RTBIN)
/libunwind/src
CXX_LDIR
=
$(TOOLDIR)
/lib
...
...
@@ -40,7 +41,7 @@ CXXFLAGS_ = -isystem $(RTSRC)/libcxxabi/include -isystem $(RTSRC)/libcxx/include
TOOLCHAIN_
=
CMAKE_C_COMPILER
=
$(CLANG)
/bin/clang
;
CMAKE_CXX_COMPILER
=
$(CLANG)
/bin/clang++
;
\
CMAKE_CXX_FLAGS
=
$(CXXFLAGS_)
TOOLCHAIN
?=
$(TOOLCHAIN_)
;
CMAKE_EXE_LINKER_FLAGS
=
$(LDFLAGS_)
;
CMAKE_SHARED_LINKER_FLAGS
=
$(LDFLAGS_)
TOOLSTAMP
?=
$(TOOLDIR)
/stamp-v
7
TOOLSTAMP
?=
$(TOOLDIR)
/stamp-v
8
CONFIG
+=
CMAKE_INSTALL_PREFIX
=
${PREFIX}
static_FLAGS
+=
CMAKE_BUILD_TYPE
=
Release
;
$(TOOLCHAIN)
;
$(CONFIG)
;
BUILD_SHARED_LIBS
=
OFF
;
STATIC_BUILD
=
ON
...
...
@@ -67,6 +68,7 @@ NORMAL = divine unit functional website check llvm-utils clang \
test-divine test-lart test-bricks shoop
TARGETS
=
$(NORMAL)
$(SPECIAL)
functional
:
divcheck
${NORMAL}
:
$(MAKE)
$(DEFAULT_FLAVOUR)
-
$@
...
...
@@ -83,7 +85,7 @@ divbench-install:
sh releng/install-divbench.sh
$(OBJ)
bench/tools/divbench
$(BENCH_DIR)
$(BENCH_NAME)
\
$(SKIP_SCHEDULE)
SETENV
=
env
BUILD_RPATH
=
$(BUILD_RPATH)
TESTHOOK
=
"
$(TESTHOOK)
"
JOBS
=
"
$(JOBS)
"
TEST_ALLOW_DOWNLOADS
=
"
$(TEST_ALLOW_DOWNLOADS)
"
SETENV
=
env
BUILD_RPATH
=
$(BUILD_RPATH)
TESTHOOK
=
"
$(TESTHOOK)
"
JOBS
=
"
$(JOBS)
"
TEST_ALLOW_DOWNLOADS
=
"
$(TEST_ALLOW_DOWNLOADS)
"
OBJ
=
"
$(OBJ)
"
OF
=
$(OBJ)$(FLAVOUR)
/
DIRENV_PATH
=
$(OF)
/tools:
$(OF)
/llvm/bin:
$(OBJ)
bench/tools:
$(OF)
/divine:
$(OF)
/lart:
$(OF)
...
...
@@ -94,7 +96,7 @@ config:
$(CMAKE)
-E
copy_if_different
$(OBJ)$(FLAVOUR)
/config.tmp
$(OBJ)$(FLAVOUR)
/config.vars
if
!
test
-e
$(OBJ)$(FLAVOUR)
/config.done
||
test
-n
"
$(FORCE_CMAKE)
"
;
then
\
chmod
+x
test
/divine
;
\
cd
$(OBJ)$(FLAVOUR)
&&
$(CMAKE)
$(
PWD
)
$(CMAKE_EXTRA)
-G
"
$(GENERATOR)
"
&&
\
cd
$(OBJ)$(FLAVOUR)
&&
$(CMAKE)
$
(
.CURDIR
)
$(CMAKE_EXTRA)
-G
"
$(GENERATOR)
"
&&
\
touch
$(OBJ)$(FLAVOUR)
/config.done
;
fi
build
:
config
...
...
bricks/brick-assert
View file @
192f10e2
...
...
@@ -19,9 +19,12 @@
#pragma once
#include "brick-trace"
#include <exception>
#include <unistd.h>
#ifdef __divine__
#include <sys/fault.h>
#endif
/* This file provides an assortment of assertion macros which provide
* additional information about the circumstances of assertion failures, for
* instance ASSERT_EQ will print both the source code statement and the actual
...
...
@@ -47,35 +50,39 @@
#ifdef NDEBUG
#define ASSERT(...)
static_cast< decltype(__VA_ARGS__, void(0)) >(0)
#define ASSERT_PRED(
p, x) static_cast< decltype(p, x
, void(0)) >(0)
#define ASSERT_EQ(
x, y) static_cast< decltype(x, y
, void(0)) >(0)
#define ASSERT_LEQ(
x, y) static_cast< decltype(x, y
, void(0)) >(0)
#define ASSERT_LT(
x, y) static_cast< decltype(x, y
, void(0)) >(0)
#define ASSERT_NEQ(
x, y) static_cast< decltype(x, y
, void(0)) >(0)
#define ASSERT(...) static_cast< decltype(__VA_ARGS__, void(0)) >(0)
#define ASSERT_PRED(
...) static_cast< decltype(__VA_ARGS__
, void(0)) >(0)
#define ASSERT_EQ(
...) static_cast< decltype(__VA_ARGS__
, void(0)) >(0)
#define ASSERT_LEQ(
...) static_cast< decltype(__VA_ARGS__
, void(0)) >(0)
#define ASSERT_LT(
...) static_cast< decltype(__VA_ARGS__
, void(0)) >(0)
#define ASSERT_NEQ(
...) static_cast< decltype(__VA_ARGS__
, void(0)) >(0)
#else
#define ASSERT(...) BRICK_ASSERT( bool, BRICK_SHARP_FIRST( __VA_ARGS__, ignored ), __VA_ARGS__ )
#define ASSERT_P(p, x) BRICK_ASSERT( pred, #p "( " #x " )", x, p( x ) )
#define ASSERT_EQ(x, y) BRICK_ASSERT( eq, #x " == " #y, x, y )
#define ASSERT_LT(x, y) BRICK_ASSERT( lt, #x " < " #y, x, y )
#define ASSERT_LEQ(x, y) BRICK_ASSERT( leq, #x " <= " #y, x, y )
#define ASSERT_NEQ(x, y) BRICK_ASSERT( neq, #x " != " #y, x, y )
#define BRICK_ASSERT_BIN(op, inv, x, ...) \
BRICK_ASSERT( bin, \
#x " " #op " " BRICK_SHARP_FIRST( __VA_ARGS__, ignored ), \
[]( const auto &a, const auto &b ) { return a op b; }, \
#inv, x, __VA_ARGS__ )
#define ASSERT(...) BRICK_ASSERT( bool, BRICK_SHARP_FIRST( __VA_ARGS__, ignored ), __VA_ARGS__ )
#define ASSERT_P(p, x) BRICK_ASSERT( pred, #p "( " #x " )", x, p( x ) )
#define ASSERT_EQ(...) BRICK_ASSERT_BIN( ==, !=, __VA_ARGS__ )
#define ASSERT_LT(...) BRICK_ASSERT_BIN( <, >=, __VA_ARGS__ )
#define ASSERT_LEQ(...) BRICK_ASSERT_BIN( <=, >, __VA_ARGS__ )
#define ASSERT_NEQ(...) BRICK_ASSERT_BIN( !=, ==, __VA_ARGS__ )
#endif
/* you must #include <brick-string> to use UNREACHABLE_F */
#define UNREACHABLE_F(...) BRICK_ASSERT( die, "", ::brick::string::fmtf(__VA_ARGS__) )
#define UNREACHABLE(...) BRICK_ASSERT( die, "", __VA_ARGS__ )
#define UNREACHABLE_() BRICK_ASSERT( die, "", "" )
#define NOT_IMPLEMENTED() BRICK_ASSERT( die, "", "missing implementation" )
#define BRICK_LOCATION(stmt) ::brq::trace_location{ __LINE__, __FILE__, stmt }
namespace
brq
{
struct
assert_failed
:
std
::
exception
struct
assert_failed
{
string_builder
str
;
...
...
@@ -125,6 +132,18 @@ namespace brq
const
char
*
what
()
const
noexcept
{
return
str
.
buffer
();
}
};
[[
noreturn
]]
static
inline
void
assert_signal
(
assert_failed
&
err
)
{
#if defined(__divine__)
if
(
err
.
str
.
truncated
()
)
__vm_cancel
();
__dios_fault
(
_VM_F_Assert
,
err
.
what
()
);
__builtin_trap
();
#else
throw
std
::
move
(
err
);
#endif
}
template
<
typename
X
,
typename
...
Y
>
void
assert_bool_fn
(
const
trace_location
&
l
,
const
X
&
x
,
const
Y
&
...
y
)
{
...
...
@@ -132,7 +151,7 @@ namespace brq
return
;
assert_failed
f
(
l
);
format_args
(
f
,
y
...
);
throw
f
;
assert_signal
(
f
)
;
}
template
<
typename
...
T
>
...
...
@@ -141,43 +160,29 @@ namespace brq
{
assert_failed
f
(
l
,
"unreachable executed:"
);
format_args
(
f
,
args
...
);
throw
f
;
assert_signal
(
f
)
;
}
#define ASSERT_FN(name, op, inv) \
__boring static inline \
void assert_ ## name ## _fn( const trace_location &l, int64_t x, int64_t y ) \
{ \
if ( !( x op y ) ) \
{ \
assert_failed f( l ); \
f << "\n but got " \
<< x << " " #inv " " << y << "\n"; \
throw f; \
} \
/* trace_fn( l, "assert passed:", l._statement, "[", x, #op, y, "]" ); */
\
} \
template< typename X, typename Y > \
__boring auto assert_ ## name ## _fn( const trace_location &l, const X &x, const Y &y ) \
-> typename std::enable_if< \
!std::is_integral< X >::value || \
!std::is_integral< Y >::value >::type \
{ \
if ( !( x op y ) ) \
{ \
assert_failed f( l ); \
f << "\n but got " \
<< x << " " #inv " " << y << "\n"; \
throw f; \
} \
/* trace_fn( l, "assert passed:", l._statement, "[", x, #op, y, "]" ); */
\
template
<
typename
Op
,
typename
A
,
typename
B
,
typename
...
T
>
void
assert_bin_fn
(
const
trace_location
&
l
,
Op
op
,
std
::
string_view
inv
,
const
A
&
a
,
const
B
&
b
,
const
T
&
...
args
)
{
bool
pass
;
if
constexpr
(
std
::
is_integral_v
<
A
>
&&
std
::
is_integral_v
<
B
>
)
pass
=
op
(
static_cast
<
std
::
common_type_t
<
A
,
B
>
>
(
a
),
static_cast
<
std
::
common_type_t
<
A
,
B
>
>
(
b
)
);
else
pass
=
!!
op
(
a
,
b
);
if
(
!
pass
)
{
assert_failed
f
(
l
);
f
<<
"
\n
but got "
<<
a
<<
" "
<<
inv
<<
" "
<<
b
<<
"
\n
"
;
format_args
(
f
,
args
...
);
assert_signal
(
f
);
}
/* trace_fn( l, "assert passed:", l._statement, "[", x, op_str, y, "]" ); */
}
ASSERT_FN
(
eq
,
==
,
!=
);
ASSERT_FN
(
leq
,
<=
,
>
);
ASSERT_FN
(
lt
,
<
,
>=
);
ASSERT_FN
(
neq
,
!=
,
==
);
template
<
typename
X
>
__boring
void
assert_pred_fn
(
const
trace_location
&
l
,
X
x
,
bool
p
)
{
...
...
@@ -185,7 +190,7 @@ namespace brq
{
assert_failed
f
(
l
);
f
<<
"
\n
but got x = "
<<
x
<<
"
\n
"
;
throw
f
;
assert_signal
(
f
)
;
}
}
}
...
...
bricks/brick-benchmark
View file @
192f10e2
...
...
@@ -188,7 +188,7 @@ struct BenchmarkBase : unittest::TestBase
virtual
std
::
string
group
()
{
return
""
;
}
int64_t
p
,
q
;
BenchmarkBase
(
std
::
string
n
)
:
TestBase
(
n
)
{}
BenchmarkBase
(
std
::
string
n
)
:
TestBase
(
n
,
""
)
{}
};
struct
Group
...
...
bricks/brick-bitlevel
View file @
192f10e2
...
...
@@ -251,7 +251,7 @@ namespace brick::bitlevel
template
<
typename
number
>
static
inline
number
fill
(
number
x
)
{
static
const
unsigned
m
=
sizeof
(
number
)
*
8
;
const
unsigned
m
=
sizeof
(
number
)
*
8
;
unsigned
r
=
1
;
if
(
!
x
)
return
0
;
...
...
@@ -276,20 +276,23 @@ namespace brick::bitlevel
}
template
<
>
inline
unsigned
MSB
<
unsigned
int
>
(
unsigned
int
x
)
{
static
const
unsigned
long
bits
=
sizeof
(
unsigned
int
)
*
8
-
1
;
inline
unsigned
MSB
<
unsigned
int
>
(
unsigned
int
x
)
{
const
unsigned
long
bits
=
sizeof
(
unsigned
int
)
*
8
-
1
;
return
bits
-
__builtin_clz
(
x
);
}
template
<
>
inline
unsigned
MSB
<
unsigned
long
>
(
unsigned
long
x
)
{
static
const
unsigned
bits
=
sizeof
(
unsigned
long
)
*
8
-
1
;
inline
unsigned
MSB
<
unsigned
long
>
(
unsigned
long
x
)
{
const
unsigned
bits
=
sizeof
(
unsigned
long
)
*
8
-
1
;
return
bits
-
__builtin_clzl
(
x
);
}
template
<
>
inline
unsigned
MSB
<
unsigned
long
long
>
(
unsigned
long
long
x
)
{
static
const
unsigned
bits
=
sizeof
(
unsigned
long
long
)
*
8
-
1
;
inline
unsigned
MSB
<
unsigned
long
long
>
(
unsigned
long
long
x
)
{
const
unsigned
bits
=
sizeof
(
unsigned
long
long
)
*
8
-
1
;
return
bits
-
__builtin_clzll
(
x
);
}
...
...
@@ -420,7 +423,7 @@ namespace brick::bitlevel
template
<
typename
T
,
int
width
=
sizeof
(
T
)
*
8
>
struct
BitField
{
static
const
int
bitwidth
=
width
;
static
const
expr
int
bitwidth
=
width
;
struct
Virtual
:
BitPointer
{
T
set
(
T
t
)
{
bitcopy
(
BitPointer
(
&
t
),
*
this
,
bitwidth
);
return
t
;
}
...
...
@@ -501,7 +504,7 @@ namespace brick::bitlevel
struct
BitLock
{
static
const
int
bitwidth
=
1
;
static
const
expr
int
bitwidth
=
1
;
struct
Virtual
:
BitPointer
{
using
Atomic
=
std
::
atomic
<
uint32_t
>
;
Atomic
&
atomic
()
{
return
*
reinterpret_cast
<
Atomic
*
>
(
&
word
()
);
}
...
...
@@ -526,8 +529,8 @@ namespace brick::bitlevel
template
<
int
O
,
typename
T
,
typename
...
Args
>
struct
BitAccess
<
O
,
T
,
Args
...
>
{
static
const
int
offset
=
O
;
static
const
int
width
=
T
::
bitwidth
;
static
const
expr
int
offset
=
O
;
static
const
expr
int
width
=
T
::
bitwidth
;
typedef
typename
T
::
Virtual
Head
;
typedef
BitAccess
<
offset
+
T
::
bitwidth
,
Args
...
>
Tail
;
static
const
int
total
=
width
+
Tail
::
total
;
...
...
@@ -543,7 +546,7 @@ namespace brick::bitlevel
struct
_BitTuple
{
using
Access
=
BitAccess
<
0
,
Args
...
>
;
static
const
int
bitwidth
=
Access
::
total
;
static
const
expr
int
bitwidth
=
Access
::
total
;
template
<
int
I
>
using
AccessAt
=
_AccessAt
<
Access
,
I
>
;
template
<
int
I
>
static
int
offset
()
{
return
AccessAt
<
I
>::
T
::
offset
;
}
};
...
...
bricks/brick-cmd
View file @
192f10e2
...
...
@@ -111,7 +111,7 @@ struct Validator< Parse, Ps... >: ValidatorInterface
{
if
(
_name
!=
t
)
return
_next
->
parse
(
edit
,
t
,
v
);
auto
fail
=
[](
auto
,
std
::
string
s
)
{
throw
except
::
Error
(
"parsing command line: "
+
s
)
;
};
auto
fail
=
[](
auto
,
std
::
string
s
)
{
brq
::
raise
()
<<
"parsing command line: "
<<
s
;
};
return
_parse
(
v
,
Push
<
T
>
(
edit
),
fail
);
}
...
...
@@ -344,7 +344,7 @@ struct Pattern : brq::refcount_base<>
for
(
int
i
=
0
;
i
<
int
(
res
.
size
()
);
++
i
)
if
(
res
[
i
]
==
next
)
alts
+=
"
\n
matched "
+
_subs
[
i
]
->
fmt
();
throw
except
::
Error
(
"Ambiguous parse:"
+
line
+
alts
)
;
brq
::
raise
()
<<
"ambiguous parse:"
<<
line
<<
alts
;
}
}
...
...
@@ -427,14 +427,14 @@ struct Pattern : brq::refcount_base<>
if
(
!
rest
.
empty
()
)
{
auto
n
=
new
Pattern
(
_validator
);
auto
n
=
brq
::
make_refcount
<
Pattern
>
(
_validator
);
if
(
n
->
create
(
rest
,
alt
?
this
:
prev_alt
)
)
_next
.
reset
(
n
)
;
_next
=
n
;
if
(
prev_alt
==
this
&&
_alt
)
{
ASSERT
(
_type
!=
Empty
);
Ptr
a
(
new
Pattern
(
*
this
)
);
auto
a
=
brq
::
make_refcount
<
Pattern
>
(
*
this
);
*
this
=
Pattern
(
_validator
);
_type
=
Group
;
while
(
a
)
...
...
@@ -664,7 +664,7 @@ struct OptionSet
return
;
if
(
parsed
.
count
(
&
o
)
&&
(
o
.
flags
()
&
OptionFlag
::
Unique
)
)
throw
except
::
Error
(
"Option "
+
o
.
fmt
()
+
" given more than once
\n
"
)
;
brq
::
raise
()
<<
"option"
<<
o
.
fmt
()
<<
"given more than once"
;
parsed
.
insert
(
&
o
);
b
=
o
.
parse
(
validator
,
t
,
b
,
e
);
...
...
@@ -679,7 +679,7 @@ struct OptionSet
{
alternatives
<<
"Ambiguous option "
<<
*
b
<<
":"
;
each_opt
(
format
);
throw
except
::
Error
(
alternatives
.
buffer
()
);
brq
::
raise
()
<<
alternatives
.
buffer
(
);
}
if
(
selected
.
empty
()
)
...
...
@@ -691,8 +691,7 @@ struct OptionSet
auto
check_required
=
[
&
](
auto
&
o
)
{
if
(
(
o
.
flags
()
&
OptionFlag
::
Required
)
&&
!
parsed
.
count
(
&
o
)
)
throw
except
::
Error
(
"Missing option: "
+
o
.
fmt
()
+
", expected:
\n
"
+
this
->
describe
()
);
brq
::
raise
()
<<
"missing option: "
<<
o
.
fmt
()
<<
", expected:
\n
"
<<
this
->
describe
();
};
each_opt
(
check_required
);
...
...
@@ -839,7 +838,7 @@ struct Parser : ParserBase
{
brq
::
refcount_ptr
<
Validator
>
_validator
;
Cmds
_cmds
;
using
Result
=
typename
Cmds
::
template
map
<
GetT
>
::
co
;
using
Result
=
typename
Cmds
::
template
map
_t
<
GetT
>
::
co
;
std
::
pair
<
Result
,
Tokens
::
iterator
>
do_parse
(
Tokens
::
iterator
b
,
Tokens
::
iterator
e
)
{
...
...
@@ -881,7 +880,7 @@ struct Parser : ParserBase
}
else
_cmds
.
each
(
[
&
](
auto
&
cmd
)
{
if
(
cmd
.
name
()
==
name
)
s
<<
cmd
.
describe
();
}
);
return
s
.
buffer
();
return
s
.
buffer
()
?
s
.
buffer
()
:
""
;
}
auto
parse
(
Tokens
::
iterator
b
,
Tokens
::
iterator
e
,
std
::
vector
<
std
::
string
>
&
unexpected
)
...
...
@@ -919,7 +918,7 @@ struct Parser : ParserBase
for
(
std
::
string
str
:
unexpected
)
err
<<
"'"
<<
str
<<
"' "
;
}
throw
except
::
Error
(
err
.
buffer
()
);
brq
::
raise
()
<<
err
.
buffer
(
);
}
return
_result
;
}
...
...
@@ -960,9 +959,30 @@ auto make_parser( brq::refcount_ptr< V > v )
return
Parser
<
V
,
brq
::
nil
>
(
v
,
brq
::
nil
()
);
}
struct
Help
{
std
::
string
_cmd
;
template
<
typename
P
>
void
run
(
std
::
string_view
argv_0
,
P
cmds
)
{
std
::
string
description
=
cmds
.
describe
(
_cmd
);
if
(
description
.
empty
()
&&
!
_cmd
.
empty
()
)
brq
::
raise
()
<<
"Unknown command '"
<<
_cmd
<<
"'. Available commands are:
\n
"
<<
cmds
.
describe
();
if
(
_cmd
.
empty
()
)
{
std
::
cerr
<<
"To print details about a specific command, run '"
<<
argv_0
<<
" help {command}'.
\n\n
"
;
std
::
cerr
<<
cmds
.
describe
()
<<
std
::
endl
;
}
else
std
::
cerr
<<
description
<<
std
::
endl
;
}
};
namespace
{
std
::
vector
<
std
::
string
>
from_argv
(
int
argc
,
const
char
**
argv
)
std
::
vector
<
std
::
string
>
from_argv
(
int
argc
,
const
char
*
const
*
argv
)
{
std
::
vector
<
std
::
string
>
args
;
std
::
copy
(
argv
+
1
,
argv
+
argc
,
std
::
back_inserter
(
args
)
);
...
...
bricks/brick-cons
View file @
192f10e2
...
...
@@ -28,17 +28,30 @@ namespace brq
struct
nil
{
using
co
=
nil
;
template
<
template
<
typename
>
class
f
>
using
map
=
nil
;
template
<
template
<
typename
>
class
f
>
using
map
_t
=
nil
;
template
<
typename
F
>
void
each
(
const
F
&
)
{}
void
each
(
const
F
&
)
const
{}
template
<
typename
...
Fs
>
auto
match
(
Fs
...
)
{
return
std
::
nullopt
;
}
template
<
template
<
typename
>
class
P
>
constexpr
nil
filter
()
const
{
return
{};
}
template
<
typename
F
>
nil
map
(
F
)
const
{
return
{};
}
template
<
typename
L
>
auto
cat
(
const
L
&
l
)
const
{
return
l
;
}
};
template
<
typename
,
typename
>
struct
cons
;
template
<
typename
,
typename
>
struct
ns
;
template
<
typename
A
,
typename
B
>
auto
make_cons
(
const
A
&
a
,
const
B
&
b
)
{
return
cons
<
A
,
B
>
(
a
,
b
);
}
template
<
typename
A
,
typename
B
>
struct
cons
{
...
...
@@ -46,7 +59,7 @@ namespace brq
using
cdr_t
=
B
;
using
co
=
ns
<
car_t
,
typename
cdr_t
::
co
>
;
template
<
template
<
typename
>
class
f
>
using
map
=
cons
<
f
<
car_t
>
,
typename
cdr_t
::
template
map
<
f
>
>
;
using
map
_t
=
cons
<
f
<
car_t
>
,
typename
cdr_t
::
template
map_t
<
f
>
>
;
car_t
car
;
cdr_t
cdr
;
...
...
@@ -58,13 +71,64 @@ namespace brq
cdr
.
each
(
f
);
}
template
<
typename
F
>
void
each
(
const
F
&
f
)
const
{
f
(
car
);
cdr
.
each
(
f
);
}
cons
(
const
car_t
&
car
,
const
cdr_t
&
cdr
)
:
car
(
car
),
cdr
(
cdr
)
{}
constexpr
auto
reverse
()
const
{
nil
rev
;
return
cons_reverse
(
*
this
,
rev
);
}
template
<
template
<
typename
>
class
P
>
constexpr
auto
filter
()
const
{
if
constexpr
(
P
<
car_t
>::
value
)
return
make_cons
(
car
,
cdr
.
template
filter
<
P
>()
);
else
return
cdr
.
template
filter
<
P
>();
}
template
<
typename
F
>
auto
map
(
F
f
)
{
auto
car_
=
f
(
car
);
auto
cdr_
=
cdr
.
map
(
f
);
return
make_cons
(
car_
,
cdr_
);
}
template
<
typename
L
>
auto
cat
(
const
L
&
l
)
{
return
make_cons
(
car
,
cdr
.
cat
(
l
)
);
}
template
<
typename
arg_t
,
typename
...
args_t
>
cons
(
const
arg_t
&
arg
,
const
args_t
&
...
args
)
:
car
(
arg
),
cdr
(
args
...
)
{}
cons
()
=
default
;
};
template
<
typename
D
>
constexpr
auto
cons_reverse
(
nil
,
const
D
&
rev
)
{
return
rev
;
}
template
<
typename
C
,
typename
D
>
constexpr
auto
cons_reverse
(
const
C
&
cell
,
const
D
&
rev
)
{
return
cons_reverse
(
cell
.
cdr
,
cons
(
cell
.
car
,
rev
)
);
}
static
auto
cons_list
()
{
return
nil
();
}
template
<
typename
T
,
typename
...
Ts
>
...
...
@@ -74,6 +138,15 @@ namespace brq
return
cons
<
T
,
decltype
(
tail
)
>
(
t
,
tail
);
}
template
<
typename
...
Ts
>
using
cons_list_t_
=
decltype
(
cons_list
(
std
::
declval
<
Ts
>
()...
)
);
template
<
typename
...
Ts
>
struct
cons_list_t
:
cons_list_t_
<
Ts
...
>
{
using
cons_list_t_
<
Ts
...
>::
cons_list_t_
;
};
template
<
typename
car_t_
,
typename
cdr_t_
>
struct
ns
{
...
...
bricks/brick-data
View file @
192f10e2
...
...
@@ -785,128 +785,8 @@ struct InsertSort
}
};
template
<
typename
Key
,
typename
Val
,
template
<
typename
T
>
class
Sort_
=
StdSort
,
typename
Container
=
std
::
vector
<
std
::
pair
<
Key
,
Val
>
>
>
class
ArrayMap
:
brick
::
types
::
Ord
{
public:
using
key_type
=
Key
;
using
mapped_type
=
Val
;
using
value_type
=
std
::
pair
<
Key
,
Val
>
;
using
Sort
=
Sort_
<
value_type
>
;
using
size_type
=
typename
Container
::
size_type
;
using
iterator
=
typename
Container
::
iterator
;
using
const_iterator
=
typename
Container
::
const_iterator
;
using
reference
=
value_type
&
;
using
const_reference
=
const
value_type
&
;
auto
begin
()
{
return
_container
.
begin
();
}
auto
begin
()
const
{
return
_container
.
cbegin
();
}
auto
cbegin
()
const
{
return
_container
.
cbegin
();
}
auto
end
()
{
return
_container
.
end
();
}
auto
end
()
const
{
return
_container
.
cend
();
}
auto
cend
()
const
{
return
_container
.
cend
();
}
auto
empty
()
const
{
return
_container
.
empty
();
}
auto
size
()
const
{
return
_container
.
size
();
}
void
clear
()
noexcept
{
_container
.
clear
();
}
std
::
pair
<
iterator
,
bool
>
insert
(
const_reference
value
)
{
auto
it
=
find
(
value
.
first
);
if
(
it
!=
cend
()
)
return
{
it
,
false
};
_container
.
push_back
(
value
);
Sort
::
sort
(
begin
(),
end
()
);
return
{
find
(
value
.
first
),
true
};
}
template
<
class
...
Args
>
std
::
pair
<
iterator
,
bool
>
emplace
(
Args
&&
...
args
)
{
_container
.
emplace_back
(
std
::
forward
<
Args
>
(
args
)...
);
auto
it
=
Sort
::
lower_bound
(
begin
(),
end
()
-
1
,
_container
.
back
()
);
if
(
it
==
end
()
-
1
||
it
->
first
!=
_container
.
back
().
first
)
{
auto
key
=
_container
.
back
().
first
;
Sort
::
sort
(
begin
(),
end
()
);
return
{
find
(
key
),
true
};
}
auto
key
=
it
->
first
;
_container
.
pop_back
();
return
{
find
(
key
),
false
};
}
void
erase
(
iterator
pos
)
{
using
std
::
swap
;
swap
(
*
pos
,
_container
.
back
()
);
_container
.
pop_back
();
Sort
::
sort
(
begin
(),
end
()
);
}
size_type
erase
(
const
key_type
&
key
)
{
auto
it
=
find
(
key
);
if
(
it
==
end
()
)
return
0
;
erase
(
it
);
return
1
;
}
void
swap
(
ArrayMap
&
other
)
{
using
std
::
swap
;
swap
(
_container
,
other
.
_container
);
}
size_type
count
(
const
Key
&
key
)
const
{
return
find
(
key
)
==
cend
()
?
0
:
1
;
}
iterator
find
(
const
Key
&
key
)
{
auto
elem
=
Sort
::
lower_bound
(
begin
(),
end
(),
std
::
make_pair
(
key
,
Val
()
)
);
return
elem
!=
end
()
&&
elem
->
first
==
key
?
elem
:
end
();
}
const_iterator
find
(
const
Key
&
key
)
const
{
auto
elem
=
Sort
::
lower_bound
(
cbegin
(),
cend
(),
std
::
make_pair
(
key
,
Val
()
)
);
return
elem
!=
cend
()
&&
elem
->
first
==
key
?
elem
:
cend
();
}
Val
&
operator
[](
const
Key
&
key
)
{
auto
it
=
find
(
key
);
if
(
it
!=
end
()
)
return
it
->
second
;
return
emplace
(
key
,
Val
{}
).
first
->
second
;
}
Val
&
at
(
const
Key
&
key
)
{
auto
it
=
find
(
key
);
if
(
it
==
end
()
)
throw
std
::
out_of_range
(
"ArrayMap::at"
);
return
it
->
second
;
}
const
Val
&
at
(
const
Key
&
key
)
const
{
auto
it
=
find
(
key
);
if
(
it
==
cend
()
)
throw
std
::
out_of_range
(
"ArrayMap::at"
);
return
it
->
second
;
}
bool
operator
<
(
const
ArrayMap
&
o
)
const
{
return
_container
<
o
.
_container
;
}
bool
operator
==
(
const
ArrayMap
&
o
)
const
{
return
_container
==
o
.
_container
;
}
private:
Container
_container
;
};
}
#ifdef BRICK_UNITTEST_REG
namespace
t_data
{
using
namespace
brick
::
data
;
...
...
@@ -1920,79 +1800,8 @@ struct TestSmallVector {
}
};
template
<
template
<
typename
T
>
class
Sort
>
struct
TestArrayMap
{
TEST
(
simple
)
{
ArrayMap
<
std
::
string
,
std
::
string
,
Sort
>
x
;
ASSERT
(
x
.
insert
(
std
::
make_pair
(
"bKey"
,
"bVal"
)
).
second
);
ASSERT
(
!
x
.
insert
(
std
::
make_pair
(
"bKey"
,
"bVal"
)
).
second
);
ASSERT_EQ
(
x
.
size
(),
1
);
ASSERT_EQ
(
x
.
find
(
"bKey"
)
->
second
,
"bVal"
);
ASSERT
(
x
.
emplace
(
"aKey"
,
"aVal"
).
second
);
ASSERT
(
!
x
.
emplace
(
"aKey"
,
"aVal"
).
second
);
ASSERT_EQ
(
x
.
size
(),
2
);
ASSERT_EQ
(
x
.
find
(
"aKey"
)
->
second
,
"aVal"
);
ASSERT_EQ
(
x
.
find
(
"bKey"
)
->
second
,
"bVal"
);
x
[
"cKey"
]
=
"cVal"
;
ASSERT_EQ
(
x
.
size
(),
3
);
ASSERT_EQ
(
x
.
find
(
"aKey"
)
->
second
,
"aVal"
);
ASSERT_EQ
(
x
.
find
(
"bKey"
)
->
second
,
"bVal"
);
ASSERT_EQ
(
x
.
find
(
"cKey"
)
->
second
,
"cVal"
);
x
.
erase
(
"bKey"
);
ASSERT_EQ
(
x
.
find
(
"aKey"
)
->
second
,
"aVal"
);
ASSERT_EQ
(
x
.
find
(
"cKey"
)
->
second
,
"cVal"
);
ASSERT_EQ
(
x
.
at
(
"aKey"
),
"aVal"
);
ASSERT_EQ
(
x
.
at
(
"cKey"
),
"cVal"
);
}
TEST
(
outOfRange
)
{
ArrayMap
<
int
,
std
::
string
,
Sort
>
am
;
am
[
1
]
=
"aKey"
;
try
{
am
.
at
(
2
);
ASSERT
(
false
);
}
catch
(
std
::
out_of_range
&
)
{
}
}
TEST
(
comparison
)
{
ArrayMap
<
int
,
int
,
Sort
>
m
;
m
.
emplace
(
1
,
1
);
m
.
emplace
(
2
,
1
);
auto
m2
=
m
;
ASSERT
(
m
==
m2
);
ASSERT
(
!
(
m
!=
m2
)
);
ASSERT
(
m
<=
m2
);
ASSERT
(
m2
<=
m
);
ASSERT
(
!
(
m
<
m2
)
);
ASSERT
(
!
(
m2
<
m
)
);
m2
.
emplace
(
3
,
1
);
ASSERT
(
m
!=
m2
);
ASSERT
(
m
<=
m2
);
ASSERT
(
m
<
m2
);
m2
.
erase
(
m2
.
find
(
3
)
);
m2
[
2
]
=
2
;
ASSERT
(
m
!=
m2
);
ASSERT
(
m
<=
m2
);
ASSERT
(
m
<
m2
);
}