Skip to content

Commit 2af6db6

Browse files
committed
C++: Rename 'FieldContent' to 'NonUnionContent'.
1 parent f4a6ba9 commit 2af6db6

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1574,7 +1574,7 @@ pragma[inline]
15741574
ContentApprox getContentApprox(Content c) {
15751575
exists(string prefix, Field f |
15761576
prefix = result.(FieldApproxContent).getPrefix() and
1577-
f = c.(FieldContent).getField() and
1577+
f = c.(NonUnionFieldContent).getField() and
15781578
fieldHasApproxName(f, prefix)
15791579
)
15801580
or

cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowUtil.qll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2093,8 +2093,8 @@ private Field getAFieldWithSize(Union u, int bytes) {
20932093

20942094
cached
20952095
private newtype TContent =
2096-
TFieldContent(Field f, int indirectionIndex) {
2097-
// the indirection index for field content starts at 1 (because `TFieldContent` is thought of as
2096+
TNonUnionContent(Field f, int indirectionIndex) {
2097+
// the indirection index for field content starts at 1 (because `TNonUnionContent` is thought of as
20982098
// the address of the field, `FieldAddress` in the IR).
20992099
indirectionIndex = [1 .. SsaImpl::getMaxIndirectionsForType(f.getUnspecifiedType())] and
21002100
// Reads and writes of union fields are tracked using `UnionContent`.
@@ -2163,11 +2163,11 @@ private module ContentStars {
21632163
private import ContentStars
21642164

21652165
/** A reference through a non-union instance field. */
2166-
class FieldContent extends Content, TFieldContent {
2166+
class NonUnionFieldContent extends Content, TNonUnionContent {
21672167
private Field f;
21682168
private int indirectionIndex;
21692169

2170-
FieldContent() { this = TFieldContent(f, indirectionIndex) }
2170+
NonUnionFieldContent() { this = TNonUnionContent(f, indirectionIndex) }
21712171

21722172
override string toString() { result = contentStars(this) + f.toString() }
21732173

cpp/ql/src/utils/modelgenerator/internal/CaptureModels.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ module ModelGeneratorCommonInput implements ModelGeneratorCommonInputSig<Cpp::Lo
190190
predicate isRelevantType(Type t) { any() }
191191

192192
Type getUnderlyingContentType(DataFlow::ContentSet c) {
193-
result = c.(DataFlow::FieldContent).getField().getUnspecifiedType() or
193+
result = c.(DataFlow::NonUnionFieldContent).getField().getUnspecifiedType() or
194194
result = c.(DataFlow::UnionContent).getUnion().getUnspecifiedType()
195195
}
196196

0 commit comments

Comments
 (0)