Browse Source

Changed PreprocessedEntity to a non-declaration because it isn't in Clang.

Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
pull/600/head
Dimitar Dobrev 10 years ago
parent
commit
7d7b75a155
  1. 4
      src/AST/ASTVisitor.cs
  2. 8
      src/AST/Preprocessor.cs
  3. 50
      src/Core/Parser/ASTConverter.cs
  4. 11
      src/CppParser/AST.cpp
  5. 8
      src/CppParser/AST.h
  6. 84
      src/CppParser/Bindings/CLI/AST.cpp
  7. 48
      src/CppParser/Bindings/CLI/AST.h
  8. 287
      src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/AST.cs
  9. 6
      src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/Target.cs
  10. 289
      src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/AST.cs
  11. 6
      src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/Target.cs
  12. 289
      src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/AST.cs
  13. 6
      src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/Target.cs
  14. 285
      src/CppParser/Bindings/CSharp/x86_64-linux-gnu/AST.cs
  15. 32
      src/CppParser/Parser.cpp
  16. 6
      src/CppParser/Parser.h

4
src/AST/ASTVisitor.cs

@ -58,7 +58,7 @@ namespace CppSharp.AST @@ -58,7 +58,7 @@ namespace CppSharp.AST
public bool AlreadyVisited(Declaration decl)
{
return !Visited.Add(decl);
return !Visited.Add(decl);
}
#region Type Visitors
@ -387,7 +387,7 @@ namespace CppSharp.AST @@ -387,7 +387,7 @@ namespace CppSharp.AST
public virtual bool VisitMacroDefinition(MacroDefinition macro)
{
return VisitDeclaration(macro);
return false;
}
public virtual bool VisitNamespace(Namespace @namespace)

8
src/AST/Preprocessor.cs

@ -14,9 +14,11 @@ @@ -14,9 +14,11 @@
/// Base class that describes a preprocessed entity, which may
/// be a preprocessor directive or macro expansion.
/// </summary>
public abstract class PreprocessedEntity : Declaration
public abstract class PreprocessedEntity
{
public MacroLocation MacroLocation = MacroLocation.Unknown;
public abstract T Visit<T>(IDeclVisitor<T> visitor);
}
/// <summary>
@ -24,6 +26,8 @@ @@ -24,6 +26,8 @@
/// </summary>
public class MacroExpansion : PreprocessedEntity
{
public string Name { get; set; }
// Contains the macro expansion text.
public string Text;
@ -52,6 +56,8 @@ @@ -52,6 +56,8 @@
// Backing enumeration if one was generated.
public Enumeration Enumeration;
public string Name { get; set; }
public override T Visit<T>(IDeclVisitor<T> visitor)
{
return visitor.VisitMacroDefinition(this);

50
src/Core/Parser/ASTConverter.cs

@ -139,8 +139,6 @@ namespace CppSharp @@ -139,8 +139,6 @@ namespace CppSharp
public abstract TRet VisitClassTemplatePartialSpecialization(
ClassTemplatePartialSpecialization decl);
public abstract TRet VisitFunctionTemplate(FunctionTemplate decl);
public abstract TRet VisitMacroDefinition(MacroDefinition decl);
public abstract TRet VisitMacroExpansion(MacroExpansion decl);
public virtual TRet Visit(Parser.AST.Declaration decl)
{
@ -231,16 +229,6 @@ namespace CppSharp @@ -231,16 +229,6 @@ namespace CppSharp
var _decl = FunctionTemplate.__CreateInstance(decl.__Instance);
return VisitFunctionTemplate(_decl);
}
case DeclarationKind.MacroDefinition:
{
var _decl = MacroDefinition.__CreateInstance(decl.__Instance);
return VisitMacroDefinition(_decl);
}
case DeclarationKind.MacroExpansion:
{
var _decl = MacroExpansion.__CreateInstance(decl.__Instance);
return VisitMacroExpansion(_decl);
}
}
throw new ArgumentOutOfRangeException();
@ -803,7 +791,7 @@ namespace CppSharp @@ -803,7 +791,7 @@ namespace CppSharp
for (uint i = 0; i < decl.PreprocessedEntitiesCount; ++i)
{
var entity = decl.getPreprocessedEntities(i);
var _entity = Visit(entity) as AST.PreprocessedEntity;
var _entity = VisitPreprocessedEntity(entity);
_decl.PreprocessedEntities.Add(_entity);
}
@ -882,7 +870,7 @@ namespace CppSharp @@ -882,7 +870,7 @@ namespace CppSharp
for (uint i = 0; i < decl.MacrosCount; ++i)
{
var macro = decl.getMacros(i);
var _macro = Visit(macro) as AST.MacroDefinition;
var _macro = VisitMacroDefinition(macro);
_unit.Macros.Add(_macro);
}
@ -1566,10 +1554,26 @@ namespace CppSharp @@ -1566,10 +1554,26 @@ namespace CppSharp
void VisitPreprocessedEntity(PreprocessedEntity entity, AST.PreprocessedEntity _entity)
{
VisitDeclaration(entity, _entity);
_entity.MacroLocation = VisitMacroLocation(entity.MacroLocation);
}
private AST.PreprocessedEntity VisitPreprocessedEntity(PreprocessedEntity entity)
{
switch (entity.Kind)
{
case DeclarationKind.MacroDefinition:
var macroDefinition = MacroDefinition.__CreateInstance(entity.__Instance);
NativeObjects.Add(macroDefinition);
return VisitMacroDefinition(macroDefinition);
case DeclarationKind.MacroExpansion:
var macroExpansion = MacroExpansion.__CreateInstance(entity.__Instance);
NativeObjects.Add(macroExpansion);
return VisitMacroExpansion(macroExpansion);
default:
throw new ArgumentOutOfRangeException("entity");
}
}
private AST.MacroLocation VisitMacroLocation(MacroLocation location)
{
switch (location)
@ -1591,19 +1595,23 @@ namespace CppSharp @@ -1591,19 +1595,23 @@ namespace CppSharp
}
}
public override AST.Declaration VisitMacroDefinition(MacroDefinition decl)
public AST.MacroDefinition VisitMacroDefinition(MacroDefinition macroDefinition)
{
var _macro = new AST.MacroDefinition();
VisitPreprocessedEntity(decl, _macro);
_macro.Expression = decl.Expression;
VisitPreprocessedEntity(macroDefinition, _macro);
_macro.Name = macroDefinition.Name;
_macro.Expression = macroDefinition.Expression;
return _macro;
}
public override AST.Declaration VisitMacroExpansion(MacroExpansion decl)
public AST.MacroExpansion VisitMacroExpansion(MacroExpansion macroExpansion)
{
var _macro = new AST.MacroExpansion();
VisitPreprocessedEntity(decl, _macro);
_macro.Text = decl.Text;
VisitPreprocessedEntity(macroExpansion, _macro);
_macro.Name = macroExpansion.Name;
_macro.Text = macroExpansion.Text;
if (macroExpansion.Definition != null)
_macro.Definition = VisitMacroDefinition(macroExpansion.Definition);
return _macro;
}
}

11
src/CppParser/AST.cpp

@ -667,15 +667,18 @@ Namespace::Namespace() @@ -667,15 +667,18 @@ Namespace::Namespace()
}
PreprocessedEntity::PreprocessedEntity()
: Declaration(DeclarationKind::PreprocessedEntity),
MacroLocation(AST::MacroLocation::Unknown) {}
: MacroLocation(AST::MacroLocation::Unknown),
OriginalPtr(0), Kind(DeclarationKind::PreprocessedEntity) {}
MacroDefinition::MacroDefinition() { Kind = DeclarationKind::MacroDefinition; }
MacroDefinition::MacroDefinition()
: LineNumberStart(0), LineNumberEnd(0) { Kind = DeclarationKind::MacroDefinition; }
DEF_STRING(MacroDefinition, Name)
DEF_STRING(MacroDefinition, Expression)
MacroExpansion::MacroExpansion() { Kind = DeclarationKind::MacroExpansion; }
MacroExpansion::MacroExpansion() : Definition(0) { Kind = DeclarationKind::MacroExpansion; }
DEF_STRING(MacroExpansion, Name)
DEF_STRING(MacroExpansion, Text)
TranslationUnit::TranslationUnit() { Kind = DeclarationKind::TranslationUnit; }

8
src/CppParser/AST.h

@ -823,24 +823,30 @@ enum class MacroLocation @@ -823,24 +823,30 @@ enum class MacroLocation
FunctionBody,
};
class CS_API PreprocessedEntity : public Declaration
class CS_API PreprocessedEntity
{
public:
PreprocessedEntity();
MacroLocation MacroLocation;
void* OriginalPtr;
DeclarationKind Kind;
};
class CS_API MacroDefinition : public PreprocessedEntity
{
public:
MacroDefinition();
STRING(Name)
STRING(Expression)
int LineNumberStart;
int LineNumberEnd;
};
class CS_API MacroExpansion : public PreprocessedEntity
{
public:
MacroExpansion();
STRING(Name)
STRING(Text)
MacroDefinition* Definition;
};

84
src/CppParser/Bindings/CLI/AST.cpp

