Browse Source

Removed an unused field and redundant parameters from the parser.

Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
pull/1005/head
Dimitar Dobrev 8 years ago
parent
commit
51a109d2db
  1. 1
      src/CppParser/Bindings/CLI/CppParser.h
  2. 70
      src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/CppSharp.CppParser.cs
  3. 70
      src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/CppSharp.CppParser.cs
  4. 70
      src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/CppSharp.CppParser.cs
  5. 70
      src/CppParser/Bindings/CSharp/x86_64-linux-gnu-cxx11abi/CppSharp.CppParser.cs
  6. 70
      src/CppParser/Bindings/CSharp/x86_64-linux-gnu/CppSharp.CppParser.cs
  7. 70
      src/CppParser/Bindings/CSharp/x86_64-pc-win32-msvc/CppSharp.CppParser.cs
  8. 3
      src/CppParser/CppParser.cpp
  9. 3
      src/CppParser/CppParser.h
  10. 16
      src/CppParser/Parser.cpp
  11. 4
      src/CppParser/Parser.h

1
src/CppParser/Bindings/CLI/CppParser.h

@ -18,7 +18,6 @@ namespace CppSharp
enum struct SourceLocationKind; enum struct SourceLocationKind;
ref class ClangParser; ref class ClangParser;
ref class CppParserOptions; ref class CppParserOptions;
ref class Parser;
ref class ParserDiagnostic; ref class ParserDiagnostic;
ref class ParserResult; ref class ParserResult;
ref class ParserTargetInfo; ref class ParserTargetInfo;

70
src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/CppSharp.CppParser.cs

