diff options
author | Martin Braenne <mboehme@google.com> | 2023-08-01 13:23:37 +0000 |
---|---|---|
committer | Martin Braenne <mboehme@google.com> | 2023-08-01 20:29:40 +0000 |
commit | 9ecdbe3855a8048989a507ff8d470aee4d407589 (patch) | |
tree | c100e2306d4fabc9be9ec920ff3e0c3378d02cf9 /clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp | |
parent | f39c399d9d15efe8309d8aa3d0ecf62205e6c474 (diff) | |
download | llvm-9ecdbe3855a8048989a507ff8d470aee4d407589.zip llvm-9ecdbe3855a8048989a507ff8d470aee4d407589.tar.gz llvm-9ecdbe3855a8048989a507ff8d470aee4d407589.tar.bz2 |
[clang][dataflow] Rename `AggregateStorageLocation` to `RecordStorageLocation` and `StructValue` to `RecordValue`.
- Both of these constructs are used to represent structs, classes, and unions;
Clang uses the collective term "record" for these.
- The term "aggregate" in `AggregateStorageLocation` implies that, at some
point, the intention may have been to use it also for arrays, but it don't
think it's possible to use it for arrays. Records and arrays are very
different and therefore need to be modeled differently. Records have a fixed
set of named fields, which can have different type; arrays have a variable
number of elements, but they all have the same type.
- Futhermore, "aggregate" has a very specific meaning in C++
(https://en.cppreference.com/w/cpp/language/aggregate_initialization).
Aggregates of class type may not have any user-declared or inherited
constructors, no private or protected non-static data members, no virtual
member functions, and so on, but we use `AggregateStorageLocations` to model all objects of class type.
In addition, for consistency, we also rename the following:
- `getAggregateLoc()` (in `RecordValue`, formerly known as `StructValue`) to
simply `getLoc()`.
- `refreshStructValue()` to `refreshRecordValue()`
We keep the old names around as deprecated synonyms to enable clients to be migrated to the new names.
Reviewed By: ymandel, xazax.hun
Differential Revision: https://reviews.llvm.org/D156788
Diffstat (limited to 'clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp')
-rw-r--r-- | clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp b/clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp index 9f72dc8..0a6d779 100644 --- a/clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp +++ b/clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp @@ -67,7 +67,7 @@ StorageLocation &DataflowAnalysisContext::createStorageLocation(QualType Type) { else FieldLocs.insert({Field, &createStorageLocation( Field->getType().getNonReferenceType())}); - return arena().create<AggregateStorageLocation>(Type, std::move(FieldLocs)); + return arena().create<RecordStorageLocation>(Type, std::move(FieldLocs)); } return arena().create<ScalarStorageLocation>(Type); } |