Commit Graph

2980 Commits

Author SHA1 Message Date
Jeroen Ketema
880c785efe C++: Ensure we can round trip between (forward) class declarations
This was already possible when the forward class declaration and the class
definition occurred in the same scope. However, there is a common C++ usage
pattern in which this is not the case (when only a pointer to the class is
needed). In this latter scenario we could not round trip between the (forward)
`DeclarationEntry` and the `Declaration`.

Effectively this changes the code to:
```
if exists(TypeDeclarationEntry e | e.getType() = this)
then result.getType() = this
else ...
```
We use `type_decls` instead to stay close to the original code.
2022-06-22 07:58:45 +02:00
Jeroen Ketema
0f37e4e7b2 C++: Add variable in namespace test 2022-06-22 07:56:27 +02:00
Jeroen Ketema
a8833a0c70 C++: Test showing going from a forward class declaration to a class but not back 2022-06-22 07:53:50 +02:00
Jeroen Ketema
40e0356177 C++: Test that we can go from a DeclarationEntry to a Declaration and back 2022-06-22 07:53:50 +02:00
Jeroen Ketema
1f97f1d931 C++: Add global variable tests 2022-06-21 10:43:40 +02:00
Robert Marsh
d28c39cd73 C++: update test expectations 2022-06-20 15:56:00 -04:00
Robert Marsh
5a3e546bfe C++: update test expectations 2022-06-20 15:55:50 -04:00
Robert Marsh
33910a85b9 C++: restrict global variable IR generation 2022-06-20 15:51:44 -04:00
Robert Marsh
54488eb49b C++: fix global vars accesses in global vars 2022-06-20 15:46:49 -04:00
Robert Marsh
a3f1d61913 C++: test for global var access in a global var 2022-06-20 15:26:28 -04:00
Robert Marsh
048e5d8474 C++: IR data flow through global variables 2022-06-20 15:15:45 -04:00
Robert Marsh
c216176de1 C++: sync and accept new consistency test 2022-06-20 15:15:40 -04:00
Robert Marsh
f0634140b6 C++: fix inconsistencies from IR global vars 2022-06-20 14:41:10 -04:00
Jeroen Ketema
89d4f84731 C++: Update tests for frontend update 2022-06-20 14:41:09 -04:00
Robert Marsh
e0878d7d3c C++: Fix IR variable reuse for global var inits 2022-06-20 14:41:02 -04:00
Robert Marsh
767b0cfdfb Revert "Merge pull request #8933 from MathiasVP/revert-globals"
This reverts commit 2517371a37, reversing
changes made to db856798b9.
2022-06-20 14:26:10 -04:00
Mathias Vorreiter Pedersen
35c8ca15f5 Merge pull request #8912 from rdmarsh2/rdmarsh2/fix-ir-globals
C++: Fix IR variable reuse for global var inits
2022-06-20 16:45:39 +01:00
Anders Schack-Mulligen
bbb8d29442 C/C++: Deprecate BarrierGuard class. 2022-06-17 14:29:05 +02:00
Jeroen Ketema
a7d095e063 Revert "C++: Fix test failures where location of reference dereference in lambda changed"
This reverts commit 8e7066600a.
2022-06-15 11:58:31 +02:00
Robert Marsh
e7e517bd6f C++: Accept more updated test output 2022-06-14 15:54:50 -04:00
Robert Marsh
d508826b0f Merge branch 'main' into rdmarsh2/fix-ir-globals 2022-06-14 13:22:04 -04:00
Robert Marsh
07a0b4df84 C++: update test expaectations 2022-06-14 11:43:05 -04:00
Geoffrey White
2683d011c0 Update cpp/ql/test/library-tests/controlflow/dereferenced/dereferenced.cpp
Co-authored-by: Mathias Vorreiter Pedersen <mathiasvp@github.com>
2022-06-14 14:33:37 +01:00
Geoffrey White
512731a38d C++: Add test for Dereferenced.qll. 2022-06-14 13:53:28 +01:00
Robert Marsh
6d267be1a1 C++: merge main and accept test changes 2022-05-20 14:37:09 -04:00
Jeroen Ketema
941485d66f Merge pull request #9130 from jketema/cpp17-init
C++: Handle C++17 if and switch initializers
2022-05-12 16:37:44 +02:00
Jeroen Ketema
71c019e126 C++: Handle C++17 switch initializers 2022-05-12 12:56:50 +02:00
Jeroen Ketema
ebbd9c5b90 C++: Handle C++17 if initializers 2022-05-12 12:56:50 +02:00
Nick Rolfe
e1b277386a Fix non-US spellings: s/analyse/analyze 2022-05-11 17:48:27 +01:00
Robert Marsh
de68107a0e C++: restrict global variable IR generation 2022-05-03 16:50:53 -04:00
Robert Marsh
7993cba457 C++: fix global vars accesses in global vars 2022-05-02 12:27:10 -04:00
Robert Marsh
b5a2a2e8c2 C++: test for global var access in a global var 2022-05-02 12:07:01 -04:00
Robert Marsh
fe52dd93ef C++: sync and accept new consistency test 2022-04-29 15:29:07 -04:00
Robert Marsh
d1c6022efc C++: fix inconsistencies from IR global vars 2022-04-29 14:56:13 -04:00
Jeroen Ketema
5b80fd1432 C++: Update tests for frontend update 2022-04-29 11:46:01 -04:00
Robert Marsh
abdfd2297b C++: Fix IR variable reuse for global var inits 2022-04-29 11:46:00 -04:00
Robert Marsh
259580aeeb Revert "Merge pull request #8933 from MathiasVP/revert-globals"
This reverts commit 2517371a37, reversing
changes made to db856798b9.
2022-04-29 11:45:10 -04:00
Mathias Vorreiter Pedersen
75c1e56bbd Revert "Merge pull request #8515 from rdmarsh2/rdmarsh2/ir-global-vars"
This reverts commit 800e4ea7df, reversing
changes made to 7ce040f331.
2022-04-27 16:04:28 +01:00
Erik Krogh Kristensen
e1c7d369be Merge pull request #8796 from erik-krogh/redundantImport
Remove redundant imports
2022-04-27 12:39:51 +02:00
Mathias Vorreiter Pedersen
800e4ea7df Merge pull request #8515 from rdmarsh2/rdmarsh2/ir-global-vars
C++: generate IR for global variables with initializers
2022-04-26 18:17:13 +01:00
Erik Krogh Kristensen
d389012b75 Merge branch 'main' into redundantImport 2022-04-26 14:24:51 +02:00
Jeroen Ketema
73e4f0c044 C++: Set clang_version to the default from previous frontend version
This ensures that `__atomic_fetch_min` parses and that the number of
builtins does not changed compared to the previous version of the
frontend.
2022-04-25 21:15:28 +02:00
Jeroen Ketema
ccd545336c C++: Fix tests where float128 error message has changed 2022-04-25 21:14:20 +02:00
Jeroen Ketema
8e7066600a C++: Fix test failures where location of reference dereference in lambda changed 2022-04-25 21:14:17 +02:00
Jeroen Ketema
6c1e21cd91 C++: Fix test where variable access position is more accurate in frontend 2022-04-25 21:14:06 +02:00
Jeroen Ketema
5b0603a5b9 C++: Artificial block insertion for loops and switches has changed in frontend
There are now more artificial blocks containing more than one instruction
(artificial blocks containing a single instruction have the extractor only
emit that instruction and not the block). The second instruction in each case
is the label for breaking out of a loop or switch.
2022-04-25 21:13:52 +02:00
Jeroen Ketema
d43ae9b7ed C++: More artificially inserted blocks carry location information in frontend 2022-04-25 21:13:29 +02:00
Jeroen Ketema
b9e7045a2f C++: Update vector type test to reflect it uses old-clang features
These features are no longer available and the frontend does stricter checking
on this.
2022-04-25 21:13:04 +02:00
Robert Marsh
d0fc348ad9 C++: autoformat 2022-04-25 14:17:49 -04:00
Erik Krogh Kristensen
ff73dbc35c delete redundant imports 2022-04-22 12:55:28 +02:00