@ -3772,8 +3772,9 @@ void CppSharp::Parser::AST::Namespace::IsInline::set(bool value) @@ -3772,8 +3772,9 @@ void CppSharp::Parser::AST::Namespace::IsInline::set(bool value)
}
CppSharp::Parser::AST::PreprocessedEntity::PreprocessedEntity(::CppSharp::CppParser::AST::PreprocessedEntity* native)
: CppSharp::Parser::AST::Declaration((::CppSharp::CppParser::AST::Declaration*)native)
: __ownsNativeInstance(false)
{
NativePtr = native;
}
CppSharp::Parser::AST::PreprocessedEntity^ CppSharp::Parser::AST::PreprocessedEntity::__CreateInstance(::System::IntPtr native)
@ -3783,17 +3784,16 @@ CppSharp::Parser::AST::PreprocessedEntity^ CppSharp::Parser::AST::PreprocessedEn @@ -3783,17 +3784,16 @@ CppSharp::Parser::AST::PreprocessedEntity^ CppSharp::Parser::AST::PreprocessedEn
CppSharp::Parser::AST::PreprocessedEntity::~PreprocessedEntity()
{
delete NativePtr;
}
CppSharp::Parser::AST::PreprocessedEntity::PreprocessedEntity()
: CppSharp::Parser::AST::Declaration((::CppSharp::CppParser::AST::Declaration*)nullptr)
{
__ownsNativeInstance = true;
NativePtr = new ::CppSharp::CppParser::AST::PreprocessedEntity();
}
CppSharp::Parser::AST::PreprocessedEntity::PreprocessedEntity(CppSharp::Parser::AST::PreprocessedEntity^ _0)
: CppSharp::Parser::AST::Declaration((::CppSharp::CppParser::AST::Declaration*)nullptr)
{
__ownsNativeInstance = true;
if (ReferenceEquals(_0, nullptr))
@ -3802,6 +3802,16 @@ CppSharp::Parser::AST::PreprocessedEntity::PreprocessedEntity(CppSharp::Parser:: @@ -3802,6 +3802,16 @@ CppSharp::Parser::AST::PreprocessedEntity::PreprocessedEntity(CppSharp::Parser::
NativePtr = new ::CppSharp::CppParser::AST::PreprocessedEntity(arg0);
}
System::IntPtr CppSharp::Parser::AST::PreprocessedEntity::__Instance::get()
{
return System::IntPtr(NativePtr);
}
void CppSharp::Parser::AST::PreprocessedEntity::__Instance::set(System::IntPtr object)
{
NativePtr = (::CppSharp::CppParser::AST::PreprocessedEntity*)object.ToPointer();
}
CppSharp::Parser::AST::MacroLocation CppSharp::Parser::AST::PreprocessedEntity::MacroLocation::get()
{
return (CppSharp::Parser::AST::MacroLocation)((::CppSharp::CppParser::AST::PreprocessedEntity*)NativePtr)->MacroLocation;
@ -3812,6 +3822,26 @@ void CppSharp::Parser::AST::PreprocessedEntity::MacroLocation::set(CppSharp::Par @@ -3812,6 +3822,26 @@ void CppSharp::Parser::AST::PreprocessedEntity::MacroLocation::set(CppSharp::Par
((::CppSharp::CppParser::AST::PreprocessedEntity*)NativePtr)->MacroLocation = (::CppSharp::CppParser::AST::MacroLocation)value;
}
::System::IntPtr CppSharp::Parser::AST::PreprocessedEntity::OriginalPtr::get()
{
return ::System::IntPtr(((::CppSharp::CppParser::AST::PreprocessedEntity*)NativePtr)->OriginalPtr);
}
void CppSharp::Parser::AST::PreprocessedEntity::OriginalPtr::set(::System::IntPtr value)
{
((::CppSharp::CppParser::AST::PreprocessedEntity*)NativePtr)->OriginalPtr = (void*)value;
}
CppSharp::Parser::AST::DeclarationKind CppSharp::Parser::AST::PreprocessedEntity::Kind::get()
{
return (CppSharp::Parser::AST::DeclarationKind)((::CppSharp::CppParser::AST::PreprocessedEntity*)NativePtr)->Kind;
}
void CppSharp::Parser::AST::PreprocessedEntity::Kind::set(CppSharp::Parser::AST::DeclarationKind value)
{
((::CppSharp::CppParser::AST::PreprocessedEntity*)NativePtr)->Kind = (::CppSharp::CppParser::AST::DeclarationKind)value;
}
CppSharp::Parser::AST::MacroDefinition::MacroDefinition(::CppSharp::CppParser::AST::MacroDefinition* native)
: CppSharp::Parser::AST::PreprocessedEntity((::CppSharp::CppParser::AST::PreprocessedEntity*)native)
{
@ -3843,6 +3873,20 @@ CppSharp::Parser::AST::MacroDefinition::MacroDefinition(CppSharp::Parser::AST::M @@ -3843,6 +3873,20 @@ CppSharp::Parser::AST::MacroDefinition::MacroDefinition(CppSharp::Parser::AST::M
NativePtr = new ::CppSharp::CppParser::AST::MacroDefinition(arg0);
}
System::String^ CppSharp::Parser::AST::MacroDefinition::Name::get()
{
auto __ret = ((::CppSharp::CppParser::AST::MacroDefinition*)NativePtr)->getName();
if (__ret == nullptr) return nullptr;
return clix::marshalString<clix::E_UTF8>(__ret);
}
void CppSharp::Parser::AST::MacroDefinition::Name::set(System::String^ s)
{
auto _arg0 = clix::marshalString<clix::E_UTF8>(s);
auto arg0 = _arg0.c_str();
((::CppSharp::CppParser::AST::MacroDefinition*)NativePtr)->setName(arg0);
}
System::String^ CppSharp::Parser::AST::MacroDefinition::Expression::get()
{
auto __ret = ((::CppSharp::CppParser::AST::MacroDefinition*)NativePtr)->getExpression();
@ -3857,6 +3901,26 @@ void CppSharp::Parser::AST::MacroDefinition::Expression::set(System::String^ s) @@ -3857,6 +3901,26 @@ void CppSharp::Parser::AST::MacroDefinition::Expression::set(System::String^ s)
((::CppSharp::CppParser::AST::MacroDefinition*)NativePtr)->setExpression(arg0);
}
int CppSharp::Parser::AST::MacroDefinition::LineNumberStart::get()
{
return ((::CppSharp::CppParser::AST::MacroDefinition*)NativePtr)->LineNumberStart;
}
void CppSharp::Parser::AST::MacroDefinition::LineNumberStart::set(int value)
{
((::CppSharp::CppParser::AST::MacroDefinition*)NativePtr)->LineNumberStart = value;
}
int CppSharp::Parser::AST::MacroDefinition::LineNumberEnd::get()
{
return ((::CppSharp::CppParser::AST::MacroDefinition*)NativePtr)->LineNumberEnd;
}
void CppSharp::Parser::AST::MacroDefinition::LineNumberEnd::set(int value)
{
((::CppSharp::CppParser::AST::MacroDefinition*)NativePtr)->LineNumberEnd = value;
}
CppSharp::Parser::AST::MacroExpansion::MacroExpansion(::CppSharp::CppParser::AST::MacroExpansion* native)
: CppSharp::Parser::AST::PreprocessedEntity((::CppSharp::CppParser::AST::PreprocessedEntity*)native)
{
@ -3888,6 +3952,20 @@ CppSharp::Parser::AST::MacroExpansion::MacroExpansion(CppSharp::Parser::AST::Mac @@ -3888,6 +3952,20 @@ CppSharp::Parser::AST::MacroExpansion::MacroExpansion(CppSharp::Parser::AST::Mac
NativePtr = new ::CppSharp::CppParser::AST::MacroExpansion(arg0);
}
System::String^ CppSharp::Parser::AST::MacroExpansion::Name::get()
{
auto __ret = ((::CppSharp::CppParser::AST::MacroExpansion*)NativePtr)->getName();
if (__ret == nullptr) return nullptr;
return clix::marshalString<clix::E_UTF8>(__ret);
}
void CppSharp::Parser::AST::MacroExpansion::Name::set(System::String^ s)
{
auto _arg0 = clix::marshalString<clix::E_UTF8>(s);
auto arg0 = _arg0.c_str();
((::CppSharp::CppParser::AST::MacroExpansion*)NativePtr)->setName(arg0);
}
System::String^ CppSharp::Parser::AST::MacroExpansion::Text::get()
{
auto __ret = ((::CppSharp::CppParser::AST::MacroExpansion*)NativePtr)->getText();

48
src/CppParser/Bindings/CLI/AST.h

@ -2265,10 +2265,17 @@ namespace CppSharp @@ -2265,10 +2265,17 @@ namespace CppSharp
}
};
public ref class PreprocessedEntity : CppSharp::Parser::AST::Declaration
public ref class PreprocessedEntity : ICppInstance
{
public:
property ::CppSharp::CppParser::AST::PreprocessedEntity* NativePtr;
property System::IntPtr __Instance
{
virtual System::IntPtr get();
virtual void set(System::IntPtr instance);
}
PreprocessedEntity(::CppSharp::CppParser::AST::PreprocessedEntity* native);
static PreprocessedEntity^ __CreateInstance(::System::IntPtr native);
PreprocessedEntity();
@ -2282,6 +2289,21 @@ namespace CppSharp @@ -2282,6 +2289,21 @@ namespace CppSharp
CppSharp::Parser::AST::MacroLocation get();
void set(CppSharp::Parser::AST::MacroLocation);
}
property ::System::IntPtr OriginalPtr
{
::System::IntPtr get();
void set(::System::IntPtr);
}
property CppSharp::Parser::AST::DeclarationKind Kind
{
CppSharp::Parser::AST::DeclarationKind get();
void set(CppSharp::Parser::AST::DeclarationKind);
}
protected:
bool __ownsNativeInstance;
};
public ref class MacroDefinition : CppSharp::Parser::AST::PreprocessedEntity
@ -2296,11 +2318,29 @@ namespace CppSharp @@ -2296,11 +2318,29 @@ namespace CppSharp
~MacroDefinition();
property System::String^ Name
{
System::String^ get();
void set(System::String^);
}
property System::String^ Expression
{
System::String^ get();
void set(System::String^);
}
property int LineNumberStart
{
int get();
void set(int);
}
property int LineNumberEnd
{
int get();
void set(int);
}
};
public ref class MacroExpansion : CppSharp::Parser::AST::PreprocessedEntity
@ -2315,6 +2355,12 @@ namespace CppSharp @@ -2315,6 +2355,12 @@ namespace CppSharp
~MacroExpansion();
property System::String^ Name
{
System::String^ get();
void set(System::String^);
}
property System::String^ Text
{
System::String^ get();

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

@ -8848,49 +8848,19 @@ namespace CppSharp @@ -8848,49 +8848,19 @@ namespace CppSharp
}
}
public unsafe partial class PreprocessedEntity : CppSharp.Parser.AST.Declaration, IDisposable
public unsafe partial class PreprocessedEntity : IDisposable
{
[StructLayout(LayoutKind.Explicit, Size = 96)]
public new partial struct Internal
[StructLayout(LayoutKind.Explicit, Size = 12)]
public partial struct Internal
{
[FieldOffset(0)]
public CppSharp.Parser.AST.DeclarationKind Kind;
public CppSharp.Parser.AST.MacroLocation MacroLocation;
[FieldOffset(4)]
public CppSharp.Parser.AST.AccessSpecifier Access;
[FieldOffset(8)]
public global::System.IntPtr _Namespace;
[FieldOffset(12)]
public CppSharp.Parser.SourceLocation.Internal Location;
[FieldOffset(16)]
public int LineNumberStart;
[FieldOffset(20)]
public int LineNumberEnd;
[FieldOffset(36)]
public global::System.IntPtr Comment;
[FieldOffset(52)]
public byte IsIncomplete;
[FieldOffset(53)]
public byte IsDependent;
[FieldOffset(56)]
public global::System.IntPtr CompleteDeclaration;
[FieldOffset(60)]
public uint DefinitionOrder;
[FieldOffset(76)]
public global::System.IntPtr OriginalPtr;
[FieldOffset(92)]
public CppSharp.Parser.AST.MacroLocation MacroLocation;
[FieldOffset(8)]
public CppSharp.Parser.AST.DeclarationKind Kind;
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
@ -8900,15 +8870,18 @@ namespace CppSharp @@ -8900,15 +8870,18 @@ namespace CppSharp
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZN8CppSharp9CppParser3AST18PreprocessedEntityC2ERKS2_")]
internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0);
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZN8CppSharp9CppParser3AST18PreprocessedEntityD2Ev")]
internal static extern void dtor_0(global::System.IntPtr instance);
internal static extern void cctor_1(global::System.IntPtr instance, global::System.IntPtr _0);
}
public static new PreprocessedEntity __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
public global::System.IntPtr __Instance { get; protected set; }
protected int __PointerAdjustment;
public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, PreprocessedEntity> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, PreprocessedEntity>();
protected void*[] __OriginalVTables;
protected bool __ownsNativeInstance;
public static PreprocessedEntity __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
{
return new PreprocessedEntity((PreprocessedEntity.Internal*) native, skipVTables);
}
@ -8920,9 +8893,9 @@ namespace CppSharp @@ -8920,9 +8893,9 @@ namespace CppSharp
private static PreprocessedEntity.Internal* __CopyValue(PreprocessedEntity.Internal native)
{
var ret = Marshal.AllocHGlobal(96);
CppSharp.Parser.AST.PreprocessedEntity.Internal.cctor_2(ret, new global::System.IntPtr(&native));
return (PreprocessedEntity.Internal*) ret;
var ret = (PreprocessedEntity.Internal*) Marshal.AllocHGlobal(12);
*ret = native;
return ret;
}
private PreprocessedEntity(PreprocessedEntity.Internal native, bool skipVTables = false)
@ -8933,33 +8906,39 @@ namespace CppSharp @@ -8933,33 +8906,39 @@ namespace CppSharp
}
protected PreprocessedEntity(PreprocessedEntity.Internal* native, bool skipVTables = false)
: base((CppSharp.Parser.AST.Declaration.Internal*) null)
{
__PointerAdjustment = 0;
if (native == null)
return;
__Instance = new global::System.IntPtr(native);
}
public PreprocessedEntity()
: this((Internal*) null)
{
__Instance = Marshal.AllocHGlobal(96);
__Instance = Marshal.AllocHGlobal(12);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
Internal.ctor_0((__Instance + __PointerAdjustment));
}
public PreprocessedEntity(CppSharp.Parser.AST.PreprocessedEntity _0)
: this((Internal*) null)
{
__Instance = Marshal.AllocHGlobal(96);
__Instance = Marshal.AllocHGlobal(12);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
if (ReferenceEquals(_0, null))
throw new global::System.ArgumentNullException("_0", "_0 cannot be null because it is a C++ reference (&).");
var arg0 = _0.__Instance;
Internal.cctor_2((__Instance + __PointerAdjustment), arg0);
*((PreprocessedEntity.Internal*) __Instance) = *((PreprocessedEntity.Internal*) _0.__Instance);
}
public void Dispose()
{
Dispose(disposing: true);
}
protected virtual void Dispose(bool disposing)
{
CppSharp.Parser.AST.PreprocessedEntity __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
}
public CppSharp.Parser.AST.MacroLocation MacroLocation
@ -8974,52 +8953,54 @@ namespace CppSharp @@ -8974,52 +8953,54 @@ namespace CppSharp
((Internal*) __Instance)->MacroLocation = value;
}
}
public global::System.IntPtr OriginalPtr
{
get
{
return ((Internal*) __Instance)->OriginalPtr;
}
set
{
((Internal*) __Instance)->OriginalPtr = value;
}
}
public CppSharp.Parser.AST.DeclarationKind Kind
{
get
{
return ((Internal*) __Instance)->Kind;
}
set
{
((Internal*) __Instance)->Kind = value;
}
}
}
public unsafe partial class MacroDefinition : CppSharp.Parser.AST.PreprocessedEntity, IDisposable
{
[StructLayout(LayoutKind.Explicit, Size = 108)]
[StructLayout(LayoutKind.Explicit, Size = 44)]
public new partial struct Internal
{
[FieldOffset(0)]
public CppSharp.Parser.AST.DeclarationKind Kind;
public CppSharp.Parser.AST.MacroLocation MacroLocation;
[FieldOffset(4)]
public CppSharp.Parser.AST.AccessSpecifier Access;
public global::System.IntPtr OriginalPtr;
[FieldOffset(8)]
public global::System.IntPtr _Namespace;
[FieldOffset(12)]
public CppSharp.Parser.SourceLocation.Internal Location;
public CppSharp.Parser.AST.DeclarationKind Kind;
[FieldOffset(16)]
[FieldOffset(36)]
public int LineNumberStart;
[FieldOffset(20)]
[FieldOffset(40)]
public int LineNumberEnd;
[FieldOffset(36)]
public global::System.IntPtr Comment;
[FieldOffset(52)]
public byte IsIncomplete;
[FieldOffset(53)]
public byte IsDependent;
[FieldOffset(56)]
public global::System.IntPtr CompleteDeclaration;
[FieldOffset(60)]
public uint DefinitionOrder;
[FieldOffset(76)]
public global::System.IntPtr OriginalPtr;
[FieldOffset(92)]
public CppSharp.Parser.AST.MacroLocation MacroLocation;
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZN8CppSharp9CppParser3AST15MacroDefinitionC2Ev")]
@ -9035,6 +9016,16 @@ namespace CppSharp @@ -9035,6 +9016,16 @@ namespace CppSharp
EntryPoint="_ZN8CppSharp9CppParser3AST15MacroDefinitionD2Ev")]
internal static extern void dtor_0(global::System.IntPtr instance);
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZN8CppSharp9CppParser3AST15MacroDefinition7getNameEv")]
internal static extern global::System.IntPtr getName_0(global::System.IntPtr instance);
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZN8CppSharp9CppParser3AST15MacroDefinition7setNameEPKc")]
internal static extern void setName_0(global::System.IntPtr instance, global::System.IntPtr s);
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZN8CppSharp9CppParser3AST15MacroDefinition13getExpressionEv")]
@ -9058,7 +9049,7 @@ namespace CppSharp @@ -9058,7 +9049,7 @@ namespace CppSharp
private static MacroDefinition.Internal* __CopyValue(MacroDefinition.Internal native)
{
var ret = Marshal.AllocHGlobal(108);
var ret = Marshal.AllocHGlobal(44);
CppSharp.Parser.AST.MacroDefinition.Internal.cctor_2(ret, new global::System.IntPtr(&native));
return (MacroDefinition.Internal*) ret;
}
@ -9082,7 +9073,7 @@ namespace CppSharp @@ -9082,7 +9073,7 @@ namespace CppSharp
public MacroDefinition()
: this((Internal*) null)
{
__Instance = Marshal.AllocHGlobal(108);
__Instance = Marshal.AllocHGlobal(44);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
Internal.ctor_0((__Instance + __PointerAdjustment));
@ -9091,7 +9082,7 @@ namespace CppSharp @@ -9091,7 +9082,7 @@ namespace CppSharp
public MacroDefinition(CppSharp.Parser.AST.MacroDefinition _0)
: this((Internal*) null)
{
__Instance = Marshal.AllocHGlobal(108);
__Instance = Marshal.AllocHGlobal(44);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
if (ReferenceEquals(_0, null))
@ -9100,6 +9091,22 @@ namespace CppSharp @@ -9100,6 +9091,22 @@ namespace CppSharp
Internal.cctor_2((__Instance + __PointerAdjustment), arg0);
}
public string Name
{
get
{
var __ret = Internal.getName_0((__Instance + __PointerAdjustment));
return Marshal.PtrToStringAnsi(__ret);
}
set
{
var arg0 = Marshal.StringToHGlobalAnsi(value);
Internal.setName_0((__Instance + __PointerAdjustment), arg0);
Marshal.FreeHGlobal(arg0);
}
}
public string Expression
{
get
@ -9115,53 +9122,49 @@ namespace CppSharp @@ -9115,53 +9122,49 @@ namespace CppSharp
Marshal.FreeHGlobal(arg0);
}
}
public int LineNumberStart
{
get
{
return ((Internal*) __Instance)->LineNumberStart;
}
set
{
((Internal*) __Instance)->LineNumberStart = value;
}
}
public int LineNumberEnd
{
get
{
return ((Internal*) __Instance)->LineNumberEnd;
}
set
{
((Internal*) __Instance)->LineNumberEnd = value;
}
}
}
public unsafe partial class MacroExpansion : CppSharp.Parser.AST.PreprocessedEntity, IDisposable
{
[StructLayout(LayoutKind.Explicit, Size = 112)]
[StructLayout(LayoutKind.Explicit, Size = 40)]
public new partial struct Internal
{
[FieldOffset(0)]
public CppSharp.Parser.AST.DeclarationKind Kind;
public CppSharp.Parser.AST.MacroLocation MacroLocation;
[FieldOffset(4)]
public CppSharp.Parser.AST.AccessSpecifier Access;
public global::System.IntPtr OriginalPtr;
[FieldOffset(8)]
public global::System.IntPtr _Namespace;
[FieldOffset(12)]
public CppSharp.Parser.SourceLocation.Internal Location;
[FieldOffset(16)]
public int LineNumberStart;
[FieldOffset(20)]
public int LineNumberEnd;
public CppSharp.Parser.AST.DeclarationKind Kind;
[FieldOffset(36)]
public global::System.IntPtr Comment;
[FieldOffset(52)]
public byte IsIncomplete;
[FieldOffset(53)]
public byte IsDependent;
[FieldOffset(56)]
public global::System.IntPtr CompleteDeclaration;
[FieldOffset(60)]
public uint DefinitionOrder;
[FieldOffset(76)]
public global::System.IntPtr OriginalPtr;
[FieldOffset(92)]
public CppSharp.Parser.AST.MacroLocation MacroLocation;
[FieldOffset(108)]
public global::System.IntPtr Definition;
[SuppressUnmanagedCodeSecurity]
@ -9179,6 +9182,16 @@ namespace CppSharp @@ -9179,6 +9182,16 @@ namespace CppSharp
EntryPoint="_ZN8CppSharp9CppParser3AST14MacroExpansionD2Ev")]
internal static extern void dtor_0(global::System.IntPtr instance);
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZN8CppSharp9CppParser3AST14MacroExpansion7getNameEv")]
internal static extern global::System.IntPtr getName_0(global::System.IntPtr instance);
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZN8CppSharp9CppParser3AST14MacroExpansion7setNameEPKc")]
internal static extern void setName_0(global::System.IntPtr instance, global::System.IntPtr s);
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZN8CppSharp9CppParser3AST14MacroExpansion7getTextEv")]
@ -9202,7 +9215,7 @@ namespace CppSharp @@ -9202,7 +9215,7 @@ namespace CppSharp
private static MacroExpansion.Internal* __CopyValue(MacroExpansion.Internal native)
{
var ret = Marshal.AllocHGlobal(112);
var ret = Marshal.AllocHGlobal(40);
CppSharp.Parser.AST.MacroExpansion.Internal.cctor_2(ret, new global::System.IntPtr(&native));
return (MacroExpansion.Internal*) ret;
}
@ -9226,7 +9239,7 @@ namespace CppSharp @@ -9226,7 +9239,7 @@ namespace CppSharp
public MacroExpansion()
: this((Internal*) null)
{
__Instance = Marshal.AllocHGlobal(112);
__Instance = Marshal.AllocHGlobal(40);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
Internal.ctor_0((__Instance + __PointerAdjustment));
@ -9235,7 +9248,7 @@ namespace CppSharp @@ -9235,7 +9248,7 @@ namespace CppSharp
public MacroExpansion(CppSharp.Parser.AST.MacroExpansion _0)
: this((Internal*) null)
{
__Instance = Marshal.AllocHGlobal(112);
__Instance = Marshal.AllocHGlobal(40);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
if (ReferenceEquals(_0, null))
@ -9244,6 +9257,22 @@ namespace CppSharp @@ -9244,6 +9257,22 @@ namespace CppSharp
Internal.cctor_2((__Instance + __PointerAdjustment), arg0);
}
public string Name
{
get
{
var __ret = Internal.getName_0((__Instance + __PointerAdjustment));
return Marshal.PtrToStringAnsi(__ret);
}
set
{
var arg0 = Marshal.StringToHGlobalAnsi(value);
Internal.setName_0((__Instance + __PointerAdjustment), arg0);
Marshal.FreeHGlobal(arg0);
}
}
public string Text
{
get
@ -9735,7 +9764,7 @@ namespace CppSharp @@ -9735,7 +9764,7 @@ namespace CppSharp
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZN8CppSharp9CppParser3AST10ASTContextC2ERKS2_")]
internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0);
internal static extern void cctor_1(global::System.IntPtr instance, global::System.IntPtr _0);
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
@ -9784,7 +9813,7 @@ namespace CppSharp @@ -9784,7 +9813,7 @@ namespace CppSharp
private static ASTContext.Internal* __CopyValue(ASTContext.Internal native)
{
var ret = Marshal.AllocHGlobal(12);
CppSharp.Parser.AST.ASTContext.Internal.cctor_2(ret, new global::System.IntPtr(&native));
CppSharp.Parser.AST.ASTContext.Internal.cctor_1(ret, new global::System.IntPtr(&native));
return (ASTContext.Internal*) ret;
}
@ -9818,7 +9847,7 @@ namespace CppSharp @@ -9818,7 +9847,7 @@ namespace CppSharp
if (ReferenceEquals(_0, null))
throw new global::System.ArgumentNullException("_0", "_0 cannot be null because it is a C++ reference (&).");
var arg0 = _0.__Instance;
Internal.cctor_2((__Instance + __PointerAdjustment), arg0);
Internal.cctor_1((__Instance + __PointerAdjustment), arg0);
}
public void Dispose()

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