@ -17899,53 +17899,6 @@ namespace CppSharp
User = 4 User = 4
} }
public unsafe partial class Parser
{
[StructLayout(LayoutKind.Explicit, Size = 0)]
public partial struct __Internal
{
}
public global::System.IntPtr __Instance { get; protected set; }
protected int __PointerAdjustment;
internal static readonly global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::CppSharp.Parser.Parser> NativeToManagedMap = new global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::CppSharp.Parser.Parser>();
protected void*[] __OriginalVTables;
protected bool __ownsNativeInstance;
internal static global::CppSharp.Parser.Parser __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
{
return new global::CppSharp.Parser.Parser(native.ToPointer(), skipVTables);
}
internal static global::CppSharp.Parser.Parser __CreateInstance(global::CppSharp.Parser.Parser.__Internal native, bool skipVTables = false)
{
return new global::CppSharp.Parser.Parser(native, skipVTables);
}
private static void* __CopyValue(global::CppSharp.Parser.Parser.__Internal native)
{
var ret = Marshal.AllocHGlobal(sizeof(global::CppSharp.Parser.Parser.__Internal));
*(global::CppSharp.Parser.Parser.__Internal*) ret = native;
return ret.ToPointer();
}
private Parser(global::CppSharp.Parser.Parser.__Internal native, bool skipVTables = false)
: this(__CopyValue(native), skipVTables)
{
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
}
protected Parser(void* native, bool skipVTables = false)
{
if (native == null)
return;
__Instance = new global::System.IntPtr(native);
}
}
public unsafe partial class CppParserOptions : IDisposable public unsafe partial class CppParserOptions : IDisposable
{ {
[StructLayout(LayoutKind.Explicit, Size = 152)] [StructLayout(LayoutKind.Explicit, Size = 152)]
@ -18819,7 +18772,7 @@ namespace CppSharp
public unsafe partial class ParserResult : IDisposable public unsafe partial class ParserResult : IDisposable
{ {
[StructLayout(LayoutKind.Explicit, Size = 28)] [StructLayout(LayoutKind.Explicit, Size = 24)]
public partial struct __Internal public partial struct __Internal
{ {
[FieldOffset(0)] [FieldOffset(0)]
@ -18834,9 +18787,6 @@ namespace CppSharp
[FieldOffset(20)] [FieldOffset(20)]
internal global::System.IntPtr library; internal global::System.IntPtr library;
[FieldOffset(24)]
internal global::System.IntPtr codeParser;
[SuppressUnmanagedCodeSecurity] [SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, [DllImport("CppSharp.CppParser", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZN8CppSharp9CppParser12ParserResultC2Ev")] EntryPoint="_ZN8CppSharp9CppParser12ParserResultC2Ev")]
@ -19018,24 +18968,6 @@ namespace CppSharp
} }
} }
public global::CppSharp.Parser.Parser CodeParser
{
get
{
global::CppSharp.Parser.Parser __result0;
if (((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->codeParser == IntPtr.Zero) __result0 = null;
else if (global::CppSharp.Parser.Parser.NativeToManagedMap.ContainsKey(((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->codeParser))
__result0 = (global::CppSharp.Parser.Parser) global::CppSharp.Parser.Parser.NativeToManagedMap[((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->codeParser];
else __result0 = global::CppSharp.Parser.Parser.__CreateInstance(((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->codeParser);
return __result0;
}
set
{
((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->codeParser = ReferenceEquals(value, null) ? global::System.IntPtr.Zero : value.__Instance;
}
}
public uint DiagnosticsCount public uint DiagnosticsCount
{ {
get get

70
src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/CppSharp.CppParser.cs

@ -17899,53 +17899,6 @@ namespace CppSharp
User = 4 User = 4
} }
public unsafe partial class Parser
{
[StructLayout(LayoutKind.Explicit, Size = 0)]
public partial struct __Internal
{
}
public global::System.IntPtr __Instance { get; protected set; }
protected int __PointerAdjustment;
internal static readonly global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::CppSharp.Parser.Parser> NativeToManagedMap = new global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::CppSharp.Parser.Parser>();
protected void*[] __OriginalVTables;
protected bool __ownsNativeInstance;
internal static global::CppSharp.Parser.Parser __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
{
return new global::CppSharp.Parser.Parser(native.ToPointer(), skipVTables);
}
internal static global::CppSharp.Parser.Parser __CreateInstance(global::CppSharp.Parser.Parser.__Internal native, bool skipVTables = false)
{
return new global::CppSharp.Parser.Parser(native, skipVTables);
}
private static void* __CopyValue(global::CppSharp.Parser.Parser.__Internal native)
{
var ret = Marshal.AllocHGlobal(sizeof(global::CppSharp.Parser.Parser.__Internal));
*(global::CppSharp.Parser.Parser.__Internal*) ret = native;
return ret.ToPointer();
}
private Parser(global::CppSharp.Parser.Parser.__Internal native, bool skipVTables = false)
: this(__CopyValue(native), skipVTables)
{
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
}
protected Parser(void* native, bool skipVTables = false)
{
if (native == null)
return;
__Instance = new global::System.IntPtr(native);
}
}
public unsafe partial class CppParserOptions : IDisposable public unsafe partial class CppParserOptions : IDisposable
{ {
[StructLayout(LayoutKind.Explicit, Size = 188)] [StructLayout(LayoutKind.Explicit, Size = 188)]
@ -18819,7 +18772,7 @@ namespace CppSharp
public unsafe partial class ParserResult : IDisposable public unsafe partial class ParserResult : IDisposable
{ {
[StructLayout(LayoutKind.Explicit, Size = 28)] [StructLayout(LayoutKind.Explicit, Size = 24)]
public partial struct __Internal public partial struct __Internal
{ {
[FieldOffset(0)] [FieldOffset(0)]
@ -18834,9 +18787,6 @@ namespace CppSharp
[FieldOffset(20)] [FieldOffset(20)]
internal global::System.IntPtr library; internal global::System.IntPtr library;
[FieldOffset(24)]
internal global::System.IntPtr codeParser;
[SuppressUnmanagedCodeSecurity] [SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall, [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall,
EntryPoint="??0ParserResult@CppParser@CppSharp@@QAE@XZ")] EntryPoint="??0ParserResult@CppParser@CppSharp@@QAE@XZ")]
@ -19018,24 +18968,6 @@ namespace CppSharp
} }
} }
public global::CppSharp.Parser.Parser CodeParser
{
get
{
global::CppSharp.Parser.Parser __result0;
if (((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->codeParser == IntPtr.Zero) __result0 = null;
else if (global::CppSharp.Parser.Parser.NativeToManagedMap.ContainsKey(((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->codeParser))
__result0 = (global::CppSharp.Parser.Parser) global::CppSharp.Parser.Parser.NativeToManagedMap[((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->codeParser];
else __result0 = global::CppSharp.Parser.Parser.__CreateInstance(((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->codeParser);
return __result0;
}
set
{
((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->codeParser = ReferenceEquals(value, null) ? global::System.IntPtr.Zero : value.__Instance;
}
}
public uint DiagnosticsCount public uint DiagnosticsCount
{ {
get get

70
src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/CppSharp.CppParser.cs

@ -17898,53 +17898,6 @@ namespace CppSharp
User = 4 User = 4
} }
public unsafe partial class Parser
{
[StructLayout(LayoutKind.Explicit, Size = 0)]
public partial struct __Internal
{
}
public global::System.IntPtr __Instance { get; protected set; }
protected int __PointerAdjustment;
internal static readonly global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::CppSharp.Parser.Parser> NativeToManagedMap = new global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::CppSharp.Parser.Parser>();
protected void*[] __OriginalVTables;
protected bool __ownsNativeInstance;
internal static global::CppSharp.Parser.Parser __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
{
return new global::CppSharp.Parser.Parser(native.ToPointer(), skipVTables);
}
internal static global::CppSharp.Parser.Parser __CreateInstance(global::CppSharp.Parser.Parser.__Internal native, bool skipVTables = false)
{
return new global::CppSharp.Parser.Parser(native, skipVTables);
}
private static void* __CopyValue(global::CppSharp.Parser.Parser.__Internal native)
{
var ret = Marshal.AllocHGlobal(sizeof(global::CppSharp.Parser.Parser.__Internal));
*(global::CppSharp.Parser.Parser.__Internal*) ret = native;
return ret.ToPointer();
}
private Parser(global::CppSharp.Parser.Parser.__Internal native, bool skipVTables = false)
: this(__CopyValue(native), skipVTables)
{
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
}
protected Parser(void* native, bool skipVTables = false)
{
if (native == null)
return;
__Instance = new global::System.IntPtr(native);
}
}
public unsafe partial class CppParserOptions : IDisposable public unsafe partial class CppParserOptions : IDisposable
{ {
[StructLayout(LayoutKind.Explicit, Size = 296)] [StructLayout(LayoutKind.Explicit, Size = 296)]
@ -18818,7 +18771,7 @@ namespace CppSharp
public unsafe partial class ParserResult : IDisposable public unsafe partial class ParserResult : IDisposable
{ {
[StructLayout(LayoutKind.Explicit, Size = 56)] [StructLayout(LayoutKind.Explicit, Size = 48)]
public partial struct __Internal public partial struct __Internal
{ {
[FieldOffset(0)] [FieldOffset(0)]
@ -18833,9 +18786,6 @@ namespace CppSharp
[FieldOffset(40)] [FieldOffset(40)]
internal global::System.IntPtr library; internal global::System.IntPtr library;
[FieldOffset(48)]
internal global::System.IntPtr codeParser;
[SuppressUnmanagedCodeSecurity] [SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, [DllImport("CppSharp.CppParser", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZN8CppSharp9CppParser12ParserResultC2Ev")] EntryPoint="_ZN8CppSharp9CppParser12ParserResultC2Ev")]
@ -19017,24 +18967,6 @@ namespace CppSharp
} }
} }
public global::CppSharp.Parser.Parser CodeParser
{
get
{
global::CppSharp.Parser.Parser __result0;
if (((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->codeParser == IntPtr.Zero) __result0 = null;
else if (global::CppSharp.Parser.Parser.NativeToManagedMap.ContainsKey(((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->codeParser))
__result0 = (global::CppSharp.Parser.Parser) global::CppSharp.Parser.Parser.NativeToManagedMap[((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->codeParser];
else __result0 = global::CppSharp.Parser.Parser.__CreateInstance(((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->codeParser);
return __result0;
}
set
{
((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->codeParser = ReferenceEquals(value, null) ? global::System.IntPtr.Zero : value.__Instance;
}
}
public uint DiagnosticsCount public uint DiagnosticsCount
{ {
get get

70
src/CppParser/Bindings/CSharp/x86_64-linux-gnu-cxx11abi/CppSharp.CppParser.cs

@ -17898,53 +17898,6 @@ namespace CppSharp
User = 4 User = 4
} }
public unsafe partial class Parser
{
[StructLayout(LayoutKind.Explicit, Size = 0)]
public partial struct __Internal
{
}
public global::System.IntPtr __Instance { get; protected set; }
protected int __PointerAdjustment;
internal static readonly global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::CppSharp.Parser.Parser> NativeToManagedMap = new global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::CppSharp.Parser.Parser>();
protected void*[] __OriginalVTables;
protected bool __ownsNativeInstance;
internal static global::CppSharp.Parser.Parser __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
{
return new global::CppSharp.Parser.Parser(native.ToPointer(), skipVTables);
}
internal static global::CppSharp.Parser.Parser __CreateInstance(global::CppSharp.Parser.Parser.__Internal native, bool skipVTables = false)
{
return new global::CppSharp.Parser.Parser(native, skipVTables);
}
private static void* __CopyValue(global::CppSharp.Parser.Parser.__Internal native)
{
var ret = Marshal.AllocHGlobal(sizeof(global::CppSharp.Parser.Parser.__Internal));
*(global::CppSharp.Parser.Parser.__Internal*) ret = native;
return ret.ToPointer();
}
private Parser(global::CppSharp.Parser.Parser.__Internal native, bool skipVTables = false)
: this(__CopyValue(native), skipVTables)
{
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
}
protected Parser(void* native, bool skipVTables = false)
{
if (native == null)
return;
__Instance = new global::System.IntPtr(native);
}
}
public unsafe partial class CppParserOptions : IDisposable public unsafe partial class CppParserOptions : IDisposable
{ {
[StructLayout(LayoutKind.Explicit, Size = 320)] [StructLayout(LayoutKind.Explicit, Size = 320)]
@ -18818,7 +18771,7 @@ namespace CppSharp
public unsafe partial class ParserResult : IDisposable public unsafe partial class ParserResult : IDisposable
{ {
[StructLayout(LayoutKind.Explicit, Size = 56)] [StructLayout(LayoutKind.Explicit, Size = 48)]
public partial struct __Internal public partial struct __Internal
{ {
[FieldOffset(0)] [FieldOffset(0)]
@ -18833,9 +18786,6 @@ namespace CppSharp
[FieldOffset(40)] [FieldOffset(40)]
internal global::System.IntPtr library; internal global::System.IntPtr library;
[FieldOffset(48)]
internal global::System.IntPtr codeParser;
[SuppressUnmanagedCodeSecurity] [SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, [DllImport("CppSharp.CppParser", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZN8CppSharp9CppParser12ParserResultC2Ev")] EntryPoint="_ZN8CppSharp9CppParser12ParserResultC2Ev")]
@ -19017,24 +18967,6 @@ namespace CppSharp
} }
} }
public global::CppSharp.Parser.Parser CodeParser
{
get
{
global::CppSharp.Parser.Parser __result0;
if (((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->codeParser == IntPtr.Zero) __result0 = null;
else if (global::CppSharp.Parser.Parser.NativeToManagedMap.ContainsKey(((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->codeParser))
__result0 = (global::CppSharp.Parser.Parser) global::CppSharp.Parser.Parser.NativeToManagedMap[((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->codeParser];
else __result0 = global::CppSharp.Parser.Parser.__CreateInstance(((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->codeParser);
return __result0;
}
set
{
((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->codeParser = ReferenceEquals(value, null) ? global::System.IntPtr.Zero : value.__Instance;
}
}
public uint DiagnosticsCount public uint DiagnosticsCount
{ {
get get

70
src/CppParser/Bindings/CSharp/x86_64-linux-gnu/CppSharp.CppParser.cs

@ -17898,53 +17898,6 @@ namespace CppSharp
User = 4 User = 4
} }
public unsafe partial class Parser
{
[StructLayout(LayoutKind.Explicit, Size = 0)]
public partial struct __Internal
{
}
public global::System.IntPtr __Instance { get; protected set; }
protected int __PointerAdjustment;
internal static readonly global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::CppSharp.Parser.Parser> NativeToManagedMap = new global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::CppSharp.Parser.Parser>();
protected void*[] __OriginalVTables;
protected bool __ownsNativeInstance;
internal static global::CppSharp.Parser.Parser __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
{
return new global::CppSharp.Parser.Parser(native.ToPointer(), skipVTables);
}
internal static global::CppSharp.Parser.Parser __CreateInstance(global::CppSharp.Parser.Parser.__Internal native, bool skipVTables = false)
{
return new global::CppSharp.Parser.Parser(native, skipVTables);
}
private static void* __CopyValue(global::CppSharp.Parser.Parser.__Internal native)
{
var ret = Marshal.AllocHGlobal(sizeof(global::CppSharp.Parser.Parser.__Internal));
*(global::CppSharp.Parser.Parser.__Internal*) ret = native;
return ret.ToPointer();
}
private Parser(global::CppSharp.Parser.Parser.__Internal native, bool skipVTables = false)
: this(__CopyValue(native), skipVTables)
{
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
}
protected Parser(void* native, bool skipVTables = false)
{
if (native == null)
return;
__Instance = new global::System.IntPtr(native);
}
}
public unsafe partial class CppParserOptions : IDisposable public unsafe partial class CppParserOptions : IDisposable
{ {
[StructLayout(LayoutKind.Explicit, Size = 248)] [StructLayout(LayoutKind.Explicit, Size = 248)]
@ -18818,7 +18771,7 @@ namespace CppSharp
public unsafe partial class ParserResult : IDisposable public unsafe partial class ParserResult : IDisposable
{ {
[StructLayout(LayoutKind.Explicit, Size = 56)] [StructLayout(LayoutKind.Explicit, Size = 48)]
public partial struct __Internal public partial struct __Internal
{ {
[FieldOffset(0)] [FieldOffset(0)]
@ -18833,9 +18786,6 @@ namespace CppSharp
[FieldOffset(40)] [FieldOffset(40)]
internal global::System.IntPtr library; internal global::System.IntPtr library;
[FieldOffset(48)]
internal global::System.IntPtr codeParser;
[SuppressUnmanagedCodeSecurity] [SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, [DllImport("CppSharp.CppParser", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZN8CppSharp9CppParser12ParserResultC2Ev")] EntryPoint="_ZN8CppSharp9CppParser12ParserResultC2Ev")]
@ -19017,24 +18967,6 @@ namespace CppSharp
} }
} }
public global::CppSharp.Parser.Parser CodeParser
{
get
{
global::CppSharp.Parser.Parser __result0;
if (((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->codeParser == IntPtr.Zero) __result0 = null;
else if (global::CppSharp.Parser.Parser.NativeToManagedMap.ContainsKey(((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->codeParser))
__result0 = (global::CppSharp.Parser.Parser) global::CppSharp.Parser.Parser.NativeToManagedMap[((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->codeParser];
else __result0 = global::CppSharp.Parser.Parser.__CreateInstance(((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->codeParser);
return __result0;
}
set
{
((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->codeParser = ReferenceEquals(value, null) ? global::System.IntPtr.Zero : value.__Instance;
}
}
public uint DiagnosticsCount public uint DiagnosticsCount
{ {
get get

70
src/CppParser/Bindings/CSharp/x86_64-pc-win32-msvc/CppSharp.CppParser.cs

@ -17899,53 +17899,6 @@ namespace CppSharp
User = 4 User = 4
} }
public unsafe partial class Parser
{
[StructLayout(LayoutKind.Explicit, Size = 0)]
public partial struct __Internal
{
}
public global::System.IntPtr __Instance { get; protected set; }
protected int __PointerAdjustment;
internal static readonly global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::CppSharp.Parser.Parser> NativeToManagedMap = new global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::CppSharp.Parser.Parser>();
protected void*[] __OriginalVTables;
protected bool __ownsNativeInstance;
internal static global::CppSharp.Parser.Parser __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
{
return new global::CppSharp.Parser.Parser(native.ToPointer(), skipVTables);
}
internal static global::CppSharp.Parser.Parser __CreateInstance(global::CppSharp.Parser.Parser.__Internal native, bool skipVTables = false)
{
return new global::CppSharp.Parser.Parser(native, skipVTables);
}
private static void* __CopyValue(global::CppSharp.Parser.Parser.__Internal native)
{
var ret = Marshal.AllocHGlobal(sizeof(global::CppSharp.Parser.Parser.__Internal));
*(global::CppSharp.Parser.Parser.__Internal*) ret = native;
return ret.ToPointer();
}
private Parser(global::CppSharp.Parser.Parser.__Internal native, bool skipVTables = false)
: this(__CopyValue(native), skipVTables)
{
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
}
protected Parser(void* native, bool skipVTables = false)
{
if (native == null)
return;
__Instance = new global::System.IntPtr(native);
}
}
public unsafe partial class CppParserOptions : IDisposable public unsafe partial class CppParserOptions : IDisposable
{ {
[StructLayout(LayoutKind.Explicit, Size = 320)] [StructLayout(LayoutKind.Explicit, Size = 320)]
@ -18819,7 +18772,7 @@ namespace CppSharp
public unsafe partial class ParserResult : IDisposable public unsafe partial class ParserResult : IDisposable
{ {
[StructLayout(LayoutKind.Explicit, Size = 56)] [StructLayout(LayoutKind.Explicit, Size = 48)]
public partial struct __Internal public partial struct __Internal
{ {
[FieldOffset(0)] [FieldOffset(0)]
@ -18834,9 +18787,6 @@ namespace CppSharp
[FieldOffset(40)] [FieldOffset(40)]
internal global::System.IntPtr library; internal global::System.IntPtr library;
[FieldOffset(48)]
internal global::System.IntPtr codeParser;
[SuppressUnmanagedCodeSecurity] [SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="??0ParserResult@CppParser@CppSharp@@QEAA@XZ")] EntryPoint="??0ParserResult@CppParser@CppSharp@@QEAA@XZ")]
@ -19018,24 +18968,6 @@ namespace CppSharp
} }
} }
public global::CppSharp.Parser.Parser CodeParser
{
get
{
global::CppSharp.Parser.Parser __result0;
if (((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->codeParser == IntPtr.Zero) __result0 = null;
else if (global::CppSharp.Parser.Parser.NativeToManagedMap.ContainsKey(((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->codeParser))
__result0 = (global::CppSharp.Parser.Parser) global::CppSharp.Parser.Parser.NativeToManagedMap[((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->codeParser];
else __result0 = global::CppSharp.Parser.Parser.__CreateInstance(((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->codeParser);
return __result0;
}
set
{
((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->codeParser = ReferenceEquals(value, null) ? global::System.IntPtr.Zero : value.__Instance;
}
}
public uint DiagnosticsCount public uint DiagnosticsCount
{ {
get get

3
src/CppParser/CppParser.cpp

@ -36,7 +36,6 @@ DEF_VECTOR_STRING(CppParserOptions, SupportedStdTypes)
ParserResult::ParserResult() ParserResult::ParserResult()
: ASTContext(0) : ASTContext(0)
, library(0) , library(0)
, codeParser(0)
{ {
} }
@ -45,12 +44,10 @@ ParserResult::ParserResult(const ParserResult& rhs)
, Diagnostics(rhs.Diagnostics) , Diagnostics(rhs.Diagnostics)
, ASTContext(rhs.ASTContext) , ASTContext(rhs.ASTContext)
, library(rhs.library) , library(rhs.library)
, codeParser(rhs.codeParser)
{} {}
ParserResult::~ParserResult() ParserResult::~ParserResult()
{ {
delete codeParser;
} }
ParserDiagnostic::ParserDiagnostic() {} ParserDiagnostic::ParserDiagnostic() {}

3
src/CppParser/CppParser.h

@ -75,8 +75,6 @@ enum class ParserResultKind
FileNotFound FileNotFound
}; };
class Parser;
struct CS_API ParserResult struct CS_API ParserResult
{ {
ParserResult(); ParserResult();
@ -88,7 +86,6 @@ struct CS_API ParserResult
CppSharp::CppParser::AST::ASTContext* ASTContext; CppSharp::CppParser::AST::ASTContext* ASTContext;
NativeLibrary* library; NativeLibrary* library;
Parser* codeParser;
}; };
enum class SourceLocationKind enum class SourceLocationKind

16
src/CppParser/Parser.cpp

@ -3958,10 +3958,11 @@ void Parser::HandleDiagnostics(ParserResult* res)
} }
} }
ParserResult* Parser::ParseHeader(const std::vector<std::string>& SourceFiles, ParserResult* res) ParserResult* Parser::ParseHeader(const std::vector<std::string>& SourceFiles)
{ {
assert(opts->ASTContext && "Expected a valid ASTContext"); assert(opts->ASTContext && "Expected a valid ASTContext");
auto res = new ParserResult();
res->ASTContext = lib; res->ASTContext = lib;
if (SourceFiles.empty()) if (SourceFiles.empty())
@ -4214,8 +4215,9 @@ ParserResultKind Parser::ReadSymbols(llvm::StringRef File,
return ParserResultKind::Success; return ParserResultKind::Success;
} }
ParserResult* Parser::ParseLibrary(const std::string& File, ParserResult* res) ParserResult* Parser::ParseLibrary(const std::string& File)
{ {
auto res = new ParserResult();
if (File.empty()) if (File.empty())
{ {
res->kind = ParserResultKind::FileNotFound; res->kind = ParserResultKind::FileNotFound;
@ -4268,9 +4270,8 @@ ParserResult* ClangParser::ParseHeader(CppParserOptions* Opts)
if (!Opts) if (!Opts)
return nullptr; return nullptr;
auto res = new ParserResult(); Parser Parser(Opts);
res->codeParser = new Parser(Opts); return Parser.ParseHeader(Opts->SourceFiles);
return res->codeParser->ParseHeader(Opts->SourceFiles, res);
} }
ParserResult* ClangParser::ParseLibrary(CppParserOptions* Opts) ParserResult* ClangParser::ParseLibrary(CppParserOptions* Opts)
@ -4278,9 +4279,8 @@ ParserResult* ClangParser::ParseLibrary(CppParserOptions* Opts)
if (!Opts) if (!Opts)
return nullptr; return nullptr;
auto res = new ParserResult(); Parser Parser(Opts);
res->codeParser = new Parser(Opts); return Parser.ParseLibrary(Opts->libraryFile);
return res->codeParser->ParseLibrary(Opts->libraryFile, res);
} }
ParserTargetInfo* ClangParser::GetTargetInfo(CppParserOptions* Opts) ParserTargetInfo* ClangParser::GetTargetInfo(CppParserOptions* Opts)

4
src/CppParser/Parser.h

@ -49,8 +49,8 @@ public:
Parser(CppParserOptions* Opts); Parser(CppParserOptions* Opts);
void Setup(); void Setup();
ParserResult* ParseHeader(const std::vector<std::string>& SourceFiles, ParserResult* res); ParserResult* ParseHeader(const std::vector<std::string>& SourceFiles);
ParserResult* ParseLibrary(const std::string& File, ParserResult* res); ParserResult* ParseLibrary(const std::string& File);
ParserResultKind ParseArchive(llvm::StringRef File, ParserResultKind ParseArchive(llvm::StringRef File,
llvm::object::Archive* Archive, llvm::object::Archive* Archive,
CppSharp::CppParser::NativeLibrary*& NativeLib); CppSharp::CppParser::NativeLibrary*& NativeLib);

Loading…
Cancel
Save