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 @@ -18,7 +18,6 @@ namespace CppSharp
enum struct SourceLocationKind;
ref class ClangParser;
ref class CppParserOptions;
ref class Parser;
ref class ParserDiagnostic;
ref class ParserResult;
ref class ParserTargetInfo;

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

@ -17899,53 +17899,6 @@ namespace CppSharp @@ -17899,53 +17899,6 @@ namespace CppSharp
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
{
[StructLayout(LayoutKind.Explicit, Size = 152)]
@ -18819,7 +18772,7 @@ namespace CppSharp @@ -18819,7 +18772,7 @@ namespace CppSharp
public unsafe partial class ParserResult : IDisposable
{
[StructLayout(LayoutKind.Explicit, Size = 28)]
[StructLayout(LayoutKind.Explicit, Size = 24)]
public partial struct __Internal
{
[FieldOffset(0)]
@ -18834,9 +18787,6 @@ namespace CppSharp @@ -18834,9 +18787,6 @@ namespace CppSharp
[FieldOffset(20)]
internal global::System.IntPtr library;
[FieldOffset(24)]
internal global::System.IntPtr codeParser;
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZN8CppSharp9CppParser12ParserResultC2Ev")]
@ -19018,24 +18968,6 @@ namespace CppSharp @@ -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
{
get

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

@ -17899,53 +17899,6 @@ namespace CppSharp @@ -17899,53 +17899,6 @@ namespace CppSharp
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
{
[StructLayout(LayoutKind.Explicit, Size = 188)]
@ -18819,7 +18772,7 @@ namespace CppSharp @@ -18819,7 +18772,7 @@ namespace CppSharp
public unsafe partial class ParserResult : IDisposable
{
[StructLayout(LayoutKind.Explicit, Size = 28)]
[StructLayout(LayoutKind.Explicit, Size = 24)]
public partial struct __Internal
{
[FieldOffset(0)]
@ -18834,9 +18787,6 @@ namespace CppSharp @@ -18834,9 +18787,6 @@ namespace CppSharp
[FieldOffset(20)]
internal global::System.IntPtr library;
[FieldOffset(24)]
internal global::System.IntPtr codeParser;
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall,
EntryPoint="??0ParserResult@CppParser@CppSharp@@QAE@XZ")]
@ -19018,24 +18968,6 @@ namespace CppSharp @@ -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
{
get

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

@ -17898,53 +17898,6 @@ namespace CppSharp @@ -17898,53 +17898,6 @@ namespace CppSharp
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
{
[StructLayout(LayoutKind.Explicit, Size = 296)]
@ -18818,7 +18771,7 @@ namespace CppSharp @@ -18818,7 +18771,7 @@ namespace CppSharp
public unsafe partial class ParserResult : IDisposable
{
[StructLayout(LayoutKind.Explicit, Size = 56)]
[StructLayout(LayoutKind.Explicit, Size = 48)]
public partial struct __Internal
{
[FieldOffset(0)]
@ -18833,9 +18786,6 @@ namespace CppSharp @@ -18833,9 +18786,6 @@ namespace CppSharp
[FieldOffset(40)]
internal global::System.IntPtr library;
[FieldOffset(48)]
internal global::System.IntPtr codeParser;
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZN8CppSharp9CppParser12ParserResultC2Ev")]
@ -19017,24 +18967,6 @@ namespace CppSharp @@ -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
{
get

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

@ -17898,53 +17898,6 @@ namespace CppSharp @@ -17898,53 +17898,6 @@ namespace CppSharp
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
{
[StructLayout(LayoutKind.Explicit, Size = 320)]
@ -18818,7 +18771,7 @@ namespace CppSharp @@ -18818,7 +18771,7 @@ namespace CppSharp
public unsafe partial class ParserResult : IDisposable
{
[StructLayout(LayoutKind.Explicit, Size = 56)]
[StructLayout(LayoutKind.Explicit, Size = 48)]
public partial struct __Internal
{
[FieldOffset(0)]
@ -18833,9 +18786,6 @@ namespace CppSharp @@ -18833,9 +18786,6 @@ namespace CppSharp
[FieldOffset(40)]
internal global::System.IntPtr library;
[FieldOffset(48)]
internal global::System.IntPtr codeParser;
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZN8CppSharp9CppParser12ParserResultC2Ev")]
@ -19017,24 +18967,6 @@ namespace CppSharp @@ -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
{
get

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

@ -17898,53 +17898,6 @@ namespace CppSharp @@ -17898,53 +17898,6 @@ namespace CppSharp
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
{
[StructLayout(LayoutKind.Explicit, Size = 248)]
@ -18818,7 +18771,7 @@ namespace CppSharp @@ -18818,7 +18771,7 @@ namespace CppSharp
public unsafe partial class ParserResult : IDisposable
{
[StructLayout(LayoutKind.Explicit, Size = 56)]
[StructLayout(LayoutKind.Explicit, Size = 48)]
public partial struct __Internal
{
[FieldOffset(0)]
@ -18833,9 +18786,6 @@ namespace CppSharp @@ -18833,9 +18786,6 @@ namespace CppSharp
[FieldOffset(40)]
internal global::System.IntPtr library;
[FieldOffset(48)]
internal global::System.IntPtr codeParser;
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZN8CppSharp9CppParser12ParserResultC2Ev")]
@ -19017,24 +18967,6 @@ namespace CppSharp @@ -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
{
get

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

@ -17899,53 +17899,6 @@ namespace CppSharp @@ -17899,53 +17899,6 @@ namespace CppSharp
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
{
[StructLayout(LayoutKind.Explicit, Size = 320)]
@ -18819,7 +18772,7 @@ namespace CppSharp @@ -18819,7 +18772,7 @@ namespace CppSharp
public unsafe partial class ParserResult : IDisposable
{
[StructLayout(LayoutKind.Explicit, Size = 56)]
[StructLayout(LayoutKind.Explicit, Size = 48)]
public partial struct __Internal
{
[FieldOffset(0)]
@ -18834,9 +18787,6 @@ namespace CppSharp @@ -18834,9 +18787,6 @@ namespace CppSharp
[FieldOffset(40)]
internal global::System.IntPtr library;
[FieldOffset(48)]
internal global::System.IntPtr codeParser;
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="??0ParserResult@CppParser@CppSharp@@QEAA@XZ")]
@ -19018,24 +18968,6 @@ namespace CppSharp @@ -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
{
get

3
src/CppParser/CppParser.cpp

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

3
src/CppParser/CppParser.h

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

16
src/CppParser/Parser.cpp

@ -3958,10 +3958,11 @@ void Parser::HandleDiagnostics(ParserResult* res) @@ -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");
auto res = new ParserResult();
res->ASTContext = lib;
if (SourceFiles.empty())
@ -4214,8 +4215,9 @@ ParserResultKind Parser::ReadSymbols(llvm::StringRef File, @@ -4214,8 +4215,9 @@ ParserResultKind Parser::ReadSymbols(llvm::StringRef File,
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())
{
res->kind = ParserResultKind::FileNotFound;
@ -4268,9 +4270,8 @@ ParserResult* ClangParser::ParseHeader(CppParserOptions* Opts) @@ -4268,9 +4270,8 @@ ParserResult* ClangParser::ParseHeader(CppParserOptions* Opts)
if (!Opts)
return nullptr;
auto res = new ParserResult();
res->codeParser = new Parser(Opts);
return res->codeParser->ParseHeader(Opts->SourceFiles, res);
Parser Parser(Opts);
return Parser.ParseHeader(Opts->SourceFiles);
}
ParserResult* ClangParser::ParseLibrary(CppParserOptions* Opts)
@ -4278,9 +4279,8 @@ ParserResult* ClangParser::ParseLibrary(CppParserOptions* Opts) @@ -4278,9 +4279,8 @@ ParserResult* ClangParser::ParseLibrary(CppParserOptions* Opts)
if (!Opts)
return nullptr;
auto res = new ParserResult();
res->codeParser = new Parser(Opts);
return res->codeParser->ParseLibrary(Opts->libraryFile, res);
Parser Parser(Opts);
return Parser.ParseLibrary(Opts->libraryFile);
}
ParserTargetInfo* ClangParser::GetTargetInfo(CppParserOptions* Opts)

4
src/CppParser/Parser.h

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

Loading…
Cancel
Save