@ -152,7 +152,7 @@ namespace CppSharp @@ -152,7 +152,7 @@ namespace CppSharp
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZN8CppSharp9CppParser16ParserTargetInfoC2ERKS1_")]
internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0);
internal static extern void cctor_1(global::System.IntPtr instance, global::System.IntPtr _0);
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
@ -191,7 +191,7 @@ namespace CppSharp @@ -191,7 +191,7 @@ namespace CppSharp
private static ParserTargetInfo.Internal* __CopyValue(ParserTargetInfo.Internal native)
{
var ret = Marshal.AllocHGlobal(164);
CppSharp.Parser.ParserTargetInfo.Internal.cctor_2(ret, new global::System.IntPtr(&native));
CppSharp.Parser.ParserTargetInfo.Internal.cctor_1(ret, new global::System.IntPtr(&native));
return (ParserTargetInfo.Internal*) ret;
}
@ -225,7 +225,7 @@ namespace CppSharp @@ -225,7 +225,7 @@ namespace CppSharp
if (ReferenceEquals(_0, null))
throw new global::System.ArgumentNullException("_0", "_0 cannot be null because it is a C++ reference (&).");
var arg0 = _0.__Instance;
Internal.cctor_2((__Instance + __PointerAdjustment), arg0);
Internal.cctor_1((__Instance + __PointerAdjustment), arg0);
}
public void Dispose()

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

