4 Commits

Author SHA1 Message Date
Martin Braenne
9a4097e9cd [clang][dataflow] Use namespace qualifiers when defining functions.
See

https://llvm.org/docs/CodingStandards.html#use-namespace-qualifiers-to-implement-previously-declared-functions

Thank you to MaskRay for pointing this out on

https://reviews.llvm.org/D153006

Reviewed By: xazax.hun

Differential Revision: https://reviews.llvm.org/D153833
2023-06-27 08:56:21 +00:00
Fangrui Song
d54bd7aced [dataflow] Fix -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=off builds after D153006 2023-06-26 14:00:59 -07:00
Fangrui Song
5c8d24732b [dataflow] Fix -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=off builds after D153006 2023-06-26 12:48:20 -07:00
Martin Braenne
f2123af1e7 [clang][dataflow] Perform deep copies in copy and move operations.
This serves two purposes:

- Because, today, we only copy the `StructValue`, modifying the destination of
  the copy also modifies the source. This is demonstrated by the new checks
  added to `CopyConstructor` and `MoveConstructor`, which fail without the
  deep copy.

- It lays the groundwork for eliminating the redundancy between
  `AggregateStorageLocation` and `StructValue`, which will happen as part of the
  ongoing migration to strict handling of value categories (seeo
  https://discourse.llvm.org/t/70086 for details). This will involve turning
  `StructValue` into essentially just a wrapper for `AggregateStorageLocation`;
  under this scheme, the current "shallow" copy (copying a `StructValue` from
  one `AggregateStorageLocation` to another) will no longer be possible.

Because we now perform deep copies, tests need to perform a deep equality
comparison instead of just comparing for equal identity of the `StructValue`s.
The new function `recordsEqual()` provides such a deep equality comparison.

Reviewed By: xazax.hun

Differential Revision: https://reviews.llvm.org/D153006
2023-06-26 13:52:56 +00:00