Skip to content

Commit 28f42bb

Browse files
committed
Deleted useless fields from the parser.
Signed-off-by: Dimitar Dobrev <[email protected]>
1 parent 51a109d commit 28f42bb

File tree

13 files changed

+32
-179
lines changed

13 files changed

+32
-179
lines changed

src/CppParser/Bindings/CLI/CppParser.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -723,16 +723,6 @@ void CppSharp::Parser::ParserResult::Diagnostics::set(System::Collections::Gener
723723
((::CppSharp::CppParser::ParserResult*)NativePtr)->Diagnostics = _tmpvalue;
724724
}
725725

726-
CppSharp::Parser::AST::ASTContext^ CppSharp::Parser::ParserResult::ASTContext::get()
727-
{
728-
return (((::CppSharp::CppParser::ParserResult*)NativePtr)->ASTContext == nullptr) ? nullptr : gcnew CppSharp::Parser::AST::ASTContext((::CppSharp::CppParser::AST::ASTContext*)((::CppSharp::CppParser::ParserResult*)NativePtr)->ASTContext);
729-
}
730-
731-
void CppSharp::Parser::ParserResult::ASTContext::set(CppSharp::Parser::AST::ASTContext^ value)
732-
{
733-
((::CppSharp::CppParser::ParserResult*)NativePtr)->ASTContext = (::CppSharp::CppParser::AST::ASTContext*)value->NativePtr;
734-
}
735-
736726
CppSharp::Parser::AST::NativeLibrary^ CppSharp::Parser::ParserResult::Library::get()
737727
{
738728
return (((::CppSharp::CppParser::ParserResult*)NativePtr)->library == nullptr) ? nullptr : gcnew CppSharp::Parser::AST::NativeLibrary((::CppSharp::CppParser::AST::NativeLibrary*)((::CppSharp::CppParser::ParserResult*)NativePtr)->library);

src/CppParser/Bindings/CLI/CppParser.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -368,12 +368,6 @@ namespace CppSharp
368368
void set(System::Collections::Generic::List<CppSharp::Parser::ParserDiagnostic^>^);
369369
}
370370