@ -8848,49 +8848,19 @@ namespace CppSharp @@ -8848,49 +8848,19 @@ namespace CppSharp
}
}
public unsafe partial class PreprocessedEntity : CppSharp.Parser.AST.Declaration, IDisposable
public unsafe partial class PreprocessedEntity : IDisposable
{
[StructLayout(LayoutKind.Explicit, Size = 132)]
public new partial struct Internal
[StructLayout(LayoutKind.Explicit, Size = 12)]
public partial struct Internal
{
[FieldOffset(0)]
public CppSharp.Parser.AST.DeclarationKind Kind;
public CppSharp.Parser.AST.MacroLocation MacroLocation;
[FieldOffset(4)]
public CppSharp.Parser.AST.AccessSpecifier Access;
[FieldOffset(8)]
public global::System.IntPtr _Namespace;
[FieldOffset(12)]
public CppSharp.Parser.SourceLocation.Internal Location;
[FieldOffset(16)]
public int LineNumberStart;
[FieldOffset(20)]
public int LineNumberEnd;
[FieldOffset(48)]
public global::System.IntPtr Comment;
[FieldOffset(76)]
public byte IsIncomplete;
[FieldOffset(77)]
public byte IsDependent;
[FieldOffset(80)]
public global::System.IntPtr CompleteDeclaration;
[FieldOffset(84)]
public uint DefinitionOrder;
[FieldOffset(100)]
public global::System.IntPtr OriginalPtr;
[FieldOffset(128)]
public CppSharp.Parser.AST.MacroLocation MacroLocation;
[FieldOffset(8)]
public CppSharp.Parser.AST.DeclarationKind Kind;
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall,
@ -8900,15 +8870,18 @@ namespace CppSharp @@ -8900,15 +8870,18 @@ namespace CppSharp
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall,
EntryPoint="??0PreprocessedEntity@AST@CppParser@CppSharp@@QAE@ABV0123@@Z")]
internal static extern global::System.IntPtr cctor_2(global::System.IntPtr instance, global::System.IntPtr _0);
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall,
EntryPoint="??1PreprocessedEntity@AST@CppParser@CppSharp@@QAE@XZ")]
internal static extern void dtor_0(global::System.IntPtr instance, int delete);
internal static extern global::System.IntPtr cctor_1(global::System.IntPtr instance, global::System.IntPtr _0);
}
public static new PreprocessedEntity __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
public global::System.IntPtr __Instance { get; protected set; }
protected int __PointerAdjustment;
public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, PreprocessedEntity> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, PreprocessedEntity>();
protected void*[] __OriginalVTables;
protected bool __ownsNativeInstance;
public static PreprocessedEntity __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
{
return new PreprocessedEntity((PreprocessedEntity.Internal*) native, skipVTables);
}
@ -8920,9 +8893,9 @@ namespace CppSharp @@ -8920,9 +8893,9 @@ namespace CppSharp
private static PreprocessedEntity.Internal* __CopyValue(PreprocessedEntity.Internal native)
{
var ret = Marshal.AllocHGlobal(132);
CppSharp.Parser.AST.PreprocessedEntity.Internal.cctor_2(ret, new global::System.IntPtr(&native));
return (PreprocessedEntity.Internal*) ret;
var ret = (PreprocessedEntity.Internal*) Marshal.AllocHGlobal(12);
*ret = native;
return ret;
}
private PreprocessedEntity(PreprocessedEntity.Internal native, bool skipVTables = false)
@ -8933,33 +8906,39 @@ namespace CppSharp @@ -8933,33 +8906,39 @@ namespace CppSharp
}
protected PreprocessedEntity(PreprocessedEntity.Internal* native, bool skipVTables = false)
: base((CppSharp.Parser.AST.Declaration.Internal*) null)
{
__PointerAdjustment = 0;
if (native == null)
return;
__Instance = new global::System.IntPtr(native);
}
public PreprocessedEntity()
: this((Internal*) null)
{
__Instance = Marshal.AllocHGlobal(132);
__Instance = Marshal.AllocHGlobal(12);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
Internal.ctor_0((__Instance + __PointerAdjustment));
}
public PreprocessedEntity(CppSharp.Parser.AST.PreprocessedEntity _0)
: this((Internal*) null)
{
__Instance = Marshal.AllocHGlobal(132);
__Instance = Marshal.AllocHGlobal(12);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
if (ReferenceEquals(_0, null))
throw new global::System.ArgumentNullException("_0", "_0 cannot be null because it is a C++ reference (&).");
var arg0 = _0.__Instance;
Internal.cctor_2((__Instance + __PointerAdjustment), arg0);
*((PreprocessedEntity.Internal*) __Instance) = *((PreprocessedEntity.Internal*) _0.__Instance);
}
public void Dispose()
{
Dispose(disposing: true);
}
protected virtual void Dispose(bool disposing)
{
CppSharp.Parser.AST.PreprocessedEntity __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
}
public CppSharp.Parser.AST.MacroLocation MacroLocation
@ -8974,52 +8953,54 @@ namespace CppSharp @@ -8974,52 +8953,54 @@ namespace CppSharp
((Internal*) __Instance)->MacroLocation = value;
}
}
public global::System.IntPtr OriginalPtr
{
get
{
return ((Internal*) __Instance)->OriginalPtr;
}
set
{
((Internal*) __Instance)->OriginalPtr = value;
}
}
public CppSharp.Parser.AST.DeclarationKind Kind
{
get
{
return ((Internal*) __Instance)->Kind;
}
set
{
((Internal*) __Instance)->Kind = value;
}
}
}
public unsafe partial class MacroDefinition : CppSharp.Parser.AST.PreprocessedEntity, IDisposable
{
[StructLayout(LayoutKind.Explicit, Size = 156)]
[StructLayout(LayoutKind.Explicit, Size = 68)]
public new partial struct Internal
{
[FieldOffset(0)]
public CppSharp.Parser.AST.DeclarationKind Kind;
public CppSharp.Parser.AST.MacroLocation MacroLocation;
[FieldOffset(4)]
public CppSharp.Parser.AST.AccessSpecifier Access;
public global::System.IntPtr OriginalPtr;
[FieldOffset(8)]
public global::System.IntPtr _Namespace;
[FieldOffset(12)]
public CppSharp.Parser.SourceLocation.Internal Location;
public CppSharp.Parser.AST.DeclarationKind Kind;
[FieldOffset(16)]
[FieldOffset(60)]
public int LineNumberStart;
[FieldOffset(20)]
[FieldOffset(64)]
public int LineNumberEnd;
[FieldOffset(48)]
public global::System.IntPtr Comment;
[FieldOffset(76)]
public byte IsIncomplete;
[FieldOffset(77)]
public byte IsDependent;
[FieldOffset(80)]
public global::System.IntPtr CompleteDeclaration;
[FieldOffset(84)]
public uint DefinitionOrder;
[FieldOffset(100)]
public global::System.IntPtr OriginalPtr;
[FieldOffset(128)]
public CppSharp.Parser.AST.MacroLocation MacroLocation;
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall,
EntryPoint="??0MacroDefinition@AST@CppParser@CppSharp@@QAE@XZ")]
@ -9035,6 +9016,16 @@ namespace CppSharp @@ -9035,6 +9016,16 @@ namespace CppSharp
EntryPoint="??1MacroDefinition@AST@CppParser@CppSharp@@QAE@XZ")]
internal static extern void dtor_0(global::System.IntPtr instance, int delete);
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall,
EntryPoint="?getName@MacroDefinition@AST@CppParser@CppSharp@@QAEPBDXZ")]
internal static extern global::System.IntPtr getName_0(global::System.IntPtr instance);
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall,
EntryPoint="?setName@MacroDefinition@AST@CppParser@CppSharp@@QAEXPBD@Z")]
internal static extern void setName_0(global::System.IntPtr instance, global::System.IntPtr s);
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall,
EntryPoint="?getExpression@MacroDefinition@AST@CppParser@CppSharp@@QAEPBDXZ")]
@ -9058,7 +9049,7 @@ namespace CppSharp @@ -9058,7 +9049,7 @@ namespace CppSharp
private static MacroDefinition.Internal* __CopyValue(MacroDefinition.Internal native)
{
var ret = Marshal.AllocHGlobal(156);
var ret = Marshal.AllocHGlobal(68);
CppSharp.Parser.AST.MacroDefinition.Internal.cctor_2(ret, new global::System.IntPtr(&native));
return (MacroDefinition.Internal*) ret;
}
@ -9082,7 +9073,7 @@ namespace CppSharp @@ -9082,7 +9073,7 @@ namespace CppSharp
public MacroDefinition()
: this((Internal*) null)
{
__Instance = Marshal.AllocHGlobal(156);
__Instance = Marshal.AllocHGlobal(68);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
Internal.ctor_0((__Instance + __PointerAdjustment));
@ -9091,7 +9082,7 @@ namespace CppSharp @@ -9091,7 +9082,7 @@ namespace CppSharp
public MacroDefinition(CppSharp.Parser.AST.MacroDefinition _0)
: this((Internal*) null)
{
__Instance = Marshal.AllocHGlobal(156);
__Instance = Marshal.AllocHGlobal(68);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
if (ReferenceEquals(_0, null))
@ -9100,6 +9091,22 @@ namespace CppSharp @@ -9100,6 +9091,22 @@ namespace CppSharp
Internal.cctor_2((__Instance + __PointerAdjustment), arg0);
}
public string Name
{
get
{
var __ret = Internal.getName_0((__Instance + __PointerAdjustment));
return Marshal.PtrToStringAnsi(__ret);
}
set
{
var arg0 = Marshal.StringToHGlobalAnsi(value);
Internal.setName_0((__Instance + __PointerAdjustment), arg0);
Marshal.FreeHGlobal(arg0);
}
}
public string Expression
{
get
@ -9115,53 +9122,49 @@ namespace CppSharp @@ -9115,53 +9122,49 @@ namespace CppSharp
Marshal.FreeHGlobal(arg0);
}
}
public int LineNumberStart
{
get
{
return ((Internal*) __Instance)->LineNumberStart;
}
set
{
((Internal*) __Instance)->LineNumberStart = value;
}
}
public int LineNumberEnd
{
get
{
return ((Internal*) __Instance)->LineNumberEnd;
}
set
{
((Internal*) __Instance)->LineNumberEnd = value;
}
}
}
public unsafe partial class MacroExpansion : CppSharp.Parser.AST.PreprocessedEntity, IDisposable
{
[StructLayout(LayoutKind.Explicit, Size = 160)]
[StructLayout(LayoutKind.Explicit, Size = 64)]
public new partial struct Internal
{
[FieldOffset(0)]
public CppSharp.Parser.AST.DeclarationKind Kind;
public CppSharp.Parser.AST.MacroLocation MacroLocation;
[FieldOffset(4)]
public CppSharp.Parser.AST.AccessSpecifier Access;
[FieldOffset(8)]
public global::System.IntPtr _Namespace;
[FieldOffset(12)]
public CppSharp.Parser.SourceLocation.Internal Location;
[FieldOffset(16)]
public int LineNumberStart;
[FieldOffset(20)]
public int LineNumberEnd;
[FieldOffset(48)]
public global::System.IntPtr Comment;
[FieldOffset(76)]
public byte IsIncomplete;
[FieldOffset(77)]
public byte IsDependent;
[FieldOffset(80)]
public global::System.IntPtr CompleteDeclaration;
[FieldOffset(84)]
public uint DefinitionOrder;
[FieldOffset(100)]
public global::System.IntPtr OriginalPtr;
[FieldOffset(128)]
public CppSharp.Parser.AST.MacroLocation MacroLocation;
[FieldOffset(8)]
public CppSharp.Parser.AST.DeclarationKind Kind;
[FieldOffset(156)]
[FieldOffset(60)]
public global::System.IntPtr Definition;
[SuppressUnmanagedCodeSecurity]
@ -9179,6 +9182,16 @@ namespace CppSharp @@ -9179,6 +9182,16 @@ namespace CppSharp
EntryPoint="??1MacroExpansion@AST@CppParser@CppSharp@@QAE@XZ")]
internal static extern void dtor_0(global::System.IntPtr instance, int delete);
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall,
EntryPoint="?getName@MacroExpansion@AST@CppParser@CppSharp@@QAEPBDXZ")]
internal static extern global::System.IntPtr getName_0(global::System.IntPtr instance);
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall,
EntryPoint="?setName@MacroExpansion@AST@CppParser@CppSharp@@QAEXPBD@Z")]
internal static extern void setName_0(global::System.IntPtr instance, global::System.IntPtr s);
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall,
EntryPoint="?getText@MacroExpansion@AST@CppParser@CppSharp@@QAEPBDXZ")]
@ -9202,7 +9215,7 @@ namespace CppSharp @@ -9202,7 +9215,7 @@ namespace CppSharp
private static MacroExpansion.Internal* __CopyValue(MacroExpansion.Internal native)
{
var ret = Marshal.AllocHGlobal(160);
var ret = Marshal.AllocHGlobal(64);
CppSharp.Parser.AST.MacroExpansion.Internal.cctor_2(ret, new global::System.IntPtr(&native));
return (MacroExpansion.Internal*) ret;
}
@ -9226,7 +9239,7 @@ namespace CppSharp @@ -9226,7 +9239,7 @@ namespace CppSharp
public MacroExpansion()
: this((Internal*) null)
{
__Instance = Marshal.AllocHGlobal(160);
__Instance = Marshal.AllocHGlobal(64);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
Internal.ctor_0((__Instance + __PointerAdjustment));
@ -9235,7 +9248,7 @@ namespace CppSharp @@ -9235,7 +9248,7 @@ namespace CppSharp
public MacroExpansion(CppSharp.Parser.AST.MacroExpansion _0)
: this((Internal*) null)
{
__Instance = Marshal.AllocHGlobal(160);
__Instance = Marshal.AllocHGlobal(64);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
if (ReferenceEquals(_0, null))
@ -9244,6 +9257,22 @@ namespace CppSharp @@ -9244,6 +9257,22 @@ namespace CppSharp
Internal.cctor_2((__Instance + __PointerAdjustment), arg0);
}
public string Name
{
get
{
var __ret = Internal.getName_0((__Instance + __PointerAdjustment));
return Marshal.PtrToStringAnsi(__ret);
}
set
{
var arg0 = Marshal.StringToHGlobalAnsi(value);
Internal.setName_0((__Instance + __PointerAdjustment), arg0);
Marshal.FreeHGlobal(arg0);
}
}
public string Text
{
get
@ -9735,7 +9764,7 @@ namespace CppSharp @@ -9735,7 +9764,7 @@ namespace CppSharp
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall,
EntryPoint="??0ASTContext@AST@CppParser@CppSharp@@QAE@ABV0123@@Z")]
internal static extern global::System.IntPtr cctor_2(global::System.IntPtr instance, global::System.IntPtr _0);
internal static extern global::System.IntPtr cctor_1(global::System.IntPtr instance, global::System.IntPtr _0);
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall,
@ -9784,7 +9813,7 @@ namespace CppSharp @@ -9784,7 +9813,7 @@ namespace CppSharp
private static ASTContext.Internal* __CopyValue(ASTContext.Internal native)
{
var ret = Marshal.AllocHGlobal(12);
CppSharp.Parser.AST.ASTContext.Internal.cctor_2(ret, new global::System.IntPtr(&native));
CppSharp.Parser.AST.ASTContext.Internal.cctor_1(ret, new global::System.IntPtr(&native));
return (ASTContext.Internal*) ret;
}
@ -9818,7 +9847,7 @@ namespace CppSharp @@ -9818,7 +9847,7 @@ namespace CppSharp
if (ReferenceEquals(_0, null))
throw new global::System.ArgumentNullException("_0", "_0 cannot be null because it is a C++ reference (&).");
var arg0 = _0.__Instance;
Internal.cctor_2((__Instance + __PointerAdjustment), arg0);
Internal.cctor_1((__Instance + __PointerAdjustment), arg0);
}
public void Dispose()

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

