Browse Source

Removed Method.AccessDecl because it doesn't map to Clang and was buggy.

Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
pull/604/head
Dimitar Dobrev 10 years ago
parent
commit
b3a5b88433
  1. 3
      src/AST/Method.cs
  2. 1
      src/Core/Parser/ASTConverter.cs
  3. 1
      src/CppParser/AST.cpp
  4. 2
      src/CppParser/AST.h
  5. 10
      src/CppParser/Bindings/CLI/AST.cpp
  6. 6
      src/CppParser/Bindings/CLI/AST.h
  7. 49
      src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/AST.cs
  8. 49
      src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/AST.cs
  9. 49
      src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/AST.cs
  10. 49
      src/CppParser/Bindings/CSharp/x86_64-linux-gnu/AST.cs
  11. 9
      src/CppParser/Parser.cpp

3
src/AST/Method.cs

@ -83,7 +83,6 @@ namespace CppSharp.AST @@ -83,7 +83,6 @@ namespace CppSharp.AST
: base(method)
{
Access = method.Access;
AccessDecl = method.AccessDecl;
IsVirtual = method.IsVirtual;
IsConst = method.IsConst;
IsImplicit = method.IsImplicit;
@ -105,8 +104,6 @@ namespace CppSharp.AST @@ -105,8 +104,6 @@ namespace CppSharp.AST
}
public AccessSpecifierDecl AccessDecl { get; set; }
public bool IsVirtual { get; set; }
public bool IsStatic { get; set; }
public bool IsConst { get; set; }

1
src/Core/Parser/ASTConverter.cs

@ -1008,7 +1008,6 @@ namespace CppSharp @@ -1008,7 +1008,6 @@ namespace CppSharp
var _method = new AST.Method();
VisitFunction(decl, _method);
_method.AccessDecl = Visit(decl.AccessDecl) as AST.AccessSpecifierDecl;
_method.IsVirtual = decl.IsVirtual;
_method.IsStatic = decl.IsStatic;
_method.IsConst = decl.IsConst;

1
src/CppParser/AST.cpp

@ -575,7 +575,6 @@ DEF_VECTOR(Function, Parameter*, Parameters) @@ -575,7 +575,6 @@ DEF_VECTOR(Function, Parameter*, Parameters)
Method::Method()
: Function()
, AccessDecl(0)
, IsVirtual(false)
, IsStatic(false)
, IsConst(false)

2
src/CppParser/AST.h

@ -639,8 +639,6 @@ public: @@ -639,8 +639,6 @@ public:
Method();
~Method();
AccessSpecifierDecl* AccessDecl;
bool IsVirtual;
bool IsStatic;
bool IsConst;

10
src/CppParser/Bindings/CLI/AST.cpp

