@@ -49,7 +49,7 @@ import dmd.root.string;
4949import dmd.root.utf;
5050import dmd.target;
5151import dmd.tokens;
52- import dmd.typesem : pointerTo, toHeadMutable, castMod , size, mutableOf, unSharedOf;
52+ import dmd.typesem : toHeadMutable, size, mutableOf, unSharedOf;
5353import dmd.visitor;
5454
5555enum LOGSEMANTIC = false ;
@@ -527,20 +527,6 @@ extern (C++) abstract class Expression : ASTNode
527527 return false ;
528528 }
529529
530- /* *****************************
531- * Take address of expression.
532- */
533- final Expression addressOf ()
534- {
535- // printf("Expression::addressOf()\n");
536- debug
537- {
538- assert (op == EXP .error || isLvalue());
539- }
540- Expression e = new AddrExp(loc, this , type.pointerTo());
541- return e;
542- }
543-
544530 /* *****************************
545531 * If this is a reference, dereference it.
546532 */
@@ -2218,56 +2204,6 @@ extern (C++) final class StructLiteralExp : Expression
22182204 return exp;
22192205 }
22202206
2221- /* *************************************
2222- * Gets expression at offset of type.
2223- * Returns NULL if not found.
2224- */
2225- extern (D ) Expression getField(Type type, uint offset)
2226- {
2227- // printf("StructLiteralExp::getField(this = %s, type = %s, offset = %u)\n",
2228- // /*toChars()*/"", type.toChars(), offset);
2229- Expression e = null ;
2230- int i = getFieldIndex(type, offset);
2231-
2232- if (i != - 1 )
2233- {
2234- // printf("\ti = %d\n", i);
2235- if (i >= sd.nonHiddenFields())
2236- return null ;
2237-
2238- assert (i < elements.length);
2239- e = (* elements)[i];
2240- if (e)
2241- {
2242- // printf("e = %s, e.type = %s\n", e.toChars(), e.type.toChars());
2243-
2244- /* If type is a static array, and e is an initializer for that array,
2245- * then the field initializer should be an array literal of e.
2246- */
2247- auto tsa = type.isTypeSArray();
2248- if (tsa && e.type.castMod(0 ) != type.castMod(0 ))
2249- {
2250- const length = cast (size_t )tsa.dim.toInteger();
2251- auto z = new Expressions(length);
2252- foreach (ref q; * z)
2253- q = e.copy();
2254- e = new ArrayLiteralExp(loc, type, z);
2255- }
2256- else
2257- {
2258- e = e.copy();
2259- e.type = type;
2260- }
2261- if (useStaticInit && e.type.needsNested())
2262- if (auto se = e.isStructLiteralExp())
2263- {
2264- se.useStaticInit = true ;
2265- }
2266- }
2267- }
2268- return e;
2269- }
2270-
22712207 /* ***********************************
22722208 * Get index of field.
22732209 * Returns -1 if not found.
0 commit comments