@ -152,7 +152,7 @@ namespace CppSharp @@ -152,7 +152,7 @@ namespace CppSharp
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall,
EntryPoint="??0ParserTargetInfo@CppParser@CppSharp@@QAE@ABU012@@Z")]
internal static extern global::System.IntPtr cctor_2(global::System.IntPtr instance, global::System.IntPtr _0);
internal static extern global::System.IntPtr cctor_1(global::System.IntPtr instance, global::System.IntPtr _0);
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall,
@ -191,7 +191,7 @@ namespace CppSharp @@ -191,7 +191,7 @@ namespace CppSharp
private static ParserTargetInfo.Internal* __CopyValue(ParserTargetInfo.Internal native)
{
var ret = Marshal.AllocHGlobal(176);
CppSharp.Parser.ParserTargetInfo.Internal.cctor_2(ret, new global::System.IntPtr(&native));
CppSharp.Parser.ParserTargetInfo.Internal.cctor_1(ret, new global::System.IntPtr(&native));
return (ParserTargetInfo.Internal*) ret;
}
@ -225,7 +225,7 @@ namespace CppSharp @@ -225,7 +225,7 @@ namespace CppSharp
if (ReferenceEquals(_0, null))
throw new global::System.ArgumentNullException("_0", "_0 cannot be null because it is a C++ reference (&).");
var arg0 = _0.__Instance;
Internal.cctor_2((__Instance + __PointerAdjustment), arg0);
Internal.cctor_1((__Instance + __PointerAdjustment), arg0);
}
public void Dispose()

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

