Example #1
0
 public static bool IsIgnored(this VTableComponent entry)
 {
     return(entry.Method != null &&
            (entry.Method.IsOperator ||
             (!entry.Method.IsDeclared &&
              ((Class)entry.Method.Namespace).GetPropertyByConstituentMethod(entry.Method) == null)));
 }
Example #2
0
 public static bool IsIgnored(this VTableComponent entry)
 {
     return(entry.Method != null &&
            (entry.Method.IsOperator ||
             (!entry.Method.IsDeclared &&
              ((Class)entry.Method.Namespace).GetPropertyByConstituentMethod(entry.Method) == null) ||
             // virtuals defined in templates are not yet supported
             entry.Method.Namespace is ClassTemplateSpecialization));
 }
Example #3
0
        AST.VTableComponent VisitVTableComponent(VTableComponent component)
        {
            var _component = new AST.VTableComponent
            {
                Kind        = VisitVTableComponentKind(component.Kind),
                Offset      = component.Offset,
                Declaration = Visit(component.Declaration)
            };

            return(_component);
        }
Example #4
0
        public static int GetVTableComponentIndex(Class @class, VTableComponent entry)
        {
            switch (@class.Layout.ABI)
            {
            case CppAbi.Microsoft:
                foreach (var vfptr in @class.Layout.VFTables)
                {
                    var index = GetVTableComponentIndex(vfptr.Layout, entry);
                    if (index >= 0)
                        return index;
                }
                break;
            case CppAbi.Itanium:
                return GetVTableComponentIndex(@class.Layout.Layout, entry);
            }

            throw new NotSupportedException();
        }
Example #5
0
        public static int GetVTableComponentIndex(Class @class, VTableComponent entry)
        {
            switch (@class.Layout.ABI)
            {
            case CppAbi.Microsoft:
                foreach (var vfptr in @class.Layout.VFTables)
                {
                    var index = vfptr.Layout.Components.IndexOf(entry);
                    if (index >= 0)
                        return index;
                }
                break;
            case CppAbi.Itanium:
                // ignore offset to top and RTTI
                return @class.Layout.Layout.Components.IndexOf(entry) - 2;
            }

            throw new NotSupportedException();
        }
Example #6
0
        public static int GetVTableComponentIndex(Class @class, VTableComponent entry)
        {
            switch (@class.Layout.ABI)
            {
            case CppAbi.Microsoft:
                foreach (var vfptr in @class.Layout.VFTables)
                {
                    var index = GetVTableComponentIndex(vfptr.Layout, entry);
                    if (index >= 0)
                    {
                        return(index);
                    }
                }
                break;

            case CppAbi.Itanium:
                return(GetVTableComponentIndex(@class.Layout.Layout, entry));
            }

            throw new NotSupportedException();
        }
Example #7
0
        public static int GetVTableComponentIndex(Class @class, VTableComponent entry)
        {
            switch (@class.Layout.ABI)
            {
            case CppAbi.Microsoft:
                foreach (var vfptr in @class.Layout.VFTables)
                {
                    var index = vfptr.Layout.Components.IndexOf(entry);
                    if (index >= 0)
                    {
                        return(index);
                    }
                }
                break;

            case CppAbi.Itanium:
                // ignore offset to top and RTTI
                return(@class.Layout.Layout.Components.IndexOf(entry) - 2);
            }

            throw new NotSupportedException();
        }
Example #8
0
 public static int GetVTableComponentIndex(VTableLayout layout, VTableComponent entry)
 {
     return(layout.Components.IndexOf(entry));
 }
Example #9
0
 public static int GetVTableComponentIndex(VTableLayout layout, VTableComponent entry)
 {
     return layout.Components.IndexOf(entry);
 }