Skip to content

Commit ce13f42

Browse files
Renamed StructNamedEntityStore
1 parent ba7faa1 commit ce13f42

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

app/src/main/java/de/tudarmstadt/esa/treenail/codegen/ExpressionSwitch.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -118,20 +118,19 @@ MLIRValue emitStore(ConstructionContext cc, MLIRValue toStore) {
118118
}
119119
}
120120

121-
// TODO: this is not really a struct, but just a plain NamedEntity store
122-
private static final class StructNamedEntityStore extends StoreOperation {
121+
private static final class DirectNamedEntityStore extends StoreOperation {
123122
NamedEntity destEntity;
124-
MLIRType structType;
123+
MLIRType type;
125124

126-
StructNamedEntityStore(NamedEntity destEntity, MLIRType structType) {
125+
DirectNamedEntityStore(NamedEntity destEntity, MLIRType type) {
127126
this.destEntity = destEntity;
128-
this.structType = structType;
127+
this.type = type;
129128
}
130129

131130
MLIRValue emitStore(ConstructionContext cc, MLIRValue value) {
132131
if (!cc.hasValue(destEntity)) {
133132
cc.emitLn("coredsl.set @%s = %s : %s", destEntity.getName(), value,
134-
structType);
133+
type);
135134
} else {
136135
cc.setValue(destEntity, value);
137136
}
@@ -187,7 +186,7 @@ private MLIRValue resolveStoreStack(MLIRType storedValueType) {
187186

188187
assert storeStack.firstElement() instanceof ArrayNamedEntityStore ||
189188
storeStack.firstElement() instanceof BitFieldNamedEntityStore ||
190-
storeStack.firstElement() instanceof StructNamedEntityStore
189+
storeStack.firstElement() instanceof DirectNamedEntityStore
191190
: "Last emitted store must store to a NamedEntity";
192191
assert !storeStack.empty();
193192
while (!storeStack.isEmpty()) {
@@ -329,7 +328,7 @@ public MLIRValue caseIndexAccessExpression(IndexAccessExpression access) {
329328
entityVal, memberName, entityVal.type);
330329
}
331330
assert entityVal != null;
332-
storeStack.push(new StructNamedEntityStore(targetEntity, structType));
331+
storeStack.push(new DirectNamedEntityStore(targetEntity, structType));
333332
storeStack.push(new StructMemberStore(entityVal, memberName));
334333
} else {
335334
isNestedLvalue = true;

0 commit comments

Comments
 (0)