This is an archive of the discontinued LLVM Phabricator instance.

[clang][dataflow] Rename `AggregateStorageLocation` to `RecordStorageLocation` and `StructValue` to `RecordValue`.
ClosedPublic

Authored by mboehme on Aug 1 2023, 6:23 AM.

Details

Summary
  • 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.

Diff Detail

Event Timeline

mboehme created this revision.Aug 1 2023, 6:23 AM
Herald added a project: Restricted Project. · View Herald Transcript
mboehme requested review of this revision.Aug 1 2023, 6:23 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 1 2023, 6:23 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
mboehme edited the summary of this revision. (Show Details)Aug 1 2023, 6:24 AM
mboehme added reviewers: ymandel, xazax.hun.
xazax.hun accepted this revision.Aug 1 2023, 10:37 AM
This revision is now accepted and ready to land.Aug 1 2023, 10:37 AM
ymandel accepted this revision.Aug 1 2023, 10:42 AM