private MidExp SimplifyExpImpl(MidAttributeRef val, SimplifyEnv env) { if (val.IsLazy) { return(_exps.AttributeRef(val.Range, val.Decl)); } return(val); }
public MidAttributeRef CleanupExp(MidAttributeRef exp) { var oldAttr = exp.Decl; var newAttr = MapOldToNew(oldAttr); if (newAttr == oldAttr) { return(exp); } newAttr.TrySetName(oldAttr.Name, oldAttr.Range); return(_exps.AttributeRef(exp.Range, newAttr)); }
private MidVal EmitValToElementImpl( IResExp resExp, MidElementDecl element, MidEmitEnv parentEnv) { var midExp = EmitLocalExp(resExp, parentEnv, element); if (midExp is MidVal) { return((MidVal)midExp); } var midType = EmitTypeExp(resExp.Type, parentEnv); var attr = element.CacheAttr( midExp, midType); return(_exps.AttributeRef(resExp.Range, attr)); }