@ -2669,16 +2669,6 @@ CppSharp::Parser::AST::Method::Method(CppSharp::Parser::AST::Method^ _0) @@ -2669,16 +2669,6 @@ CppSharp::Parser::AST::Method::Method(CppSharp::Parser::AST::Method^ _0)
NativePtr = new ::CppSharp::CppParser::AST::Method(arg0);
}
CppSharp::Parser::AST::AccessSpecifierDecl^ CppSharp::Parser::AST::Method::AccessDecl::get()
{
return (((::CppSharp::CppParser::AST::Method*)NativePtr)->AccessDecl == nullptr) ? nullptr : gcnew CppSharp::Parser::AST::AccessSpecifierDecl((::CppSharp::CppParser::AST::AccessSpecifierDecl*)((::CppSharp::CppParser::AST::Method*)NativePtr)->AccessDecl);
}
void CppSharp::Parser::AST::Method::AccessDecl::set(CppSharp::Parser::AST::AccessSpecifierDecl^ value)
{
((::CppSharp::CppParser::AST::Method*)NativePtr)->AccessDecl = (::CppSharp::CppParser::AST::AccessSpecifierDecl*)value->NativePtr;
}
bool CppSharp::Parser::AST::Method::IsVirtual::get()
{
return ((::CppSharp::CppParser::AST::Method*)NativePtr)->IsVirtual;

6
src/CppParser/Bindings/CLI/AST.h

@ -1672,12 +1672,6 @@ namespace CppSharp @@ -1672,12 +1672,6 @@ namespace CppSharp
~Method();
property CppSharp::Parser::AST::AccessSpecifierDecl^ AccessDecl
{
CppSharp::Parser::AST::AccessSpecifierDecl^ get();
void set(CppSharp::Parser::AST::AccessSpecifierDecl^);
}
property bool IsVirtual
{
bool get();

49
src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/AST.cs

@ -5879,7 +5879,7 @@ namespace CppSharp @@ -5879,7 +5879,7 @@ namespace CppSharp
public unsafe partial class Method : CppSharp.Parser.AST.Function, IDisposable
{
[StructLayout(LayoutKind.Explicit, Size = 184)]
[StructLayout(LayoutKind.Explicit, Size = 180)]
public new partial struct Internal
{
[FieldOffset(0)]
@ -5949,39 +5949,36 @@ namespace CppSharp @@ -5949,39 +5949,36 @@ namespace CppSharp
public global::System.IntPtr SpecializationInfo;
[FieldOffset(156)]
public global::System.IntPtr AccessDecl;
[FieldOffset(160)]
public byte IsVirtual;
[FieldOffset(161)]
[FieldOffset(157)]
public byte IsStatic;
[FieldOffset(162)]
[FieldOffset(158)]
public byte IsConst;
[FieldOffset(163)]
[FieldOffset(159)]
public byte IsImplicit;
[FieldOffset(164)]
[FieldOffset(160)]
public byte IsExplicit;
[FieldOffset(165)]
[FieldOffset(161)]
public byte IsOverride;
[FieldOffset(168)]
[FieldOffset(164)]
public CppSharp.Parser.AST.CXXMethodKind MethodKind;
[FieldOffset(172)]
[FieldOffset(168)]
public byte IsDefaultConstructor;
[FieldOffset(173)]
[FieldOffset(169)]
public byte IsCopyConstructor;
[FieldOffset(174)]
[FieldOffset(170)]
public byte IsMoveConstructor;
[FieldOffset(176)]
[FieldOffset(172)]
public CppSharp.Parser.AST.QualifiedType.Internal ConversionType;
[SuppressUnmanagedCodeSecurity]
@ -6012,7 +6009,7 @@ namespace CppSharp @@ -6012,7 +6009,7 @@ namespace CppSharp
private static Method.Internal* __CopyValue(Method.Internal native)
{
var ret = Marshal.AllocHGlobal(184);
var ret = Marshal.AllocHGlobal(180);
CppSharp.Parser.AST.Method.Internal.cctor_1(ret, new global::System.IntPtr(&native));
return (Method.Internal*) ret;
}
@ -6036,7 +6033,7 @@ namespace CppSharp @@ -6036,7 +6033,7 @@ namespace CppSharp
public Method()
: this((Internal*) null)
{
__Instance = Marshal.AllocHGlobal(184);
__Instance = Marshal.AllocHGlobal(180);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
Internal.ctor_0((__Instance + __PointerAdjustment));
@ -6045,7 +6042,7 @@ namespace CppSharp @@ -6045,7 +6042,7 @@ namespace CppSharp
public Method(CppSharp.Parser.AST.Method _0)
: this((Internal*) null)
{
__Instance = Marshal.AllocHGlobal(184);
__Instance = Marshal.AllocHGlobal(180);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
if (ReferenceEquals(_0, null))
@ -6063,24 +6060,6 @@ namespace CppSharp @@ -6063,24 +6060,6 @@ namespace CppSharp
Marshal.FreeHGlobal(__Instance);
}
public CppSharp.Parser.AST.AccessSpecifierDecl AccessDecl
{
get
{
CppSharp.Parser.AST.AccessSpecifierDecl __result0;
if (((Internal*) __Instance)->AccessDecl == IntPtr.Zero) __result0 = null;
else if (CppSharp.Parser.AST.AccessSpecifierDecl.NativeToManagedMap.ContainsKey(((Internal*) __Instance)->AccessDecl))
__result0 = (CppSharp.Parser.AST.AccessSpecifierDecl) CppSharp.Parser.AST.AccessSpecifierDecl.NativeToManagedMap[((Internal*) __Instance)->AccessDecl];
else __result0 = CppSharp.Parser.AST.AccessSpecifierDecl.__CreateInstance(((Internal*) __Instance)->AccessDecl);
return __result0;
}
set
{
((Internal*) __Instance)->AccessDecl = ReferenceEquals(value, null) ? global::System.IntPtr.Zero : value.__Instance;
}
}
public bool IsVirtual
{
get

49
src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/AST.cs

@ -5879,7 +5879,7 @@ namespace CppSharp @@ -5879,7 +5879,7 @@ namespace CppSharp
public unsafe partial class Method : CppSharp.Parser.AST.Function, IDisposable
{
[StructLayout(LayoutKind.Explicit, Size = 244)]
[StructLayout(LayoutKind.Explicit, Size = 240)]
public new partial struct Internal
{
[FieldOffset(0)]
@ -5949,39 +5949,36 @@ namespace CppSharp @@ -5949,39 +5949,36 @@ namespace CppSharp
public global::System.IntPtr SpecializationInfo;
[FieldOffset(216)]
public global::System.IntPtr AccessDecl;
[FieldOffset(220)]
public byte IsVirtual;
[FieldOffset(221)]
[FieldOffset(217)]
public byte IsStatic;
[FieldOffset(222)]
[FieldOffset(218)]
public byte IsConst;
[FieldOffset(223)]
[FieldOffset(219)]
public byte IsImplicit;
[FieldOffset(224)]
[FieldOffset(220)]
public byte IsExplicit;
[FieldOffset(225)]
[FieldOffset(221)]
public byte IsOverride;
[FieldOffset(228)]
[FieldOffset(224)]
public CppSharp.Parser.AST.CXXMethodKind MethodKind;
[FieldOffset(232)]
[FieldOffset(228)]
public byte IsDefaultConstructor;
[FieldOffset(233)]
[FieldOffset(229)]
public byte IsCopyConstructor;
[FieldOffset(234)]
[FieldOffset(230)]
public byte IsMoveConstructor;
[FieldOffset(236)]
[FieldOffset(232)]
public CppSharp.Parser.AST.QualifiedType.Internal ConversionType;
[SuppressUnmanagedCodeSecurity]
@ -6012,7 +6009,7 @@ namespace CppSharp @@ -6012,7 +6009,7 @@ namespace CppSharp
private static Method.Internal* __CopyValue(Method.Internal native)
{
var ret = Marshal.AllocHGlobal(244);
var ret = Marshal.AllocHGlobal(240);
CppSharp.Parser.AST.Method.Internal.cctor_1(ret, new global::System.IntPtr(&native));
return (Method.Internal*) ret;
}
@ -6036,7 +6033,7 @@ namespace CppSharp @@ -6036,7 +6033,7 @@ namespace CppSharp
public Method()
: this((Internal*) null)
{
__Instance = Marshal.AllocHGlobal(244);
__Instance = Marshal.AllocHGlobal(240);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
Internal.ctor_0((__Instance + __PointerAdjustment));
@ -6045,7 +6042,7 @@ namespace CppSharp @@ -6045,7 +6042,7 @@ namespace CppSharp
public Method(CppSharp.Parser.AST.Method _0)
: this((Internal*) null)
{
__Instance = Marshal.AllocHGlobal(244);
__Instance = Marshal.AllocHGlobal(240);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
if (ReferenceEquals(_0, null))
@ -6063,24 +6060,6 @@ namespace CppSharp @@ -6063,24 +6060,6 @@ namespace CppSharp
Marshal.FreeHGlobal(__Instance);
}
public CppSharp.Parser.AST.AccessSpecifierDecl AccessDecl
{
get
{
CppSharp.Parser.AST.AccessSpecifierDecl __result0;
if (((Internal*) __Instance)->AccessDecl == IntPtr.Zero) __result0 = null;
else if (CppSharp.Parser.AST.AccessSpecifierDecl.NativeToManagedMap.ContainsKey(((Internal*) __Instance)->AccessDecl))
__result0 = (CppSharp.Parser.AST.AccessSpecifierDecl) CppSharp.Parser.AST.AccessSpecifierDecl.NativeToManagedMap[((Internal*) __Instance)->AccessDecl];
else __result0 = CppSharp.Parser.AST.AccessSpecifierDecl.__CreateInstance(((Internal*) __Instance)->AccessDecl);
return __result0;
}
set
{
((Internal*) __Instance)->AccessDecl = ReferenceEquals(value, null) ? global::System.IntPtr.Zero : value.__Instance;
}
}
public bool IsVirtual
{
get

49
src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/AST.cs

@ -5878,7 +5878,7 @@ namespace CppSharp @@ -5878,7 +5878,7 @@ namespace CppSharp
public unsafe partial class Method : CppSharp.Parser.AST.Function, IDisposable
{
[StructLayout(LayoutKind.Explicit, Size = 328)]
[StructLayout(LayoutKind.Explicit, Size = 320)]
public new partial struct Internal
{
[FieldOffset(0)]
@ -5948,39 +5948,36 @@ namespace CppSharp @@ -5948,39 +5948,36 @@ namespace CppSharp
public global::System.IntPtr SpecializationInfo;
[FieldOffset(288)]
public global::System.IntPtr AccessDecl;
[FieldOffset(296)]
public byte IsVirtual;
[FieldOffset(297)]
[FieldOffset(289)]
public byte IsStatic;
[FieldOffset(298)]
[FieldOffset(290)]
public byte IsConst;
[FieldOffset(299)]
[FieldOffset(291)]
public byte IsImplicit;
[FieldOffset(300)]
[FieldOffset(292)]
public byte IsExplicit;
[FieldOffset(301)]
[FieldOffset(293)]
public byte IsOverride;
[FieldOffset(304)]
[FieldOffset(296)]
public CppSharp.Parser.AST.CXXMethodKind MethodKind;
[FieldOffset(308)]
[FieldOffset(300)]
public byte IsDefaultConstructor;
[FieldOffset(309)]
[FieldOffset(301)]
public byte IsCopyConstructor;
[FieldOffset(310)]
[FieldOffset(302)]
public byte IsMoveConstructor;
[FieldOffset(312)]
[FieldOffset(304)]
public CppSharp.Parser.AST.QualifiedType.Internal ConversionType;
[SuppressUnmanagedCodeSecurity]
@ -6011,7 +6008,7 @@ namespace CppSharp @@ -6011,7 +6008,7 @@ namespace CppSharp
private static Method.Internal* __CopyValue(Method.Internal native)
{
var ret = Marshal.AllocHGlobal(328);
var ret = Marshal.AllocHGlobal(320);
CppSharp.Parser.AST.Method.Internal.cctor_1(ret, new global::System.IntPtr(&native));
return (Method.Internal*) ret;
}
@ -6035,7 +6032,7 @@ namespace CppSharp @@ -6035,7 +6032,7 @@ namespace CppSharp
public Method()
: this((Internal*) null)
{
__Instance = Marshal.AllocHGlobal(328);
__Instance = Marshal.AllocHGlobal(320);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
Internal.ctor_0((__Instance + __PointerAdjustment));
@ -6044,7 +6041,7 @@ namespace CppSharp @@ -6044,7 +6041,7 @@ namespace CppSharp
public Method(CppSharp.Parser.AST.Method _0)
: this((Internal*) null)
{
__Instance = Marshal.AllocHGlobal(328);
__Instance = Marshal.AllocHGlobal(320);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
if (ReferenceEquals(_0, null))
@ -6062,24 +6059,6 @@ namespace CppSharp @@ -6062,24 +6059,6 @@ namespace CppSharp
Marshal.FreeHGlobal(__Instance);
}
public CppSharp.Parser.AST.AccessSpecifierDecl AccessDecl
{
get
{
CppSharp.Parser.AST.AccessSpecifierDecl __result0;
if (((Internal*) __Instance)->AccessDecl == IntPtr.Zero) __result0 = null;
else if (CppSharp.Parser.AST.AccessSpecifierDecl.NativeToManagedMap.ContainsKey(((Internal*) __Instance)->AccessDecl))
__result0 = (CppSharp.Parser.AST.AccessSpecifierDecl) CppSharp.Parser.AST.AccessSpecifierDecl.NativeToManagedMap[((Internal*) __Instance)->AccessDecl];
else __result0 = CppSharp.Parser.AST.AccessSpecifierDecl.__CreateInstance(((Internal*) __Instance)->AccessDecl);
return __result0;
}
set
{
((Internal*) __Instance)->AccessDecl = ReferenceEquals(value, null) ? global::System.IntPtr.Zero : value.__Instance;
}
}
public bool IsVirtual
{
get

49
src/CppParser/Bindings/CSharp/x86_64-linux-gnu/AST.cs

@ -5878,7 +5878,7 @@ namespace CppSharp @@ -5878,7 +5878,7 @@ namespace CppSharp
public unsafe partial class Method : CppSharp.Parser.AST.Function, IDisposable
{
[StructLayout(LayoutKind.Explicit, Size = 248)]
[StructLayout(LayoutKind.Explicit, Size = 240)]
public new partial struct Internal
{
[FieldOffset(0)]
@ -5948,39 +5948,36 @@ namespace CppSharp @@ -5948,39 +5948,36 @@ namespace CppSharp
public global::System.IntPtr SpecializationInfo;
[FieldOffset(208)]
public global::System.IntPtr AccessDecl;
[FieldOffset(216)]
public byte IsVirtual;
[FieldOffset(217)]
[FieldOffset(209)]
public byte IsStatic;
[FieldOffset(218)]
[FieldOffset(210)]
public byte IsConst;
[FieldOffset(219)]
[FieldOffset(211)]
public byte IsImplicit;
[FieldOffset(220)]
[FieldOffset(212)]
public byte IsExplicit;
[FieldOffset(221)]
[FieldOffset(213)]
public byte IsOverride;
[FieldOffset(224)]
[FieldOffset(216)]
public CppSharp.Parser.AST.CXXMethodKind MethodKind;
[FieldOffset(228)]
[FieldOffset(220)]
public byte IsDefaultConstructor;
[FieldOffset(229)]
[FieldOffset(221)]
public byte IsCopyConstructor;
[FieldOffset(230)]
[FieldOffset(222)]
public byte IsMoveConstructor;
[FieldOffset(232)]
[FieldOffset(224)]
public CppSharp.Parser.AST.QualifiedType.Internal ConversionType;
[SuppressUnmanagedCodeSecurity]
@ -6011,7 +6008,7 @@ namespace CppSharp @@ -6011,7 +6008,7 @@ namespace CppSharp
private static Method.Internal* __CopyValue(Method.Internal native)
{
var ret = Marshal.AllocHGlobal(248);
var ret = Marshal.AllocHGlobal(240);
CppSharp.Parser.AST.Method.Internal.cctor_1(ret, new global::System.IntPtr(&native));
return (Method.Internal*) ret;
}
@ -6035,7 +6032,7 @@ namespace CppSharp @@ -6035,7 +6032,7 @@ namespace CppSharp
public Method()
: this((Internal*) null)
{
__Instance = Marshal.AllocHGlobal(248);
__Instance = Marshal.AllocHGlobal(240);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
Internal.ctor_0((__Instance + __PointerAdjustment));
@ -6044,7 +6041,7 @@ namespace CppSharp @@ -6044,7 +6041,7 @@ namespace CppSharp
public Method(CppSharp.Parser.AST.Method _0)
: this((Internal*) null)
{
__Instance = Marshal.AllocHGlobal(248);
__Instance = Marshal.AllocHGlobal(240);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
if (ReferenceEquals(_0, null))
@ -6062,24 +6059,6 @@ namespace CppSharp @@ -6062,24 +6059,6 @@ namespace CppSharp
Marshal.FreeHGlobal(__Instance);
}
public CppSharp.Parser.AST.AccessSpecifierDecl AccessDecl
{
get
{
CppSharp.Parser.AST.AccessSpecifierDecl __result0;
if (((Internal*) __Instance)->AccessDecl == IntPtr.Zero) __result0 = null;
else if (CppSharp.Parser.AST.AccessSpecifierDecl.NativeToManagedMap.ContainsKey(((Internal*) __Instance)->AccessDecl))
__result0 = (CppSharp.Parser.AST.AccessSpecifierDecl) CppSharp.Parser.AST.AccessSpecifierDecl.NativeToManagedMap[((Internal*) __Instance)->AccessDecl];
else __result0 = CppSharp.Parser.AST.AccessSpecifierDecl.__CreateInstance(((Internal*) __Instance)->AccessDecl);
return __result0;
}
set
{
((Internal*) __Instance)->AccessDecl = ReferenceEquals(value, null) ? global::System.IntPtr.Zero : value.__Instance;
}
}
public bool IsVirtual
{
get

9
src/CppParser/Parser.cpp

@ -730,8 +730,6 @@ void Parser::WalkRecord(clang::RecordDecl* Record, Class* RC) @@ -730,8 +730,6 @@ void Parser::WalkRecord(clang::RecordDecl* Record, Class* RC)
RC->Layout->DataSize = (int)Layout->getDataSize().getQuantity();
}
AccessSpecifierDecl* AccessDecl = nullptr;
for(auto it = Record->decls_begin(); it != Record->decls_end(); ++it)
{
auto D = *it;
@ -744,8 +742,7 @@ void Parser::WalkRecord(clang::RecordDecl* Record, Class* RC) @@ -744,8 +742,7 @@ void Parser::WalkRecord(clang::RecordDecl* Record, Class* RC)
case Decl::CXXMethod:
{
auto MD = cast<CXXMethodDecl>(D);
auto Method = WalkMethodCXX(MD);
Method->AccessDecl = AccessDecl;
WalkMethodCXX(MD);
break;
}
case Decl::Field:
@ -762,7 +759,7 @@ void Parser::WalkRecord(clang::RecordDecl* Record, Class* RC) @@ -762,7 +759,7 @@ void Parser::WalkRecord(clang::RecordDecl* Record, Class* RC)
{
AccessSpecDecl* AS = cast<AccessSpecDecl>(D);
AccessDecl = new AccessSpecifierDecl();
auto AccessDecl = new AccessSpecifierDecl();
HandleDeclaration(AS, AccessDecl);
AccessDecl->Access = ConvertToAccess(AS->getAccess());
@ -775,7 +772,7 @@ void Parser::WalkRecord(clang::RecordDecl* Record, Class* RC) @@ -775,7 +772,7 @@ void Parser::WalkRecord(clang::RecordDecl* Record, Class* RC)
break;
default:
{
auto Decl = WalkDeclaration(D);
WalkDeclaration(D);
break;
} }
}

Loading…
Cancel
Save