371-
property CppSharp::Parser::AST::ASTContext^ ASTContext
372-
{
373-
CppSharp::Parser::AST::ASTContext^ get();
374-
void set(CppSharp::Parser::AST::ASTContext^);
375-
}
376-
377371
property CppSharp::Parser::AST::NativeLibrary^ Library
378372
{
379373
CppSharp::Parser::AST::NativeLibrary^ get();

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

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18772,7 +18772,7 @@ public int ColumnNumber
1877218772

1877318773
public unsafe partial class ParserResult : IDisposable
1877418774
{
18775-
[StructLayout(LayoutKind.Explicit, Size = 24)]
18775+
[StructLayout(LayoutKind.Explicit, Size = 20)]
1877618776
public partial struct __Internal
1877718777
{
1877818778
[FieldOffset(0)]
@@ -18782,9 +18782,6 @@ public partial struct __Internal
1878218782
internal global::Std.Vector.__Internalc__N_std_N___1_S_vector____N_CppSharp_N_CppParser_S_ParserDiagnostic___N_std_N___1_S_allocator__S0_ Diagnostics;
1878318783

1878418784
[FieldOffset(16)]
18785-
internal global::System.IntPtr ASTContext;
18786-
18787-
[FieldOffset(20)]
1878818785
internal global::System.IntPtr library;
1878918786

1879018787
[SuppressUnmanagedCodeSecurity]
@@ -18932,24 +18929,6 @@ public void ClearDiagnostics()
1893218929
}
1893318930
}
1893418931

18935-
public global::CppSharp.Parser.AST.ASTContext ASTContext
18936-
{
18937-
get
18938-
{
18939-
global::CppSharp.Parser.AST.ASTContext __result0;
18940-
if (((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->ASTContext == IntPtr.Zero) __result0 = null;
18941-
else if (global::CppSharp.Parser.AST.ASTContext.NativeToManagedMap.ContainsKey(((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->ASTContext))
18942-
__result0 = (global::CppSharp.Parser.AST.ASTContext) global::CppSharp.Parser.AST.ASTContext.NativeToManagedMap[((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->ASTContext];
18943-
else __result0 = global::CppSharp.Parser.AST.ASTContext.__CreateInstance(((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->ASTContext);
18944-
return __result0;
18945-
}
18946-
18947-
set
18948-
{
18949-
((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->ASTContext = ReferenceEquals(value, null) ? global::System.IntPtr.Zero : value.__Instance;
18950-
}
18951-
}
18952-
1895318932
public global::CppSharp.Parser.AST.NativeLibrary Library
1895418933
{
1895518934
get

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

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18772,7 +18772,7 @@ public int ColumnNumber
1877218772

1877318773
public unsafe partial class ParserResult : IDisposable
1877418774
{
18775-
[StructLayout(LayoutKind.Explicit, Size = 24)]
18775+
[StructLayout(LayoutKind.Explicit, Size = 20)]
1877618776
public partial struct __Internal
1877718777
{
1877818778
[FieldOffset(0)]
@@ -18782,9 +18782,6 @@ public partial struct __Internal
1878218782
internal global::Std.Vector.__Internalc__N_std_S_vector____N_CppSharp_N_CppParser_S_ParserDiagnostic___N_std_S_allocator__S0_ Diagnostics;
1878318783

1878418784
[FieldOffset(16)]
18785-
internal global::System.IntPtr ASTContext;
18786-
18787-
[FieldOffset(20)]
1878818785
internal global::System.IntPtr library;
1878918786

1879018787
[SuppressUnmanagedCodeSecurity]
@@ -18932,24 +18929,6 @@ public void ClearDiagnostics()
1893218929
}
1893318930
}
1893418931

18935-
public global::CppSharp.Parser.AST.ASTContext ASTContext
18936-
{
18937-
get
18938-
{
18939-
global::CppSharp.Parser.AST.ASTContext __result0;
18940-
if (((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->ASTContext == IntPtr.Zero) __result0 = null;
18941-
else if (global::CppSharp.Parser.AST.ASTContext.NativeToManagedMap.ContainsKey(((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->ASTContext))
18942-
__result0 = (global::CppSharp.Parser.AST.ASTContext) global::CppSharp.Parser.AST.ASTContext.NativeToManagedMap[((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->ASTContext];
18943-
else __result0 = global::CppSharp.Parser.AST.ASTContext.__CreateInstance(((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->ASTContext);
18944-
return __result0;
18945-
}
18946-
18947-
set
18948-
{
18949-
((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->ASTContext = ReferenceEquals(value, null) ? global::System.IntPtr.Zero : value.__Instance;
18950-
}
18951-
}
18952-
1895318932
public global::CppSharp.Parser.AST.NativeLibrary Library
1895418933
{
1895518934
get

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

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18771,7 +18771,7 @@ public int ColumnNumber
1877118771

1877218772
public unsafe partial class ParserResult : IDisposable
1877318773
{
18774-
[StructLayout(LayoutKind.Explicit, Size = 48)]
18774+
[StructLayout(LayoutKind.Explicit, Size = 40)]
1877518775
public partial struct __Internal
1877618776
{
1877718777
[FieldOffset(0)]
@@ -18781,9 +18781,6 @@ public partial struct __Internal
1878118781
internal global::Std.Vector.__Internalc__N_std_N___1_S_vector____N_CppSharp_N_CppParser_S_ParserDiagnostic___N_std_N___1_S_allocator__S0_ Diagnostics;
1878218782

1878318783
[FieldOffset(32)]
18784-
internal global::System.IntPtr ASTContext;
18785-
18786-
[FieldOffset(40)]
1878718784
internal global::System.IntPtr library;
1878818785

1878918786
[SuppressUnmanagedCodeSecurity]
@@ -18931,24 +18928,6 @@ public void ClearDiagnostics()
1893118928
}
1893218929
}
1893318930

18934-
public global::CppSharp.Parser.AST.ASTContext ASTContext
18935-
{
18936-
get
18937-
{
18938-
global::CppSharp.Parser.AST.ASTContext __result0;
18939-
if (((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->ASTContext == IntPtr.Zero) __result0 = null;
18940-
else if (global::CppSharp.Parser.AST.ASTContext.NativeToManagedMap.ContainsKey(((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->ASTContext))
18941-
__result0 = (global::CppSharp.Parser.AST.ASTContext) global::CppSharp.Parser.AST.ASTContext.NativeToManagedMap[((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->ASTContext];
18942-
else __result0 = global::CppSharp.Parser.AST.ASTContext.__CreateInstance(((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->ASTContext);
18943-
return __result0;
18944-
}
18945-
18946-
set
18947-
{
18948-
((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->ASTContext = ReferenceEquals(value, null) ? global::System.IntPtr.Zero : value.__Instance;
18949-
}
18950-
}
18951-
1895218931
public global::CppSharp.Parser.AST.NativeLibrary Library
1895318932
{
1895418933
get

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

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18771,7 +18771,7 @@ public int ColumnNumber
1877118771

1877218772
public unsafe partial class ParserResult : IDisposable
1877318773
{
18774-
[StructLayout(LayoutKind.Explicit, Size = 48)]
18774+
[StructLayout(LayoutKind.Explicit, Size = 40)]
1877518775
public partial struct __Internal
1877618776
{
1877718777
[FieldOffset(0)]
@@ -18781,9 +18781,6 @@ public partial struct __Internal
1878118781
internal global::Std.Vector.__Internalc__N_std_S_vector____N_CppSharp_N_CppParser_S_ParserDiagnostic___N_std_S_allocator__S0_ Diagnostics;
1878218782

1878318783
[FieldOffset(32)]
18784-
internal global::System.IntPtr ASTContext;
18785-
18786-
[FieldOffset(40)]
1878718784
internal global::System.IntPtr library;
1878818785

1878918786
[SuppressUnmanagedCodeSecurity]
@@ -18931,24 +18928,6 @@ public void ClearDiagnostics()
1893118928
}
1893218929
}
1893318930

18934-
public global::CppSharp.Parser.AST.ASTContext ASTContext
18935-
{
18936-
get
18937-
{
18938-
global::CppSharp.Parser.AST.ASTContext __result0;
18939-
if (((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->ASTContext == IntPtr.Zero) __result0 = null;
18940-
else if (global::CppSharp.Parser.AST.ASTContext.NativeToManagedMap.ContainsKey(((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->ASTContext))
18941-
__result0 = (global::CppSharp.Parser.AST.ASTContext) global::CppSharp.Parser.AST.ASTContext.NativeToManagedMap[((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->ASTContext];
18942-
else __result0 = global::CppSharp.Parser.AST.ASTContext.__CreateInstance(((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->ASTContext);
18943-
return __result0;
18944-
}
18945-
18946-
set
18947-
{
18948-
((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->ASTContext = ReferenceEquals(value, null) ? global::System.IntPtr.Zero : value.__Instance;
18949-
}
18950-
}
18951-
1895218931
public global::CppSharp.Parser.AST.NativeLibrary Library
1895318932
{
1895418933
get

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

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18771,7 +18771,7 @@ public int ColumnNumber
1877118771

1877218772
public unsafe partial class ParserResult : IDisposable
1877318773
{
18774-
[StructLayout(LayoutKind.Explicit, Size = 48)]
18774+
[StructLayout(LayoutKind.Explicit, Size = 40)]
1877518775
public partial struct __Internal
1877618776
{
1877718777
[FieldOffset(0)]
@@ -18781,9 +18781,6 @@ public partial struct __Internal
1878118781
internal global::Std.Vector.__Internalc__N_std_S_vector____N_CppSharp_N_CppParser_S_ParserDiagnostic___N_std_S_allocator__S0_ Diagnostics;
1878218782

1878318783
[FieldOffset(32)]
18784-
internal global::System.IntPtr ASTContext;
18785-
18786-
[FieldOffset(40)]
1878718784
internal global::System.IntPtr library;
1878818785

1878918786
[SuppressUnmanagedCodeSecurity]
@@ -18931,24 +18928,6 @@ public void ClearDiagnostics()
1893118928
}
1893218929
}
1893318930

18934-
public global::CppSharp.Parser.AST.ASTContext ASTContext
18935-
{
18936-
get
18937-
{
18938-
global::CppSharp.Parser.AST.ASTContext __result0;
18939-
if (((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->ASTContext == IntPtr.Zero) __result0 = null;
18940-
else if (global::CppSharp.Parser.AST.ASTContext.NativeToManagedMap.ContainsKey(((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->ASTContext))
18941-
__result0 = (global::CppSharp.Parser.AST.ASTContext) global::CppSharp.Parser.AST.ASTContext.NativeToManagedMap[((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->ASTContext];
18942-
else __result0 = global::CppSharp.Parser.AST.ASTContext.__CreateInstance(((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->ASTContext);
18943-
return __result0;
18944-
}
18945-
18946-
set
18947-
{
18948-
((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->ASTContext = ReferenceEquals(value, null) ? global::System.IntPtr.Zero : value.__Instance;
18949-
}
18950-
}
18951-
1895218931
public global::CppSharp.Parser.AST.NativeLibrary Library
1895318932
{
1895418933
get

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

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18772,7 +18772,7 @@ public int ColumnNumber
1877218772

1877318773
public unsafe partial class ParserResult : IDisposable
1877418774
{
18775-
[StructLayout(LayoutKind.Explicit, Size = 48)]
18775+
[StructLayout(LayoutKind.Explicit, Size = 40)]
1877618776
public partial struct __Internal
1877718777
{
1877818778
[FieldOffset(0)]
@@ -18782,9 +18782,6 @@ public partial struct __Internal
1878218782
internal global::Std.Vector.__Internalc__N_std_S_vector____N_CppSharp_N_CppParser_S_ParserDiagnostic___N_std_S_allocator__S0_ Diagnostics;
1878318783

1878418784
[FieldOffset(32)]
18785-
internal global::System.IntPtr ASTContext;
18786-
18787-
[FieldOffset(40)]
1878818785
internal global::System.IntPtr library;
1878918786

1879018787
[SuppressUnmanagedCodeSecurity]
@@ -18932,24 +18929,6 @@ public void ClearDiagnostics()
1893218929
}
1893318930
}
1893418931

18935-
public global::CppSharp.Parser.AST.ASTContext ASTContext
18936-
{
18937-
get
18938-
{
18939-
global::CppSharp.Parser.AST.ASTContext __result0;
18940-
if (((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->ASTContext == IntPtr.Zero) __result0 = null;
18941-
else if (global::CppSharp.Parser.AST.ASTContext.NativeToManagedMap.ContainsKey(((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->ASTContext))
18942-
__result0 = (global::CppSharp.Parser.AST.ASTContext) global::CppSharp.Parser.AST.ASTContext.NativeToManagedMap[((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->ASTContext];
18943-
else __result0 = global::CppSharp.Parser.AST.ASTContext.__CreateInstance(((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->ASTContext);
18944-
return __result0;
18945-
}
18946-
18947-
set
18948-
{
18949-
((global::CppSharp.Parser.ParserResult.__Internal*) __Instance)->ASTContext = ReferenceEquals(value, null) ? global::System.IntPtr.Zero : value.__Instance;
18950-
}
18951-
}
18952-
1895318932
public global::CppSharp.Parser.AST.NativeLibrary Library
1895418933
{
1895518934
get

src/CppParser/Comments.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ RawComment* Parser::WalkRawComment(const clang::RawComment* RC)
4242
auto Comment = new RawComment();
4343
Comment->kind = ConvertRawCommentKind(RC->getKind());
4444
Comment->text = RC->getRawText(SM);
45-
Comment->briefText = RC->getBriefText(*AST);
45+
Comment->briefText = RC->getBriefText(c->getASTContext());
4646

4747
return Comment;
4848
}
@@ -261,13 +261,13 @@ void Parser::HandleComments(const clang::Decl* D, Declaration* Decl)
261261
using namespace clang;
262262

263263
const clang::RawComment* RC = 0;
264-
if (!(RC = AST->getRawCommentForAnyRedecl(D)))
264+
if (!(RC = c->getASTContext().getRawCommentForAnyRedecl(D)))
265265
return;
266266

267267
auto RawComment = WalkRawComment(RC);
268268
Decl->comment = RawComment;
269269

270-
if (clang::comments::FullComment* FC = RC->parse(*AST, &c->getPreprocessor(), D))
270+
if (clang::comments::FullComment* FC = RC->parse(c->getASTContext(), &c->getPreprocessor(), D))
271271
{
272272
auto CB = static_cast<FullComment*>(ConvertCommentBlock(FC));
273273
RawComment->fullCommentBlock = CB;

src/CppParser/CppParser.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,13 @@ DEF_VECTOR_STRING(CppParserOptions, LibraryDirs)
3434
DEF_VECTOR_STRING(CppParserOptions, SupportedStdTypes)
3535

3636
ParserResult::ParserResult()
37-
: ASTContext(0)
38-
, library(0)
37+
: library(0)
3938
{
4039
}
4140

4241
ParserResult::ParserResult(const ParserResult& rhs)
4342
: kind(rhs.kind)
4443
, Diagnostics(rhs.Diagnostics)
45-
, ASTContext(rhs.ASTContext)
4644
, library(rhs.library)
4745
{}
4846

0 commit comments

Comments
 (0)