@ -8847,49 +8847,19 @@ namespace CppSharp @@ -8847,49 +8847,19 @@ namespace CppSharp
}
}
public unsafe partial class PreprocessedEntity : CppSharp.Parser.AST.Declaration, IDisposable
public unsafe partial class PreprocessedEntity : IDisposable
{
[StructLayout(LayoutKind.Explicit, Size = 176)]
public new partial struct Internal
[StructLayout(LayoutKind.Explicit, Size = 24)]
public partial struct Internal
{
[FieldOffset(0)]
public CppSharp.Parser.AST.DeclarationKind Kind;
[FieldOffset(4)]
public CppSharp.Parser.AST.AccessSpecifier Access;
public CppSharp.Parser.AST.MacroLocation MacroLocation;
[FieldOffset(8)]
public global::System.IntPtr _Namespace;
[FieldOffset(16)]
public CppSharp.Parser.SourceLocation.Internal Location;
[FieldOffset(20)]
public int LineNumberStart;
[FieldOffset(24)]
public int LineNumberEnd;
[FieldOffset(56)]
public global::System.IntPtr Comment;
[FieldOffset(88)]
public byte IsIncomplete;
[FieldOffset(89)]
public byte IsDependent;
[FieldOffset(96)]
public global::System.IntPtr CompleteDeclaration;
[FieldOffset(104)]
public uint DefinitionOrder;
[FieldOffset(136)]
public global::System.IntPtr OriginalPtr;
[FieldOffset(168)]
public CppSharp.Parser.AST.MacroLocation MacroLocation;
[FieldOffset(16)]
public CppSharp.Parser.AST.DeclarationKind Kind;
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
@ -8899,15 +8869,18 @@ namespace CppSharp @@ -8899,15 +8869,18 @@ namespace CppSharp
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZN8CppSharp9CppParser3AST18PreprocessedEntityC2ERKS2_")]
internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0);
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZN8CppSharp9CppParser3AST18PreprocessedEntityD2Ev")]
internal static extern void dtor_0(global::System.IntPtr instance);
internal static extern void cctor_1(global::System.IntPtr instance, global::System.IntPtr _0);
}
public static new PreprocessedEntity __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
public global::System.IntPtr __Instance { get; protected set; }
protected int __PointerAdjustment;
public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, PreprocessedEntity> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, PreprocessedEntity>();
protected void*[] __OriginalVTables;
protected bool __ownsNativeInstance;
public static PreprocessedEntity __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
{
return new PreprocessedEntity((PreprocessedEntity.Internal*) native, skipVTables);
}
@ -8919,9 +8892,9 @@ namespace CppSharp @@ -8919,9 +8892,9 @@ namespace CppSharp
private static PreprocessedEntity.Internal* __CopyValue(PreprocessedEntity.Internal native)
{
var ret = Marshal.AllocHGlobal(176);
CppSharp.Parser.AST.PreprocessedEntity.Internal.cctor_2(ret, new global::System.IntPtr(&native));
return (PreprocessedEntity.Internal*) ret;
var ret = (PreprocessedEntity.Internal*) Marshal.AllocHGlobal(24);
*ret = native;
return ret;
}
private PreprocessedEntity(PreprocessedEntity.Internal native, bool skipVTables = false)
@ -8932,33 +8905,39 @@ namespace CppSharp @@ -8932,33 +8905,39 @@ namespace CppSharp
}
protected PreprocessedEntity(PreprocessedEntity.Internal* native, bool skipVTables = false)
: base((CppSharp.Parser.AST.Declaration.Internal*) null)
{
__PointerAdjustment = 0;
if (native == null)
return;
__Instance = new global::System.IntPtr(native);
}
public PreprocessedEntity()
: this((Internal*) null)
{
__Instance = Marshal.AllocHGlobal(176);
__Instance = Marshal.AllocHGlobal(24);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
Internal.ctor_0((__Instance + __PointerAdjustment));
}
public PreprocessedEntity(CppSharp.Parser.AST.PreprocessedEntity _0)
: this((Internal*) null)
{
__Instance = Marshal.AllocHGlobal(176);
__Instance = Marshal.AllocHGlobal(24);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
if (ReferenceEquals(_0, null))
throw new global::System.ArgumentNullException("_0", "_0 cannot be null because it is a C++ reference (&).");
var arg0 = _0.__Instance;
Internal.cctor_2((__Instance + __PointerAdjustment), arg0);
*((PreprocessedEntity.Internal*) __Instance) = *((PreprocessedEntity.Internal*) _0.__Instance);
}
public void Dispose()
{
Dispose(disposing: true);
}
protected virtual void Dispose(bool disposing)
{
CppSharp.Parser.AST.PreprocessedEntity __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
}
public CppSharp.Parser.AST.MacroLocation MacroLocation
@ -8973,52 +8952,54 @@ namespace CppSharp @@ -8973,52 +8952,54 @@ namespace CppSharp
((Internal*) __Instance)->MacroLocation = value;
}
}
public global::System.IntPtr OriginalPtr
{
get
{
return ((Internal*) __Instance)->OriginalPtr;
}
set
{
((Internal*) __Instance)->OriginalPtr = value;
}
}
public CppSharp.Parser.AST.DeclarationKind Kind
{
get
{
return ((Internal*) __Instance)->Kind;
}
set
{
((Internal*) __Instance)->Kind = value;
}
}
}
public unsafe partial class MacroDefinition : CppSharp.Parser.AST.PreprocessedEntity, IDisposable
{
[StructLayout(LayoutKind.Explicit, Size = 200)]
[StructLayout(LayoutKind.Explicit, Size = 80)]
public new partial struct Internal
{
[FieldOffset(0)]
public CppSharp.Parser.AST.DeclarationKind Kind;
[FieldOffset(4)]
public CppSharp.Parser.AST.AccessSpecifier Access;
public CppSharp.Parser.AST.MacroLocation MacroLocation;
[FieldOffset(8)]
public global::System.IntPtr _Namespace;
public global::System.IntPtr OriginalPtr;
[FieldOffset(16)]
public CppSharp.Parser.SourceLocation.Internal Location;
public CppSharp.Parser.AST.DeclarationKind Kind;
[FieldOffset(20)]
[FieldOffset(72)]
public int LineNumberStart;
[FieldOffset(24)]
[FieldOffset(76)]
public int LineNumberEnd;
[FieldOffset(56)]
public global::System.IntPtr Comment;
[FieldOffset(88)]
public byte IsIncomplete;
[FieldOffset(89)]
public byte IsDependent;
[FieldOffset(96)]
public global::System.IntPtr CompleteDeclaration;
[FieldOffset(104)]
public uint DefinitionOrder;
[FieldOffset(136)]
public global::System.IntPtr OriginalPtr;
[FieldOffset(168)]
public CppSharp.Parser.AST.MacroLocation MacroLocation;
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZN8CppSharp9CppParser3AST15MacroDefinitionC2Ev")]
@ -9034,6 +9015,16 @@ namespace CppSharp @@ -9034,6 +9015,16 @@ namespace CppSharp
EntryPoint="_ZN8CppSharp9CppParser3AST15MacroDefinitionD2Ev")]
internal static extern void dtor_0(global::System.IntPtr instance);
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZN8CppSharp9CppParser3AST15MacroDefinition7getNameEv")]
internal static extern global::System.IntPtr getName_0(global::System.IntPtr instance);
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZN8CppSharp9CppParser3AST15MacroDefinition7setNameEPKc")]
internal static extern void setName_0(global::System.IntPtr instance, global::System.IntPtr s);
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZN8CppSharp9CppParser3AST15MacroDefinition13getExpressionEv")]
@ -9057,7 +9048,7 @@ namespace CppSharp @@ -9057,7 +9048,7 @@ namespace CppSharp
private static MacroDefinition.Internal* __CopyValue(MacroDefinition.Internal native)
{
var ret = Marshal.AllocHGlobal(200);
var ret = Marshal.AllocHGlobal(80);
CppSharp.Parser.AST.MacroDefinition.Internal.cctor_2(ret, new global::System.IntPtr(&native));
return (MacroDefinition.Internal*) ret;
}
@ -9081,7 +9072,7 @@ namespace CppSharp @@ -9081,7 +9072,7 @@ namespace CppSharp
public MacroDefinition()
: this((Internal*) null)
{
__Instance = Marshal.AllocHGlobal(200);
__Instance = Marshal.AllocHGlobal(80);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
Internal.ctor_0((__Instance + __PointerAdjustment));
@ -9090,7 +9081,7 @@ namespace CppSharp @@ -9090,7 +9081,7 @@ namespace CppSharp
public MacroDefinition(CppSharp.Parser.AST.MacroDefinition _0)
: this((Internal*) null)
{
__Instance = Marshal.AllocHGlobal(200);
__Instance = Marshal.AllocHGlobal(80);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
if (ReferenceEquals(_0, null))
@ -9099,6 +9090,22 @@ namespace CppSharp @@ -9099,6 +9090,22 @@ namespace CppSharp
Internal.cctor_2((__Instance + __PointerAdjustment), arg0);
}
public string Name
{
get
{
var __ret = Internal.getName_0((__Instance + __PointerAdjustment));
return Marshal.PtrToStringAnsi(__ret);
}
set
{
var arg0 = Marshal.StringToHGlobalAnsi(value);
Internal.setName_0((__Instance + __PointerAdjustment), arg0);
Marshal.FreeHGlobal(arg0);
}
}
public string Expression
{
get
@ -9114,53 +9121,49 @@ namespace CppSharp @@ -9114,53 +9121,49 @@ namespace CppSharp
Marshal.FreeHGlobal(arg0);
}
}
public int LineNumberStart
{
get
{
return ((Internal*) __Instance)->LineNumberStart;
}
set
{
((Internal*) __Instance)->LineNumberStart = value;
}
}
public int LineNumberEnd
{
get
{
return ((Internal*) __Instance)->LineNumberEnd;
}
set
{
((Internal*) __Instance)->LineNumberEnd = value;
}
}
}
public unsafe partial class MacroExpansion : CppSharp.Parser.AST.PreprocessedEntity, IDisposable
{
[StructLayout(LayoutKind.Explicit, Size = 208)]
[StructLayout(LayoutKind.Explicit, Size = 80)]
public new partial struct Internal
{
[FieldOffset(0)]
public CppSharp.Parser.AST.DeclarationKind Kind;
[FieldOffset(4)]
public CppSharp.Parser.AST.AccessSpecifier Access;
public CppSharp.Parser.AST.MacroLocation MacroLocation;
[FieldOffset(8)]
public global::System.IntPtr _Namespace;
[FieldOffset(16)]
public CppSharp.Parser.SourceLocation.Internal Location;
[FieldOffset(20)]
public int LineNumberStart;
[FieldOffset(24)]
public int LineNumberEnd;
[FieldOffset(56)]
public global::System.IntPtr Comment;
[FieldOffset(88)]
public byte IsIncomplete;
[FieldOffset(89)]
public byte IsDependent;
[FieldOffset(96)]
public global::System.IntPtr CompleteDeclaration;
[FieldOffset(104)]
public uint DefinitionOrder;
[FieldOffset(136)]
public global::System.IntPtr OriginalPtr;
[FieldOffset(168)]
public CppSharp.Parser.AST.MacroLocation MacroLocation;
[FieldOffset(16)]
public CppSharp.Parser.AST.DeclarationKind Kind;
[FieldOffset(200)]
[FieldOffset(72)]
public global::System.IntPtr Definition;
[SuppressUnmanagedCodeSecurity]
@ -9178,6 +9181,16 @@ namespace CppSharp @@ -9178,6 +9181,16 @@ namespace CppSharp
EntryPoint="_ZN8CppSharp9CppParser3AST14MacroExpansionD2Ev")]
internal static extern void dtor_0(global::System.IntPtr instance);
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZN8CppSharp9CppParser3AST14MacroExpansion7getNameEv")]
internal static extern global::System.IntPtr getName_0(global::System.IntPtr instance);
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZN8CppSharp9CppParser3AST14MacroExpansion7setNameEPKc")]
internal static extern void setName_0(global::System.IntPtr instance, global::System.IntPtr s);
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZN8CppSharp9CppParser3AST14MacroExpansion7getTextEv")]
@ -9201,7 +9214,7 @@ namespace CppSharp @@ -9201,7 +9214,7 @@ namespace CppSharp
private static MacroExpansion.Internal* __CopyValue(MacroExpansion.Internal native)
{
var ret = Marshal.AllocHGlobal(208);
var ret = Marshal.AllocHGlobal(80);
CppSharp.Parser.AST.MacroExpansion.Internal.cctor_2(ret, new global::System.IntPtr(&native));
return (MacroExpansion.Internal*) ret;
}
@ -9225,7 +9238,7 @@ namespace CppSharp @@ -9225,7 +9238,7 @@ namespace CppSharp
public MacroExpansion()
: this((Internal*) null)
{
__Instance = Marshal.AllocHGlobal(208);
__Instance = Marshal.AllocHGlobal(80);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
Internal.ctor_0((__Instance + __PointerAdjustment));
@ -9234,7 +9247,7 @@ namespace CppSharp @@ -9234,7 +9247,7 @@ namespace CppSharp
public MacroExpansion(CppSharp.Parser.AST.MacroExpansion _0)
: this((Internal*) null)
{
__Instance = Marshal.AllocHGlobal(208);
__Instance = Marshal.AllocHGlobal(80);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
if (ReferenceEquals(_0, null))
@ -9243,6 +9256,22 @@ namespace CppSharp @@ -9243,6 +9256,22 @@ namespace CppSharp
Internal.cctor_2((__Instance + __PointerAdjustment), arg0);
}
public string Name
{
get
{
var __ret = Internal.getName_0((__Instance + __PointerAdjustment));
return Marshal.PtrToStringAnsi(__ret);
}
set
{
var arg0 = Marshal.StringToHGlobalAnsi(value);
Internal.setName_0((__Instance + __PointerAdjustment), arg0);
Marshal.FreeHGlobal(arg0);
}
}
public string Text
{
get
@ -9734,7 +9763,7 @@ namespace CppSharp @@ -9734,7 +9763,7 @@ namespace CppSharp
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZN8CppSharp9CppParser3AST10ASTContextC2ERKS2_")]
internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0);
internal static extern void cctor_1(global::System.IntPtr instance, global::System.IntPtr _0);
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
@ -9783,7 +9812,7 @@ namespace CppSharp @@ -9783,7 +9812,7 @@ namespace CppSharp
private static ASTContext.Internal* __CopyValue(ASTContext.Internal native)
{
var ret = Marshal.AllocHGlobal(24);
CppSharp.Parser.AST.ASTContext.Internal.cctor_2(ret, new global::System.IntPtr(&native));
CppSharp.Parser.AST.ASTContext.Internal.cctor_1(ret, new global::System.IntPtr(&native));
return (ASTContext.Internal*) ret;
}
@ -9817,7 +9846,7 @@ namespace CppSharp @@ -9817,7 +9846,7 @@ namespace CppSharp
if (ReferenceEquals(_0, null))
throw new global::System.ArgumentNullException("_0", "_0 cannot be null because it is a C++ reference (&).");
var arg0 = _0.__Instance;
Internal.cctor_2((__Instance + __PointerAdjustment), arg0);
Internal.cctor_1((__Instance + __PointerAdjustment), arg0);
}
public void Dispose()

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

