public void InitFromParent() { Debug.Assert(!IsAggregateType()); CType typePar = null; if (IsErrorType()) { typePar = AsErrorType().GetTypeParent(); } else { typePar = GetBaseOrParameterOrElementType(); } _fHasErrors = typePar.HasErrors(); _fUnres = typePar.IsUnresolved(); #if CSEE this.typeRes = this; if (!this.fUnres) { this.tsRes = ktsImportMax; } this.fDirty = typePar.fDirty; this.tsDirty = typePar.tsDirty; #endif // CSEE }
public void InitFromParent() { Debug.Assert(!IsAggregateType()); CType typePar = null; if (IsErrorType()) { typePar = AsErrorType().GetTypeParent(); } else { typePar = GetBaseOrParameterOrElementType(); } _fHasErrors = typePar.HasErrors(); _fUnres = typePar.IsUnresolved(); }
public ParameterModifierType GetParameterModifier(CType paramType, bool isOut) { Name name = _BSymmgr.GetNameManager().GetPredefName(isOut ? PredefinedName.PN_OUTPARAM : PredefinedName.PN_REFPARAM); ParameterModifierType pParamModifier = _typeTable.LookupParameterModifier(name, paramType); if (pParamModifier == null) { // No existing parammod symbol. Create a new one. pParamModifier = _typeFactory.CreateParameterModifier(name, paramType); pParamModifier.isOut = isOut; pParamModifier.InitFromParent(); _typeTable.InsertParameterModifier(name, paramType, pParamModifier); } else { Debug.Assert(pParamModifier.HasErrors() == paramType.HasErrors()); Debug.Assert(pParamModifier.IsUnresolved() == paramType.IsUnresolved()); } Debug.Assert(pParamModifier.GetParameterType() == paramType); return pParamModifier; }
public PointerType GetPointer(CType baseType) { PointerType pPointer = _typeTable.LookupPointer(baseType); if (pPointer == null) { // No existing type. Create a new one. Name namePtr = _BSymmgr.GetNameManager().GetPredefName(PredefinedName.PN_PTR); pPointer = _typeFactory.CreatePointer(namePtr, baseType); pPointer.InitFromParent(); _typeTable.InsertPointer(baseType, pPointer); } else { Debug.Assert(pPointer.HasErrors() == baseType.HasErrors()); Debug.Assert(pPointer.IsUnresolved() == baseType.IsUnresolved()); } Debug.Assert(pPointer.GetReferentType() == baseType); return pPointer; }
public ArrayType GetArray(CType elementType, int args) { Name name; ArrayType pArray; Debug.Assert(args > 0 && args < 32767); switch (args) { case 1: case 2: name = _BSymmgr.GetNameManager().GetPredefinedName(PredefinedName.PN_ARRAY0 + args); break; default: name = _BSymmgr.GetNameManager().Add("[X" + args + 1); break; } // See if we already have an array type of this element type and rank. pArray = _typeTable.LookupArray(name, elementType); if (pArray == null) { // No existing array symbol. Create a new one. pArray = _typeFactory.CreateArray(name, elementType, args); pArray.InitFromParent(); _typeTable.InsertArray(name, elementType, pArray); } else { Debug.Assert(pArray.HasErrors() == elementType.HasErrors()); Debug.Assert(pArray.IsUnresolved() == elementType.IsUnresolved()); } Debug.Assert(pArray.rank == args); Debug.Assert(pArray.GetElementType() == elementType); return pArray; }