public AST.QualifiedType VisitQualified(QualifiedType qualType) { var _qualType = new AST.QualifiedType { Qualifiers = new AST.TypeQualifiers { IsConst = qualType.Qualifiers.IsConst, IsRestrict = qualType.Qualifiers.IsRestrict, IsVolatile = qualType.Qualifiers.IsVolatile, }, Type = Visit(qualType.Type) }; return(_qualType); }
public static IList <Parameter> GatherInternalParams(this Function function, bool isItaniumLikeAbi, bool universalDelegate = false) { var @params = new List <Parameter>(); var method = (function.OriginalFunction ?? function) as Method; var isInstanceMethod = method != null && !method.IsStatic; var pointer = new QualifiedType(new PointerType(new QualifiedType(new BuiltinType(PrimitiveType.Void)))); if (isInstanceMethod && !isItaniumLikeAbi) { @params.Add(new Parameter { QualifiedType = pointer, Name = "instance", Namespace = function }); } if (!function.HasIndirectReturnTypeParameter && isInstanceMethod && isItaniumLikeAbi) { @params.Add(new Parameter { QualifiedType = pointer, Name = "instance", Namespace = function }); } var i = 0; foreach (var param in function.Parameters.Where( p => p.Kind != ParameterKind.OperatorParameter && p.Kind != ParameterKind.Extension)) { @params.Add(new Parameter { QualifiedType = universalDelegate && param.Kind == ParameterKind.IndirectReturnType ? pointer : param.QualifiedType, Kind = param.Kind, Usage = param.Usage, Name = universalDelegate ? $"arg{++i}": param.Name, Namespace = param.Namespace }); if (param.Kind == ParameterKind.IndirectReturnType && isInstanceMethod && isItaniumLikeAbi) { @params.Add(new Parameter { QualifiedType = pointer, Name = "instance", Namespace = function }); } } if (method != null && method.IsConstructor) { var @class = (Class)method.Namespace; if (!isItaniumLikeAbi && @class.Layout.HasVirtualBases) { @params.Add(new Parameter { QualifiedType = new QualifiedType(new BuiltinType(PrimitiveType.Int)), Name = "__forBases", Namespace = function }); } } return(@params); }
public virtual QualifiedType TransformType(CppSharp.AST.QualifiedType type) => type;
public TemplateParameterSubstitutionType(TemplateParameterSubstitutionType type) : base(type) { Replacement = new QualifiedType((Type)type.Replacement.Type.Clone(), type.Replacement.Qualifiers); }
public AttributedType(AttributedType type) : base(type) { Modified = new QualifiedType((Type)type.Modified.Type.Clone(), type.Modified.Qualifiers); Equivalent = new QualifiedType((Type)type.Equivalent.Type.Clone(), type.Equivalent.Qualifiers); }
public MemberPointerType(MemberPointerType type) : base(type) { QualifiedPointee = new QualifiedType((Type)type.QualifiedPointee.Type.Clone(), type.QualifiedPointee.Qualifiers); }
public PointerType(QualifiedType pointee = new QualifiedType()) { Modifier = TypeModifier.Pointer; QualifiedPointee = pointee; }
public ArrayType(QualifiedType qualifiedType) { QualifiedType = qualifiedType; }