@ -152,7 +152,7 @@ namespace CppSharp @@ -152,7 +152,7 @@ namespace CppSharp
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZN8CppSharp9CppParser16ParserTargetInfoC2ERKS1_")]
internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0);
internal static extern void cctor_1(global::System.IntPtr instance, global::System.IntPtr _0);
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
@ -191,7 +191,7 @@ namespace CppSharp @@ -191,7 +191,7 @@ namespace CppSharp
private static ParserTargetInfo.Internal* __CopyValue(ParserTargetInfo.Internal native)
{
var ret = Marshal.AllocHGlobal(176);
CppSharp.Parser.ParserTargetInfo.Internal.cctor_2(ret, new global::System.IntPtr(&native));
CppSharp.Parser.ParserTargetInfo.Internal.cctor_1(ret, new global::System.IntPtr(&native));
return (ParserTargetInfo.Internal*) ret;
}
@ -225,7 +225,7 @@ namespace CppSharp @@ -225,7 +225,7 @@ namespace CppSharp
if (ReferenceEquals(_0, null))
throw new global::System.ArgumentNullException("_0", "_0 cannot be null because it is a C++ reference (&).");
var arg0 = _0.__Instance;
Internal.cctor_2((__Instance + __PointerAdjustment), arg0);
Internal.cctor_1((__Instance + __PointerAdjustment), arg0);
}
public void Dispose()

285
src/CppParser/Bindings/CSharp/x86_64-linux-gnu/AST.cs

