Mathias Vorreiter Pedersen
d6352b47a1
C++: Fix IR generation for builtin operations.
2024-06-06 09:52:20 +01:00
Mathias Vorreiter Pedersen
f58757ff9d
C++: Skip children we cannot translate when translating builtin operations.
2024-06-06 09:48:41 +01:00
Mathias Vorreiter Pedersen
a1cb419902
C++: Delete duplicated case in IR generation.
2024-05-15 08:52:56 +01:00
Jeroen Ketema
9e09c5a6cf
C++: Fix copy and paste error in comment
2024-05-08 22:11:19 +02:00
Jeroen Ketema
d68d2cca41
C++: Fix destructor translation for handlers
2024-05-08 19:26:56 +02:00
Jeroen Ketema
1a53b923a6
C++: Ensure destructors for ifs are called after both branches
2024-05-08 14:48:28 +02:00
Jeroen Ketema
52db1c1253
C++: Introduce abstract class to share code between if and constexpr if
2024-05-08 14:16:19 +02:00
Jeroen Ketema
fa06d88642
C++: Add forgotten getLastChild to TranslatedConstExprIfStmt
2024-05-08 14:07:29 +02:00
Mathias Vorreiter Pedersen
5d5e31378b
Merge pull request #16415 from MathiasVP/cleanup-ir-variables
2024-05-03 18:49:11 +01:00
Mathias Vorreiter Pedersen
d5475c4a89
C++: Delete predicate that I introduced by mistake.
2024-05-03 14:48:01 +01:00
Mathias Vorreiter Pedersen
7ca54a6f94
C++: Sync identical files.
2024-05-03 13:51:04 +01:00
Jeroen Ketema
ba64cf3016
C++: Correctly handle destructors at the end of range-based for-loops in the IR
2024-05-03 14:38:37 +02:00
Mathias Vorreiter Pedersen
a200ced2d6
C++: Fix IR generation for jump statements.
2024-04-30 15:46:46 +01:00
Mathias Vorreiter Pedersen
3c2206728d
Merge pull request #16333 from MathiasVP/fix-guards-on-pointers
2024-04-26 21:33:08 +01:00
Jeroen Ketema
8c87cb83bb
Merge pull request #16342 from jketema/destructors-cleanup
...
C++: Don't emit destructor calls as part of 'TranslatedResultCopy' as this has already been done in some other 'TranslatedExpr'.
2024-04-26 22:05:00 +02:00
Mathias Vorreiter Pedersen
e78091e9d0
C++: Sync identical files.
2024-04-26 16:19:02 +01:00
Mathias Vorreiter Pedersen
4b0a217420
C++: Don't emit destructor calls as part of 'TranslatedResultCopy' as this has already been done in some other 'TranslatedExpr'.
2024-04-26 16:25:05 +02:00
Mathias Vorreiter Pedersen
70e9c48a47
C++: Also implement the predicate in the raw stage.
2024-04-26 13:48:13 +01:00
Mathias Vorreiter Pedersen
dcc4ad2550
C++: Sync identical files.
2024-04-26 13:45:15 +01:00
Mathias Vorreiter Pedersen
c1755603a8
Update TranslatedExpr.qll
...
Co-authored-by: Jeroen Ketema <93738568+jketema@users.noreply.github.com >
2024-04-23 07:25:25 +01:00
Mathias Vorreiter Pedersen
8169e7ce68
C++: Add proper translation of 'co_await' and 'co_yield'.
2024-04-22 21:38:13 +01:00
Mathias Vorreiter Pedersen
ba99d49b61
Merge pull request #16187 from MathiasVP/cfg-for-coroutines
...
C++: Placeholder CFG for coroutines
2024-04-19 11:31:55 +01:00
Mathias Vorreiter Pedersen
846eac8be9
C++: Add a placeholder for 'getOpcode'.
2024-04-11 15:44:33 +01:00
Mathias Vorreiter Pedersen
65b69fe353
C++: Mark 'CoYieldExpr' as a unary expression in IR construction.
2024-04-11 15:34:29 +01:00
Mathias Vorreiter Pedersen
d030f0b5d2
C++: Add a placeholder for 'getOpcode'.
2024-04-11 15:27:38 +01:00
Mathias Vorreiter Pedersen
d8bd18f369
C++: IR translation of 'co_return' statements.
2024-04-11 14:28:15 +01:00
Mathias Vorreiter Pedersen
4c4d2415e9
C++: Mark 'CoAwaitExpr' as a unary expression in IR construction.
2024-04-11 13:30:33 +01:00
Mathias Vorreiter Pedersen
7172e2f445
Merge branch 'main' into destructors-for-unconditional-unnamed
2024-04-10 17:34:08 +01:00
Jeroen Ketema
46c44b4dc0
C++: Update QLDoc of IRDeclarationEntry to reflect current reality
2024-04-09 15:15:41 +02:00
Mathias Vorreiter Pedersen
c325a79206
C++: Ensure 'isConditionalTemporaryDestructorCall' only holds when the reused expression is a temporary.
2024-04-09 09:32:54 +01:00
Mathias Vorreiter Pedersen
17c8fa3e84
Update cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedElement.qll
...
Co-authored-by: Jeroen Ketema <93738568+jketema@users.noreply.github.com >
2024-04-09 09:27:44 +01:00
Mathias Vorreiter Pedersen
54e4103e71
C++: Fix another multiple parents problem.
2024-04-05 18:07:53 +01:00
Mathias Vorreiter Pedersen
f1d2dac648
C++: Fix a bug where the destructor attached to a 'new' expression would
...
have multiple parents (the 'new' expression, the call to 'operator new',
and the size expression). This happens because the latter two are
'TranslatedExpr's that return the 'new' expression as their expression
even though they don't technically represent the translation of this
expression.
To prevent this bug we tell the IR construction that the latter two
handle their destructors explicitly which means that IR construction
doesn't try to synthesize them.
2024-04-05 14:46:27 +01:00
Mathias Vorreiter Pedersen
d279e3f17a
C++: Suppress destructor calls for the right-hand side of logical operations since these are also conditional.
2024-04-05 09:47:11 +01:00
Mathias Vorreiter Pedersen
f098b8eb82
C++: Make sure the edge kind out of a throw is an 'ExceptionEdge' even if destructors are called.
2024-04-04 20:01:52 +01:00
Mathias Vorreiter Pedersen
180888616b
C++: Properly handle the case where a TranslatedElement has no children.
2024-04-04 16:02:01 +01:00
Mathias Vorreiter Pedersen
73602dca92
C++: Also suppress destructor calls on throwing ternary expressions.
2024-04-04 14:51:11 +01:00
Mathias Vorreiter Pedersen
796fcfec6c
C++: Handle conversions in 'isInConditionalEvaluation'.
2024-04-04 14:44:16 +01:00
Mathias Vorreiter Pedersen
a756f14e77
C++: Only report implicit destructors if we need to translate them.
2024-04-04 14:41:23 +01:00
Robert Marsh
17e8c95e7f
C++: suppress destructors on conditional temporaries
2024-04-04 11:28:10 +01:00
Robert Marsh
75c453fd30
C++: Unsuppress temporary destructors in IR
2024-04-04 10:29:59 +01:00
Jeroen Ketema
a5d4fad806
C++: Output destructor calls for delete expressions
2024-04-02 10:32:03 +02:00
Mathias Vorreiter Pedersen
7bb2b57394
Merge pull request #15964 from rdmarsh2/rdmarsh2/cpp/temp-destructors-extended
...
C++: IR translation for destruction of temporaries with extended lifetimes
2024-03-27 11:58:48 +00:00
Mathias Vorreiter Pedersen
458ee13345
C++: Add constant analysis for bitwise operations now that these are no longer constant folded by IR construction.
2024-03-19 16:23:57 +00:00
Robert Marsh
5a30ad162a
C++: Add a comment for ReusedExpr IR translation
2024-03-19 15:54:52 +00:00
Robert Marsh
3d4f7d880d
C++: unsuppress destructoion of temporaries with extended lifetimes
2024-03-19 15:54:42 +00:00
Robert Marsh
ba10ea8121
C++: ReuseExpr IR translation
2024-03-19 15:50:28 +00:00
Mathias Vorreiter Pedersen
a88d8b260d
C++: Only ignore constant folding for certain binary operations.
2024-03-19 13:17:49 +00:00
Mathias Vorreiter Pedersen
a97891cbc1
C++: Add QLDoc to 'getNumberOfBinaryOperands' (and rename it to 'getNumberOfNestedBinaryOperands').
2024-03-19 12:56:15 +00:00
Mathias Vorreiter Pedersen
4d3076ae7e
C++: Don't constant fold small binary operations.
2024-03-19 11:46:51 +00:00