Commit Graph

1500 Commits

Author SHA1 Message Date
Jeroen Ketema
73194a5e86 C++: Fix QL-for-QL warnings and missing QLDoc 2026-02-16 17:40:18 +01:00
Jeroen Ketema
26a1f4888a C++: Modernize MustFlow using parameterized modules 2026-02-16 17:27:41 +01:00
Mathias Vorreiter Pedersen
9596b7b921 C++: No need to compute this TC. 2026-02-11 20:18:03 +00:00
Mathias Vorreiter Pedersen
d57a42a7f7 C++: Make 'getChildCount' more robust by counting indexes instead of 'TranslatedDeclarationEntry's. 2026-02-05 20:23:45 +00:00
Mathias Vorreiter Pedersen
1b1c9c680c Merge pull request #21227 from MathiasVP/postfix-fix
C++: Get rid of an ugly workaround in dataflow
2026-01-29 12:25:02 +00:00
Mathias Vorreiter Pedersen
61a53fadc0 C++: Fix spelling. 2026-01-29 11:50:44 +00:00
Mathias Vorreiter Pedersen
4503c625b4 C++: Implement copilot suggestions. 2026-01-27 19:02:28 +00:00
Mathias Vorreiter Pedersen
445cca1432 C++: Proper SSA support for post-crement reads. 2026-01-27 18:29:12 +00:00
Mathias Vorreiter Pedersen
db3f22a2e8 C++: Another small refactor. 2026-01-27 12:46:52 +00:00
Mathias Vorreiter Pedersen
3d445be926 C++: Small refactor. 2026-01-27 12:46:48 +00:00
Mathias Vorreiter Pedersen
e0a7889b71 C++: Undo the hack. 2026-01-26 21:28:21 +00:00
Tom Hvitved
3b1e062985 C++: Adapt to changes in FlowSummaryImpl 2026-01-26 12:40:20 +01:00
Mathias Vorreiter Pedersen
a556152b9d C++: Fix asDefinition to not only work for SSA definitions. 2026-01-23 16:23:21 +00:00
Mathias Vorreiter Pedersen
60ee92d834 C++: Drive-by fix: Don't use the uncached ''getAPhiInputOrPriorDefinition' predicate. Instead, cache it and call it like we are supposed to. 2026-01-21 20:28:28 +00:00
Mathias Vorreiter Pedersen
d89967ce8e C++: Add ''isLiveAtEndOfBlock' predicate to 'Definition'. 2026-01-21 20:27:39 +00:00
Mathias Vorreiter Pedersen
e1089c8d89 Merge branch 'main' into ir-support-for-assertions 2026-01-21 13:56:30 +00:00
Mathias Vorreiter Pedersen
e4ec79255b C++: Fix bugs in variable resolution for assertions following review comments. 2026-01-21 13:50:27 +00:00
Mathias Vorreiter Pedersen
c30dffc7b9 C++: Add more tests. 2026-01-21 13:50:13 +00:00
Mathias Vorreiter Pedersen
b3631545d4 C++: Delete unnecessary conjuncts after review comments. 2026-01-19 11:57:45 +00:00
Mathias Vorreiter Pedersen
58a3260c96 Update cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedAssertion.qll
Co-authored-by: Jeroen Ketema <93738568+jketema@users.noreply.github.com>
2026-01-19 11:33:48 +00:00
Mathias Vorreiter Pedersen
07ac8a5d81 C++: Parameterize the BarrierGuard modules. This is useful for barrier guards with flow states and will be necessary in the next commit for adding MaD specified barriers. 2026-01-19 11:30:19 +00:00
Mathias Vorreiter Pedersen
f05bff01e4 C++: Switch another 'DataFlowType' to 'Type'. 2026-01-16 12:42:33 +00:00
Mathias Vorreiter Pedersen
5e9fd12d8c Update cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowUtil.qll
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-16 12:25:12 +00:00
Mathias Vorreiter Pedersen
03d6528687 Update cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedAssertion.qll
Co-authored-by: Jeroen Ketema <93738568+jketema@users.noreply.github.com>
2026-01-15 15:58:28 +00:00
Mathias Vorreiter Pedersen
1b117900c2 Update cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedStmt.qll
Co-authored-by: Jeroen Ketema <93738568+jketema@users.noreply.github.com>
2026-01-15 14:42:11 +00:00
Mathias Vorreiter Pedersen
d6ca1ca846 Update cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedStmt.qll
Co-authored-by: Jeroen Ketema <93738568+jketema@users.noreply.github.com>
2026-01-15 14:41:13 +00:00
Mathias Vorreiter Pedersen
28681508f3 C++: Fix bug and accept test changes. 2026-01-15 11:17:15 +00:00
Mathias Vorreiter Pedersen
27a437a514 C++: Modify test to reveal a bug. 2026-01-15 11:16:15 +00:00
Mathias Vorreiter Pedersen
4f4baee888 C++: Fix Code Scanning alerts. 2026-01-12 21:08:02 +00:00
Mathias Vorreiter Pedersen
aa058c2cca C++: Generate IR for assertions in release builds. 2026-01-12 21:07:55 +00:00
Mathias Vorreiter Pedersen
a18f3b6859 C++: Avoid generating IR for a few cases where we will be synthesizing assertions. 2026-01-12 21:06:09 +00:00
Jeroen Ketema
c567197f29 C++: Simplify expression 2026-01-06 21:58:43 +01:00
Jeroen Ketema
063e5d300e C++: Remove redundant SSA branch after IR fix 2026-01-06 17:40:52 +01:00
Jeroen Ketema
740518d23f C++: Use the loaded this instead of the this initialization 2026-01-06 17:11:22 +01:00
Anders Schack-Mulligen
09058e48aa Guards: Rename -WithState to Parameterized-. 2025-12-10 12:23:51 +01:00
Anders Schack-Mulligen
ebb989962c Guards: Generalise ValidationWrapper to support GuardValue-based BarrierGuards. 2025-12-10 12:23:51 +01:00
Mathias Vorreiter Pedersen
47ab307410 C++: Respond to review comments. 2025-11-25 12:06:58 +00:00
Mathias Vorreiter Pedersen
eb6b08591d Update cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowUtil.qll
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-11-24 15:01:09 +00:00
Mathias Vorreiter Pedersen
2e53370716 Update cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowUtil.qll
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-11-24 15:01:00 +00:00
Mathias Vorreiter Pedersen
ecb80cb4fc C++: Represent field content using a column that is shared by all template instantiations. 2025-11-24 12:29:49 +00:00
Mathias Vorreiter Pedersen
9bfe847fda C++: Fix awful joins on bochs:
```
Evaluated relational algebra for predicate DataFlowPrivate::storeStepImpl/4#b2c79f9a@13be12rc with tuple counts:
           9   ~0%    {3} r1 = JOIN `FlowSummaryImpl::Private::Steps::summaryStoreStep/3#5c2d4899` WITH DataFlowUtil::TFlowSummaryNode#40da8361 ON FIRST 1 OUTPUT Lhs.2, Lhs.1, Rhs.1
           9   ~0%    {4}    | JOIN WITH DataFlowUtil::TFlowSummaryNode#40da8361 ON FIRST 1 OUTPUT Lhs.2, Lhs.1, Rhs.1, _
           9  ~12%    {4}    | REWRITE WITH Out.3 := true

     1853420   ~0%    {3} r2 = SCAN `DataFlowPrivate::nodeHasInstruction/3#f469bb06` OUTPUT In.1, In.0, In.2
      100282   ~0%    {3}    | JOIN WITH `Instruction::StoreInstruction.getDestinationAddressOperand/0#dispred#596a4aba` ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2
      127910   ~0%    {6}    | JOIN WITH `DataFlowPrivate::numberOfLoadsFromOperand/4#7e555666_1023#join_rhs` ON FIRST 1 OUTPUT _, Lhs.1, Rhs.1, Rhs.3, Lhs.2, Rhs.2
      127910   ~0%    {4}    | REWRITE WITH Tmp.0 := 1, Out.0 := (Tmp.0 + In.4 + In.5) KEEPING 4
  4178182721   ~1%    {4}    | JOIN WITH `DataFlowUtil::FieldContent.getIndirectionIndex/0#dispred#cc69866f_10#join_rhs` ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2, Lhs.3
  4290552803   ~0%    {5}    | JOIN WITH `DataFlowUtil::FieldContent.getAField/0#dispred#ba1c91e5` ON FIRST 1 OUTPUT Lhs.2, Lhs.1, Lhs.3, Lhs.0, Rhs.1
  3033745816   ~5%    {7}    | JOIN WITH DataFlowUtil::PostFieldUpdateNode#b86f3a84_1023#join_rhs ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2, Lhs.3, Lhs.4, Rhs.2, Rhs.3
  3033745816   ~3%    {9}    | JOIN WITH DataFlowUtil::TPostUpdateNodeImpl#f5e76b7a_21#join_rhs ON FIRST 1 OUTPUT Lhs.1, Lhs.2, Lhs.3, Lhs.4, Lhs.0, Lhs.5, Lhs.6, Rhs.1, _
                      {8}    | REWRITE WITH Tmp.8 := 1, TEST InOut.7 = Tmp.8 KEEPING 8
  1516872908   ~0%    {7}    | SCAN OUTPUT In.4, In.5, In.6, In.0, In.1, In.2, In.3
  2409090286   ~1%    {6}    | JOIN WITH DataFlowUtil::PostFieldUpdateNode#b86f3a84_0231#join_rhs ON FIRST 3 OUTPUT Rhs.3, Lhs.6, Lhs.3, Lhs.4, Lhs.5, Lhs.0
       66016  ~45%    {4}    | JOIN WITH `DataFlowUtil::FieldAddress.getField/0#dispred#bdd01c1a` ON FIRST 2 OUTPUT Lhs.2, Lhs.4, Lhs.5, Lhs.3

       66025  ~45%    {4} r3 = r1 UNION r2
                      return r3