@ -8847,49 +8847,19 @@ namespace CppSharp @@ -8847,49 +8847,19 @@ namespace CppSharp
}
}
public unsafe partial class PreprocessedEntity : CppSharp.Parser.AST.Declaration, IDisposable
public unsafe partial class PreprocessedEntity : IDisposable
{
[StructLayout(LayoutKind.Explicit, Size = 128)]
public new partial struct Internal
[StructLayout(LayoutKind.Explicit, Size = 24)]
public partial struct Internal
{
[FieldOffset(0)]
public CppSharp.Parser.AST.DeclarationKind Kind;
[FieldOffset(4)]
public CppSharp.Parser.AST.AccessSpecifier Access;
public CppSharp.Parser.AST.MacroLocation MacroLocation;
[FieldOffset(8)]
public global::System.IntPtr _Namespace;
[FieldOffset(16)]
public CppSharp.Parser.SourceLocation.Internal Location;
[FieldOffset(20)]
public int LineNumberStart;
[FieldOffset(24)]
public int LineNumberEnd;
[FieldOffset(40)]
public global::System.IntPtr Comment;
[FieldOffset(56)]
public byte IsIncomplete;
[FieldOffset(57)]
public byte IsDependent;
[FieldOffset(64)]
public global::System.IntPtr CompleteDeclaration;
[FieldOffset(72)]
public uint DefinitionOrder;
[FieldOffset(104)]
public global::System.IntPtr OriginalPtr;
[FieldOffset(120)]
public CppSharp.Parser.AST.MacroLocation MacroLocation;
[FieldOffset(16)]
public CppSharp.Parser.AST.DeclarationKind Kind;
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
@ -8900,14 +8870,17 @@ namespace CppSharp @@ -8900,14 +8870,17 @@ namespace CppSharp
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZN8CppSharp9CppParser3AST18PreprocessedEntityC2ERKS2_")]
internal static extern void cctor_1(global::System.IntPtr instance, global::System.IntPtr _0);
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZN8CppSharp9CppParser3AST18PreprocessedEntityD2Ev")]
internal static extern void dtor_0(global::System.IntPtr instance);
}
public static new PreprocessedEntity __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
public global::System.IntPtr __Instance { get; protected set; }
protected int __PointerAdjustment;
public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, PreprocessedEntity> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, PreprocessedEntity>();
protected void*[] __OriginalVTables;
protected bool __ownsNativeInstance;
public static PreprocessedEntity __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
{
return new PreprocessedEntity((PreprocessedEntity.Internal*) native, skipVTables);
}
@ -8919,9 +8892,9 @@ namespace CppSharp @@ -8919,9 +8892,9 @@ namespace CppSharp
private static PreprocessedEntity.Internal* __CopyValue(PreprocessedEntity.Internal native)
{
var ret = Marshal.AllocHGlobal(128);
CppSharp.Parser.AST.PreprocessedEntity.Internal.cctor_1(ret, new global::System.IntPtr(&native));
return (PreprocessedEntity.Internal*) ret;
var ret = (PreprocessedEntity.Internal*) Marshal.AllocHGlobal(24);
*ret = native;
return ret;
}
private PreprocessedEntity(PreprocessedEntity.Internal native, bool skipVTables = false)
@ -8932,33 +8905,39 @@ namespace CppSharp @@ -8932,33 +8905,39 @@ namespace CppSharp
}
protected PreprocessedEntity(PreprocessedEntity.Internal* native, bool skipVTables = false)
: base((CppSharp.Parser.AST.Declaration.Internal*) null)
{
__PointerAdjustment = 0;
if (native == null)
return;
__Instance = new global::System.IntPtr(native);
}
public PreprocessedEntity()
: this((Internal*) null)
{
__Instance = Marshal.AllocHGlobal(128);
__Instance = Marshal.AllocHGlobal(24);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
Internal.ctor_0((__Instance + __PointerAdjustment));
}
public PreprocessedEntity(CppSharp.Parser.AST.PreprocessedEntity _0)
: this((Internal*) null)
{
__Instance = Marshal.AllocHGlobal(128);
__Instance = Marshal.AllocHGlobal(24);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
if (ReferenceEquals(_0, null))
throw new global::System.ArgumentNullException("_0", "_0 cannot be null because it is a C++ reference (&).");
var arg0 = _0.__Instance;
Internal.cctor_1((__Instance + __PointerAdjustment), arg0);
*((PreprocessedEntity.Internal*) __Instance) = *((PreprocessedEntity.Internal*) _0.__Instance);
}
public void Dispose()
{
Dispose(disposing: true);
}
protected virtual void Dispose(bool disposing)
{
CppSharp.Parser.AST.PreprocessedEntity __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
}
public CppSharp.Parser.AST.MacroLocation MacroLocation
@ -8973,52 +8952,54 @@ namespace CppSharp @@ -8973,52 +8952,54 @@ namespace CppSharp
((Internal*) __Instance)->MacroLocation = value;
}
}
public global::System.IntPtr OriginalPtr
{
get
{
return ((Internal*) __Instance)->OriginalPtr;
}
set
{
((Internal*) __Instance)->OriginalPtr = value;
}
}
public CppSharp.Parser.AST.DeclarationKind Kind
{
get
{
return ((Internal*) __Instance)->Kind;
}
set
{
((Internal*) __Instance)->Kind = value;
}
}
}
public unsafe partial class MacroDefinition : CppSharp.Parser.AST.PreprocessedEntity, IDisposable
{
[StructLayout(LayoutKind.Explicit, Size = 136)]
[StructLayout(LayoutKind.Explicit, Size = 48)]
public new partial struct Internal
{
[FieldOffset(0)]
public CppSharp.Parser.AST.DeclarationKind Kind;
[FieldOffset(4)]
public CppSharp.Parser.AST.AccessSpecifier Access;
public CppSharp.Parser.AST.MacroLocation MacroLocation;
[FieldOffset(8)]
public global::System.IntPtr _Namespace;
public global::System.IntPtr OriginalPtr;
[FieldOffset(16)]
public CppSharp.Parser.SourceLocation.Internal Location;
public CppSharp.Parser.AST.DeclarationKind Kind;
[FieldOffset(20)]
[FieldOffset(40)]
public int LineNumberStart;
[FieldOffset(24)]
[FieldOffset(44)]
public int LineNumberEnd;
[FieldOffset(40)]
public global::System.IntPtr Comment;
[FieldOffset(56)]
public byte IsIncomplete;
[FieldOffset(57)]
public byte IsDependent;
[FieldOffset(64)]
public global::System.IntPtr CompleteDeclaration;
[FieldOffset(72)]
public uint DefinitionOrder;
[FieldOffset(104)]
public global::System.IntPtr OriginalPtr;
[FieldOffset(120)]
public CppSharp.Parser.AST.MacroLocation MacroLocation;
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZN8CppSharp9CppParser3AST15MacroDefinitionC2Ev")]
@ -9034,6 +9015,16 @@ namespace CppSharp @@ -9034,6 +9015,16 @@ namespace CppSharp
EntryPoint="_ZN8CppSharp9CppParser3AST15MacroDefinitionD2Ev")]
internal static extern void dtor_0(global::System.IntPtr instance);
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZN8CppSharp9CppParser3AST15MacroDefinition7getNameEv")]
internal static extern global::System.IntPtr getName_0(global::System.IntPtr instance);
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZN8CppSharp9CppParser3AST15MacroDefinition7setNameEPKc")]
internal static extern void setName_0(global::System.IntPtr instance, global::System.IntPtr s);
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZN8CppSharp9CppParser3AST15MacroDefinition13getExpressionEv")]
@ -9057,7 +9048,7 @@ namespace CppSharp @@ -9057,7 +9048,7 @@ namespace CppSharp
private static MacroDefinition.Internal* __CopyValue(MacroDefinition.Internal native)
{
var ret = Marshal.AllocHGlobal(136);
var ret = Marshal.AllocHGlobal(48);
CppSharp.Parser.AST.MacroDefinition.Internal.cctor_1(ret, new global::System.IntPtr(&native));
return (MacroDefinition.Internal*) ret;
}
@ -9081,7 +9072,7 @@ namespace CppSharp @@ -9081,7 +9072,7 @@ namespace CppSharp
public MacroDefinition()
: this((Internal*) null)
{
__Instance = Marshal.AllocHGlobal(136);
__Instance = Marshal.AllocHGlobal(48);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
Internal.ctor_0((__Instance + __PointerAdjustment));
@ -9090,7 +9081,7 @@ namespace CppSharp @@ -9090,7 +9081,7 @@ namespace CppSharp
public MacroDefinition(CppSharp.Parser.AST.MacroDefinition _0)
: this((Internal*) null)
{
__Instance = Marshal.AllocHGlobal(136);
__Instance = Marshal.AllocHGlobal(48);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
if (ReferenceEquals(_0, null))
@ -9099,6 +9090,22 @@ namespace CppSharp @@ -9099,6 +9090,22 @@ namespace CppSharp
Internal.cctor_1((__Instance + __PointerAdjustment), arg0);
}
public string Name
{
get
{
var __ret = Internal.getName_0((__Instance + __PointerAdjustment));
return Marshal.PtrToStringAnsi(__ret);
}
set
{
var arg0 = Marshal.StringToHGlobalAnsi(value);
Internal.setName_0((__Instance + __PointerAdjustment), arg0);
Marshal.FreeHGlobal(arg0);
}
}
public string Expression
{
get
@ -9114,53 +9121,49 @@ namespace CppSharp @@ -9114,53 +9121,49 @@ namespace CppSharp
Marshal.FreeHGlobal(arg0);
}
}
public int LineNumberStart
{
get
{
return ((Internal*) __Instance)->LineNumberStart;
}
set
{
((Internal*) __Instance)->LineNumberStart = value;
}
}
public int LineNumberEnd
{
get
{
return ((Internal*) __Instance)->LineNumberEnd;
}
set
{
((Internal*) __Instance)->LineNumberEnd = value;
}
}
}
public unsafe partial class MacroExpansion : CppSharp.Parser.AST.PreprocessedEntity, IDisposable
{
[StructLayout(LayoutKind.Explicit, Size = 144)]
[StructLayout(LayoutKind.Explicit, Size = 48)]
public new partial struct Internal
{
[FieldOffset(0)]
public CppSharp.Parser.AST.DeclarationKind Kind;
[FieldOffset(4)]
public CppSharp.Parser.AST.AccessSpecifier Access;
public CppSharp.Parser.AST.MacroLocation MacroLocation;
[FieldOffset(8)]
public global::System.IntPtr _Namespace;
public global::System.IntPtr OriginalPtr;
[FieldOffset(16)]
public CppSharp.Parser.SourceLocation.Internal Location;
[FieldOffset(20)]
public int LineNumberStart;
[FieldOffset(24)]
public int LineNumberEnd;
public CppSharp.Parser.AST.DeclarationKind Kind;
[FieldOffset(40)]
public global::System.IntPtr Comment;
[FieldOffset(56)]
public byte IsIncomplete;
[FieldOffset(57)]
public byte IsDependent;
[FieldOffset(64)]
public global::System.IntPtr CompleteDeclaration;
[FieldOffset(72)]
public uint DefinitionOrder;
[FieldOffset(104)]
public global::System.IntPtr OriginalPtr;
[FieldOffset(120)]
public CppSharp.Parser.AST.MacroLocation MacroLocation;
[FieldOffset(136)]
public global::System.IntPtr Definition;
[SuppressUnmanagedCodeSecurity]
@ -9178,6 +9181,16 @@ namespace CppSharp @@ -9178,6 +9181,16 @@ namespace CppSharp
EntryPoint="_ZN8CppSharp9CppParser3AST14MacroExpansionD2Ev")]
internal static extern void dtor_0(global::System.IntPtr instance);
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZN8CppSharp9CppParser3AST14MacroExpansion7getNameEv")]
internal static extern global::System.IntPtr getName_0(global::System.IntPtr instance);
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZN8CppSharp9CppParser3AST14MacroExpansion7setNameEPKc")]
internal static extern void setName_0(global::System.IntPtr instance, global::System.IntPtr s);
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZN8CppSharp9CppParser3AST14MacroExpansion7getTextEv")]
@ -9201,7 +9214,7 @@ namespace CppSharp @@ -9201,7 +9214,7 @@ namespace CppSharp
private static MacroExpansion.Internal* __CopyValue(MacroExpansion.Internal native)
{
var ret = Marshal.AllocHGlobal(144);
var ret = Marshal.AllocHGlobal(48);
CppSharp.Parser.AST.MacroExpansion.Internal.cctor_1(ret, new global::System.IntPtr(&native));
return (MacroExpansion.Internal*) ret;
}
@ -9225,7 +9238,7 @@ namespace CppSharp @@ -9225,7 +9238,7 @@ namespace CppSharp
public MacroExpansion()
: this((Internal*) null)
{
__Instance = Marshal.AllocHGlobal(144);
__Instance = Marshal.AllocHGlobal(48);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
Internal.ctor_0((__Instance + __PointerAdjustment));
@ -9234,7 +9247,7 @@ namespace CppSharp @@ -9234,7 +9247,7 @@ namespace CppSharp
public MacroExpansion(CppSharp.Parser.AST.MacroExpansion _0)
: this((Internal*) null)
{
__Instance = Marshal.AllocHGlobal(144);
__Instance = Marshal.AllocHGlobal(48);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
if (ReferenceEquals(_0, null))
@ -9243,6 +9256,22 @@ namespace CppSharp @@ -9243,6 +9256,22 @@ namespace CppSharp
Internal.cctor_1((__Instance + __PointerAdjustment), arg0);
}
public string Name
{
get
{
var __ret = Internal.getName_0((__Instance + __PointerAdjustment));
return Marshal.PtrToStringAnsi(__ret);
}
set
{
var arg0 = Marshal.StringToHGlobalAnsi(value);
Internal.setName_0((__Instance + __PointerAdjustment), arg0);
Marshal.FreeHGlobal(arg0);
}
}
public string Text
{
get
@ -9734,7 +9763,7 @@ namespace CppSharp @@ -9734,7 +9763,7 @@ namespace CppSharp
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZN8CppSharp9CppParser3AST10ASTContextC2ERKS2_")]
internal static extern void cctor_2(global::System.IntPtr instance, global::System.IntPtr _0);
internal static extern void cctor_1(global::System.IntPtr instance, global::System.IntPtr _0);
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
@ -9783,7 +9812,7 @@ namespace CppSharp @@ -9783,7 +9812,7 @@ namespace CppSharp
private static ASTContext.Internal* __CopyValue(ASTContext.Internal native)
{
var ret = Marshal.AllocHGlobal(24);
CppSharp.Parser.AST.ASTContext.Internal.cctor_2(ret, new global::System.IntPtr(&native));
CppSharp.Parser.AST.ASTContext.Internal.cctor_1(ret, new global::System.IntPtr(&native));
return (ASTContext.Internal*) ret;
}
@ -9817,7 +9846,7 @@ namespace CppSharp @@ -9817,7 +9846,7 @@ namespace CppSharp
if (ReferenceEquals(_0, null))
throw new global::System.ArgumentNullException("_0", "_0 cannot be null because it is a C++ reference (&).");
var arg0 = _0.__Instance;
Internal.cctor_2((__Instance + __PointerAdjustment), arg0);
Internal.cctor_1((__Instance + __PointerAdjustment), arg0);
}
public void Dispose()

32
src/CppParser/Parser.cpp

@ -2398,6 +2398,16 @@ SourceLocationKind Parser::GetLocationKind(const clang::SourceLocation& Loc) @@ -2398,6 +2398,16 @@ SourceLocationKind Parser::GetLocationKind(const clang::SourceLocation& Loc)
return SourceLocationKind::System;
}
void Parser::GetLineNumbersFromLocation(const clang::SourceLocation& StartLoc,
const clang::SourceLocation& EndLoc, int* LineNumberStart, int* LineNumberEnd)
{
auto& SM = C->getSourceManager();
auto DecomposedLocStart = SM.getDecomposedLoc(StartLoc);
*LineNumberStart = SM.getLineNumber(DecomposedLocStart.first, DecomposedLocStart.second);
auto DecomposedLocEnd = SM.getDecomposedLoc(EndLoc);
*LineNumberEnd = SM.getLineNumber(DecomposedLocEnd.first, DecomposedLocEnd.second);
}
bool Parser::IsValidDeclaration(const clang::SourceLocation& Loc)
{
auto Kind = GetLocationKind(Loc);
@ -2519,8 +2529,13 @@ PreprocessedEntity* Parser::WalkPreprocessedEntity( @@ -2519,8 +2529,13 @@ PreprocessedEntity* Parser::WalkPreprocessedEntity(
{
case clang::PreprocessedEntity::MacroExpansionKind:
{
auto MD = cast<clang::MacroExpansion>(PPEntity);
Entity = new MacroExpansion();
auto ME = cast<clang::MacroExpansion>(PPEntity);
auto Expansion = new MacroExpansion();
auto MD = ME->getDefinition();
if (MD && MD->getKind() != clang::PreprocessedEntity::InvalidKind)
Expansion->Definition = (MacroDefinition*)
WalkPreprocessedEntity(Decl, ME->getDefinition());
Entity = Expansion;
std::string Text;
GetDeclText(PPEntity->getSourceRange(), Text);
@ -2565,6 +2580,8 @@ PreprocessedEntity* Parser::WalkPreprocessedEntity( @@ -2565,6 +2580,8 @@ PreprocessedEntity* Parser::WalkPreprocessedEntity(
break;
auto Definition = new MacroDefinition();
GetLineNumbersFromLocation(MD->getLocation(), MD->getLocation(),
&Definition->LineNumberStart, &Definition->LineNumberEnd);
Entity = Definition;
Definition->Name = II->getName().trim();
@ -2581,11 +2598,11 @@ PreprocessedEntity* Parser::WalkPreprocessedEntity( @@ -2581,11 +2598,11 @@ PreprocessedEntity* Parser::WalkPreprocessedEntity(
return nullptr;
Entity->OriginalPtr = PPEntity;
Entity->_Namespace = GetTranslationUnit(PPEntity->getSourceRange().getBegin());
auto Namespace = GetTranslationUnit(PPEntity->getSourceRange().getBegin());
if (Decl->Kind == CppSharp::CppParser::AST::DeclarationKind::TranslationUnit)
{
Entity->_Namespace->PreprocessedEntities.push_back(Entity);
Namespace->PreprocessedEntities.push_back(Entity);
}
else
{
@ -2750,11 +2767,8 @@ void Parser::HandleDeclaration(clang::Decl* D, Declaration* Decl) @@ -2750,11 +2767,8 @@ void Parser::HandleDeclaration(clang::Decl* D, Declaration* Decl)
Decl->OriginalPtr = (void*) D;
Decl->USR = GetDeclUSR(D);
Decl->Location = SourceLocation(D->getLocation().getRawEncoding());
auto& SM = C->getSourceManager();
auto DecomposedLocStart = SM.getDecomposedLoc(D->getLocation());
Decl->LineNumberStart = SM.getLineNumber(DecomposedLocStart.first, DecomposedLocStart.second);
auto DecomposedLocEnd = SM.getDecomposedLoc(D->getLocEnd());
Decl->LineNumberEnd = SM.getLineNumber(DecomposedLocEnd.first, DecomposedLocEnd.second);
GetLineNumbersFromLocation(D->getLocation(), D->getLocEnd(),
&Decl->LineNumberStart, &Decl->LineNumberEnd);
if (Decl->PreprocessedEntities.empty() && !D->isImplicit())
{

6
src/CppParser/Parser.h

@ -63,7 +63,6 @@ protected: @@ -63,7 +63,6 @@ protected:
// AST traversers
void WalkAST();
void WalkMacros(clang::PreprocessingRecord* PR);
Declaration* WalkDeclaration(clang::Decl* D,
bool IgnoreSystemDecls = true, bool CanBeDefinition = false);
Declaration* WalkDeclarationDef(clang::Decl* D);
@ -103,6 +102,8 @@ protected: @@ -103,6 +102,8 @@ protected:
// Clang helpers
SourceLocationKind GetLocationKind(const clang::SourceLocation& Loc);
void GetLineNumbersFromLocation(const clang::SourceLocation& StartLoc, const clang::SourceLocation& EndLoc,
int* LineNumberStart, int* LineNumberEnd);
bool IsValidDeclaration(const clang::SourceLocation& Loc);
std::string GetDeclMangledName(clang::Decl* D);
std::string GetTypeName(const clang::Type* Type);
@ -120,9 +121,6 @@ protected: @@ -120,9 +121,6 @@ protected:
DeclarationContext* GetNamespace(clang::Decl* D, clang::DeclContext* Ctx);
DeclarationContext* GetNamespace(clang::Decl* D);
clang::CallingConv GetAbiCallConv(clang::CallingConv CC,
bool IsInstMethod, bool IsVariadic);
void HandleDeclaration(clang::Decl* D, Declaration* Decl);
void HandleOriginalText(clang::Decl* D, Declaration* Decl);
void HandleComments(clang::Decl* D, Declaration* Decl);

Loading…
Cancel
Save