Browse Source

Revert "Removed an unused field and redundant parameters from the parser."

This reverts commit 51a109d2db.

# Conflicts:
#	src/CppParser/CppParser.cpp
#	src/CppParser/CppParser.h
#	src/CppParser/Parser.cpp
#	src/CppParser/Parser.h

Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
pull/1005/head
Dimitar Dobrev 8 years ago
parent
commit
450a26a443
  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. 4
      src/CppParser/CppParser.cpp
  9. 3
      src/CppParser/CppParser.h
  10. 5
      src/CppParser/Parser.cpp

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

@ -18,6 +18,7 @@ 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,6 +17899,53 @@ 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 = 148)] [StructLayout(LayoutKind.Explicit, Size = 148)]
@ -18751,7 +18798,7 @@ namespace CppSharp
public unsafe partial class ParserResult : IDisposable public unsafe partial class ParserResult : IDisposable
{ {
[StructLayout(LayoutKind.Explicit, Size = 24)] [StructLayout(LayoutKind.Explicit, Size = 28)]
public partial struct __Internal public partial struct __Internal
{ {
[FieldOffset(0)] [FieldOffset(0)]
@ -18766,6 +18813,9 @@ namespace CppSharp
[FieldOffset(20)] [FieldOffset(20)]
internal global::System.IntPtr targetInfo; internal global::System.IntPtr targetInfo;
[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")]
@ -18947,6 +18997,24 @@ 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,6 +17899,53 @@ 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 = 184)] [StructLayout(LayoutKind.Explicit, Size = 184)]
@ -18751,7 +18798,7 @@ namespace CppSharp
public unsafe partial class ParserResult : IDisposable public unsafe partial class ParserResult : IDisposable
{ {
[StructLayout(LayoutKind.Explicit, Size = 24)] [StructLayout(LayoutKind.Explicit, Size = 28)]
public partial struct __Internal public partial struct __Internal
{ {
[FieldOffset(0)] [FieldOffset(0)]
@ -18766,6 +18813,9 @@ namespace CppSharp
[FieldOffset(20)] [FieldOffset(20)]
internal global::System.IntPtr targetInfo; internal global::System.IntPtr targetInfo;
[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")]
@ -18947,6 +18997,24 @@ 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,6 +17898,53 @@ 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 = 288)] [StructLayout(LayoutKind.Explicit, Size = 288)]
@ -18750,7 +18797,7 @@ namespace CppSharp
public unsafe partial class ParserResult : IDisposable public unsafe partial class ParserResult : IDisposable
{ {
[StructLayout(LayoutKind.Explicit, Size = 48)] [StructLayout(LayoutKind.Explicit, Size = 56)]
public partial struct __Internal public partial struct __Internal
{ {
[FieldOffset(0)] [FieldOffset(0)]
@ -18765,6 +18812,9 @@ namespace CppSharp
[FieldOffset(40)] [FieldOffset(40)]
internal global::System.IntPtr targetInfo; internal global::System.IntPtr targetInfo;
[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")]
@ -18946,6 +18996,24 @@ 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,6 +17898,53 @@ 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 = 312)] [StructLayout(LayoutKind.Explicit, Size = 312)]
@ -18750,7 +18797,7 @@ namespace CppSharp
public unsafe partial class ParserResult : IDisposable public unsafe partial class ParserResult : IDisposable
{ {
[StructLayout(LayoutKind.Explicit, Size = 48)] [StructLayout(LayoutKind.Explicit, Size = 56)]
public partial struct __Internal public partial struct __Internal
{ {
[FieldOffset(0)] [FieldOffset(0)]
@ -18765,6 +18812,9 @@ namespace CppSharp
[FieldOffset(40)] [FieldOffset(40)]
internal global::System.IntPtr targetInfo; internal global::System.IntPtr targetInfo;
[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")]
@ -18946,6 +18996,24 @@ 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,6 +17898,53 @@ 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 = 240)] [StructLayout(LayoutKind.Explicit, Size = 240)]
@ -18750,7 +18797,7 @@ namespace CppSharp
public unsafe partial class ParserResult : IDisposable public unsafe partial class ParserResult : IDisposable
{ {
[StructLayout(LayoutKind.Explicit, Size = 48)] [StructLayout(LayoutKind.Explicit, Size = 56)]
public partial struct __Internal public partial struct __Internal
{ {
[FieldOffset(0)] [FieldOffset(0)]
@ -18765,6 +18812,9 @@ namespace CppSharp
[FieldOffset(40)] [FieldOffset(40)]
internal global::System.IntPtr targetInfo; internal global::System.IntPtr targetInfo;
[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")]
@ -18946,6 +18996,24 @@ 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,6 +17899,53 @@ 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 = 312)] [StructLayout(LayoutKind.Explicit, Size = 312)]
@ -18751,7 +18798,7 @@ namespace CppSharp
public unsafe partial class ParserResult : IDisposable public unsafe partial class ParserResult : IDisposable
{ {
[StructLayout(LayoutKind.Explicit, Size = 48)] [StructLayout(LayoutKind.Explicit, Size = 56)]
public partial struct __Internal public partial struct __Internal
{ {
[FieldOffset(0)] [FieldOffset(0)]
@ -18766,6 +18813,9 @@ namespace CppSharp
[FieldOffset(40)] [FieldOffset(40)]
internal global::System.IntPtr targetInfo; internal global::System.IntPtr targetInfo;
[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")]
@ -18947,6 +18997,24 @@ 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

4
src/CppParser/CppParser.cpp

@ -35,6 +35,7 @@ DEF_VECTOR_STRING(CppParserOptions, SupportedStdTypes)
ParserResult::ParserResult() ParserResult::ParserResult()
: library(0) : library(0)
, targetInfo(0) , targetInfo(0)
, codeParser(0)
{ {
} }
@ -43,10 +44,13 @@ ParserResult::ParserResult(const ParserResult& rhs)
, Diagnostics(rhs.Diagnostics) , Diagnostics(rhs.Diagnostics)
, library(rhs.library) , library(rhs.library)
, targetInfo(rhs.targetInfo) , targetInfo(rhs.targetInfo)
, codeParser(rhs.codeParser)
{} {}
ParserResult::~ParserResult() ParserResult::~ParserResult()
{ {
if (codeParser)
delete codeParser;
if (library) if (library)
delete library; delete library;
} }

3
src/CppParser/CppParser.h

@ -73,6 +73,8 @@ enum class ParserResultKind
FileNotFound FileNotFound
}; };
class Parser;
struct CS_API ParserResult struct CS_API ParserResult
{ {
ParserResult(); ParserResult();
@ -84,6 +86,7 @@ struct CS_API ParserResult
NativeLibrary* library; NativeLibrary* library;
ParserTargetInfo* targetInfo; ParserTargetInfo* targetInfo;
Parser* codeParser;
}; };
enum class SourceLocationKind enum class SourceLocationKind

5
src/CppParser/Parser.cpp

@ -4274,8 +4274,9 @@ ParserResult* ClangParser::ParseHeader(CppParserOptions* Opts)
if (!Opts) if (!Opts)
return nullptr; return nullptr;
Parser Parser(Opts); auto res = new ParserResult();
return Parser.ParseHeader(Opts->SourceFiles); res->codeParser = new Parser(Opts);
return res->codeParser->ParseHeader(Opts->SourceFiles);
} }
ParserResult* ClangParser::ParseLibrary(CppParserOptions* Opts) ParserResult* ClangParser::ParseLibrary(CppParserOptions* Opts)

Loading…
Cancel
Save