```
2025-11-19 10:08:09 +00:00
Mathias Vorreiter Pedersen
7f0fcb0c46 C++: Create a common base class for 'NonUnionContent' and 'UnionContent' called 'FieldContent'. 2025-11-18 18:53:37 +00:00
Mathias Vorreiter Pedersen
7527d88762 C++: Get rid of abstract'ness from these public predicates. We are not supposed to have abstract public stuff. Oops ... 2025-11-18 18:52:20 +00:00
Mathias Vorreiter Pedersen
2af6db6320 C++: Rename 'FieldContent' to 'NonUnionContent'. 2025-11-18 18:51:33 +00:00
Mathias Vorreiter Pedersen
e22d6656fe C++: Fix barrier guards. 2025-09-18 12:16:25 +01:00
Mathias Vorreiter Pedersen
9ed8b75c5d C++: Add a few helper predicates on 'Definition' which the guards library needs. 2025-09-18 11:05:55 +01:00
Mathias Vorreiter Pedersen
f0f4311b65 C++: Sync identical files. 2025-09-18 11:05:47 +01:00
Mathias Vorreiter Pedersen
70a8364a38 C++: Add another convenience predicate on 'BinaryInstruction'. 2025-09-18 11:05:45 +01:00
Mathias Vorreiter Pedersen
19b8e0db9c C++: Add a few subclasses to 'EdgeKind'. 2025-09-18 11:05:43 +01:00
Mathias Vorreiter Pedersen
be8195ab7d C++: Do not rely on dataflow nodes when implement 'getAUse' and 'getAnIndirectUse'. This will solve a non-monotonic recursion issue later. 2025-09-18 11:05:39 +01:00