Skip to content

Commit e965803

Browse files
committed
Optimised the parser by skipping the system translation units.
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
1 parent 5bce2fb commit e965803

File tree

8 files changed

+323
-608
lines changed

8 files changed

+323
-608
lines changed

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

Lines changed: 78 additions & 140 deletions
Original file line numberDiff line numberDiff line change
@@ -35,30 +35,20 @@ namespace Std
3535

3636
namespace Std
3737
{
38-
}
39-
40-
namespace Std
41-
{
42-
}
43-
44-
namespace Std
45-
{
46-
}
47-
48-
namespace Std
49-
{
50-
}
51-
52-
namespace Std
53-
{
54-
}
38+
namespace CompressedPair
39+
{
40+
[StructLayout(LayoutKind.Explicit, Size = 12)]
41+
public unsafe partial struct __Internal
42+
{
43+
[FieldOffset(0)]
44+
internal global::Std.BasicString.Rep.__Internal __first_;
45+
}
46+
}
5547

56-
namespace Std
57-
{
58-
}
48+
public unsafe partial class CompressedPair<_T1, _T2>
49+
{
50+
}
5951

60-
namespace Std
61-
{
6252
namespace Allocator
6353
{
6454
[StructLayout(LayoutKind.Explicit, Size = 0)]
@@ -142,36 +132,6 @@ public virtual void Dispose(bool disposing)
142132
__Instance = IntPtr.Zero;
143133
}
144134
}
145-
146-
namespace CompressedPair
147-
{
148-
[StructLayout(LayoutKind.Explicit, Size = 12)]
149-
public unsafe partial struct __Internal
150-
{
151-
[FieldOffset(0)]
152-
internal global::Std.BasicString.Rep.__Internal __first_;
153-
}
154-
}
155-
156-
public unsafe partial class CompressedPair<_T1, _T2>
157-
{
158-
}
159-
}
160-
161-
namespace Std
162-
{
163-
}
164-
165-
namespace Std
166-
{
167-
}
168-
169-
namespace Std
170-
{
171-
}
172-
173-
namespace Std
174-
{
175135
}
176136

177137
namespace Std
@@ -234,10 +194,6 @@ public unsafe partial class TreeEndNode<_Pointer>
234194
}
235195
}
236196

237-
namespace Std
238-
{
239-
}
240-
241197
namespace Std
242198
{
243199
namespace Map
@@ -257,76 +213,6 @@ public unsafe partial class Map<_Key, _Tp, _Compare, _Allocator>
257213

258214
namespace Std
259215
{
260-
}
261-
262-
namespace Std
263-
{
264-
namespace CharTraits
265-
{
266-
[StructLayout(LayoutKind.Explicit, Size = 0)]
267-
public unsafe partial struct __Internal
268-
{
269-
}
270-
}
271-
272-
public unsafe partial class CharTraits<_CharT> : IDisposable
273-
{
274-
public global::System.IntPtr __Instance { get; protected set; }
275-
276-
protected int __PointerAdjustment;
277-
internal static readonly global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.CharTraits<_CharT>> NativeToManagedMap = new global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.CharTraits<_CharT>>();
278-
protected void*[] __OriginalVTables;
279-
280-
protected bool __ownsNativeInstance;
281-
282-
internal static global::Std.CharTraits<_CharT> __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
283-
{
284-
return new global::Std.CharTraits<_CharT>(native.ToPointer(), skipVTables);
285-
}
286-
287-
internal static global::Std.CharTraits<_CharT> __CreateInstance(global::Std.CharTraits.__Internal native, bool skipVTables = false)
288-
{
289-
return new global::Std.CharTraits<_CharT>(native, skipVTables);
290-
}
291-
292-
private static void* __CopyValue(global::Std.CharTraits.__Internal native)
293-
{
294-
var ret = Marshal.AllocHGlobal(sizeof(global::Std.CharTraits.__Internal));
295-
*(global::Std.CharTraits.__Internal*) ret = native;
296-
return ret.ToPointer();
297-
}
298-
299-
private CharTraits(global::Std.CharTraits.__Internal native, bool skipVTables = false)
300-
: this(__CopyValue(native), skipVTables)
301-
{
302-
__ownsNativeInstance = true;
303-
NativeToManagedMap[__Instance] = this;
304-
}
305-
306-
protected CharTraits(void* native, bool skipVTables = false)
307-
{
308-
if (native == null)
309-
return;
310-
__Instance = new global::System.IntPtr(native);
311-
}
312-
313-
public void Dispose()
314-
{
315-
Dispose(disposing: true);
316-
}
317-
318-
public virtual void Dispose(bool disposing)
319-
{
320-
if (__Instance == IntPtr.Zero)
321-
return;
322-
global::Std.CharTraits<_CharT> __dummy;
323-
NativeToManagedMap.TryRemove(__Instance, out __dummy);
324-
if (__ownsNativeInstance)
325-
Marshal.FreeHGlobal(__Instance);
326-
__Instance = IntPtr.Zero;
327-
}
328-
}
329-
330216
public unsafe static partial class BasicStringExtensions
331217
{
332218
[StructLayout(LayoutKind.Explicit, Size = 0)]
@@ -467,20 +353,6 @@ public partial struct __Internal
467353
[FieldOffset(0)]
468354
internal fixed uint __words[3];
469355
}
470-
471-
}
472-
473-
public unsafe partial struct Ulx
474-
{
475-
[StructLayout(LayoutKind.Explicit, Size = 12)]
476-
public partial struct __Internal
477-
{
478-
[FieldOffset(0)]
479-
internal global::Std.BasicString.Long.__Internal __lx;
480-
481-
[FieldOffset(0)]
482-
internal global::Std.BasicString.Short.__Internal __lxx;
483-
}
484356
}
485357
}
486358

@@ -553,4 +425,70 @@ public virtual void Dispose(bool disposing)
553425
__Instance = IntPtr.Zero;
554426
}
555427
}
428+
429+
namespace CharTraits
430+
{
431+
[StructLayout(LayoutKind.Explicit, Size = 0)]
432+
public unsafe partial struct __Internal
433+
{
434+
}
435+
}
436+
437+
public unsafe partial class CharTraits<_CharT> : IDisposable
438+
{
439+
public global::System.IntPtr __Instance { get; protected set; }
440+
441+
protected int __PointerAdjustment;
442+
internal static readonly global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.CharTraits<_CharT>> NativeToManagedMap = new global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::Std.CharTraits<_CharT>>();
443+
protected void*[] __OriginalVTables;
444+
445+
protected bool __ownsNativeInstance;
446+
447+
internal static global::Std.CharTraits<_CharT> __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
448+
{
449+
return new global::Std.CharTraits<_CharT>(native.ToPointer(), skipVTables);
450+
}
451+
452+
internal static global::Std.CharTraits<_CharT> __CreateInstance(global::Std.CharTraits.__Internal native, bool skipVTables = false)
453+
{
454+
return new global::Std.CharTraits<_CharT>(native, skipVTables);
455+
}
456+
457+
private static void* __CopyValue(global::Std.CharTraits.__Internal native)
458+
{
459+
var ret = Marshal.AllocHGlobal(sizeof(global::Std.CharTraits.__Internal));
460+
*(global::Std.CharTraits.__Internal*) ret = native;
461+
return ret.ToPointer();
462+
}
463+
464+
private CharTraits(global::Std.CharTraits.__Internal native, bool skipVTables = false)
465+
: this(__CopyValue(native), skipVTables)
466+
{
467+
__ownsNativeInstance = true;
468+
NativeToManagedMap[__Instance] = this;
469+
}
470+
471+
protected CharTraits(void* native, bool skipVTables = false)
472+
{
473+
if (native == null)
474+
return;
475+
__Instance = new global::System.IntPtr(native);
476+
}
477+
478+
public void Dispose()
479+
{
480+
Dispose(disposing: true);
481+
}
482+
483+
public virtual void Dispose(bool disposing)
484+
{
485+
if (__Instance == IntPtr.Zero)
486+
return;
487+
global::Std.CharTraits<_CharT> __dummy;
488+
NativeToManagedMap.TryRemove(__Instance, out __dummy);
489+
if (__ownsNativeInstance)
490+
Marshal.FreeHGlobal(__Instance);
491+
__Instance = IntPtr.Zero;
492+
}
493+
}
556494
}

0 commit comments

Comments
 (0)