diff --git a/src/AST/Expr.cs b/src/AST/Expr.cs index 341d1dac..db64252b 100644 --- a/src/AST/Expr.cs +++ b/src/AST/Expr.cs @@ -434,6 +434,7 @@ namespace CppSharp.AST } public SourceLocation Location; + public ulong Value; } public partial class FixedPointLiteral : Expr @@ -443,6 +444,7 @@ namespace CppSharp.AST } public SourceLocation Location; + public ulong Value; } public partial class CharacterLiteral : Expr diff --git a/src/CppParser/Bindings/CLI/Expr.cpp b/src/CppParser/Bindings/CLI/Expr.cpp index 1900a7a4..e428d46f 100644 --- a/src/CppParser/Bindings/CLI/Expr.cpp +++ b/src/CppParser/Bindings/CLI/Expr.cpp @@ -636,6 +636,16 @@ void CppSharp::Parser::AST::IntegerLiteral::Location::set(CppSharp::Parser::Sour ((::CppSharp::CppParser::AST::IntegerLiteral*)NativePtr)->location = _marshal0; } +unsigned long long CppSharp::Parser::AST::IntegerLiteral::Value::get() +{ + return ((::CppSharp::CppParser::AST::IntegerLiteral*)NativePtr)->value; +} + +void CppSharp::Parser::AST::IntegerLiteral::Value::set(unsigned long long value) +{ + ((::CppSharp::CppParser::AST::IntegerLiteral*)NativePtr)->value = value; +} + CppSharp::Parser::AST::FixedPointLiteral::FixedPointLiteral(::CppSharp::CppParser::AST::FixedPointLiteral* native) : CppSharp::Parser::AST::Expr((::CppSharp::CppParser::AST::Expr*)native) { @@ -679,6 +689,16 @@ void CppSharp::Parser::AST::FixedPointLiteral::Location::set(CppSharp::Parser::S ((::CppSharp::CppParser::AST::FixedPointLiteral*)NativePtr)->location = _marshal0; } +unsigned long long CppSharp::Parser::AST::FixedPointLiteral::Value::get() +{ + return ((::CppSharp::CppParser::AST::FixedPointLiteral*)NativePtr)->value; +} + +void CppSharp::Parser::AST::FixedPointLiteral::Value::set(unsigned long long value) +{ + ((::CppSharp::CppParser::AST::FixedPointLiteral*)NativePtr)->value = value; +} + CppSharp::Parser::AST::CharacterLiteral::CharacterLiteral(::CppSharp::CppParser::AST::CharacterLiteral* native) : CppSharp::Parser::AST::Expr((::CppSharp::CppParser::AST::Expr*)native) { diff --git a/src/CppParser/Bindings/CLI/Expr.h b/src/CppParser/Bindings/CLI/Expr.h index 3ef13cf3..a9f9083c 100644 --- a/src/CppParser/Bindings/CLI/Expr.h +++ b/src/CppParser/Bindings/CLI/Expr.h @@ -741,6 +741,12 @@ namespace CppSharp CppSharp::Parser::SourceLocation get(); void set(CppSharp::Parser::SourceLocation); } + + property unsigned long long Value + { + unsigned long long get(); + void set(unsigned long long); + } }; public ref class FixedPointLiteral : CppSharp::Parser::AST::Expr @@ -760,6 +766,12 @@ namespace CppSharp CppSharp::Parser::SourceLocation get(); void set(CppSharp::Parser::SourceLocation); } + + property unsigned long long Value + { + unsigned long long get(); + void set(unsigned long long); + } }; public ref class CharacterLiteral : CppSharp::Parser::AST::Expr diff --git a/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/CppSharp.CppParser.cs b/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/CppSharp.CppParser.cs index b0b3fa43..4f3ab48d 100644 --- a/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/CppSharp.CppParser.cs +++ b/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/CppSharp.CppParser.cs @@ -24832,7 +24832,7 @@ namespace CppSharp public unsafe partial class IntegerLiteral : global::CppSharp.Parser.AST.Expr, IDisposable { - [StructLayout(LayoutKind.Explicit, Size = 44)] + [StructLayout(LayoutKind.Explicit, Size = 52)] public new partial struct __Internal { [FieldOffset(0)] @@ -24880,6 +24880,9 @@ namespace CppSharp [FieldOffset(40)] internal global::CppSharp.Parser.SourceLocation.__Internal location; + [FieldOffset(44)] + internal ulong value; + [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint="_ZN8CppSharp9CppParser3AST14IntegerLiteralC2Ev")] @@ -24954,11 +24957,24 @@ namespace CppSharp ((global::CppSharp.Parser.AST.IntegerLiteral.__Internal*)__Instance)->location = value.__Instance; } } + + public ulong Value + { + get + { + return ((global::CppSharp.Parser.AST.IntegerLiteral.__Internal*) __Instance)->value; + } + + set + { + ((global::CppSharp.Parser.AST.IntegerLiteral.__Internal*)__Instance)->value = value; + } + } } public unsafe partial class FixedPointLiteral : global::CppSharp.Parser.AST.Expr, IDisposable { - [StructLayout(LayoutKind.Explicit, Size = 44)] + [StructLayout(LayoutKind.Explicit, Size = 52)] public new partial struct __Internal { [FieldOffset(0)] @@ -25006,6 +25022,9 @@ namespace CppSharp [FieldOffset(40)] internal global::CppSharp.Parser.SourceLocation.__Internal location; + [FieldOffset(44)] + internal ulong value; + [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint="_ZN8CppSharp9CppParser3AST17FixedPointLiteralC2Ev")] @@ -25080,6 +25099,19 @@ namespace CppSharp ((global::CppSharp.Parser.AST.FixedPointLiteral.__Internal*)__Instance)->location = value.__Instance; } } + + public ulong Value + { + get + { + return ((global::CppSharp.Parser.AST.FixedPointLiteral.__Internal*) __Instance)->value; + } + + set + { + ((global::CppSharp.Parser.AST.FixedPointLiteral.__Internal*)__Instance)->value = value; + } + } } public unsafe partial class CharacterLiteral : global::CppSharp.Parser.AST.Expr, IDisposable diff --git a/src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/CppSharp.CppParser.cs b/src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/CppSharp.CppParser.cs index c13c0411..f9aa9060 100644 --- a/src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/CppSharp.CppParser.cs +++ b/src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/CppSharp.CppParser.cs @@ -24832,7 +24832,7 @@ namespace CppSharp public unsafe partial class IntegerLiteral : global::CppSharp.Parser.AST.Expr, IDisposable { - [StructLayout(LayoutKind.Explicit, Size = 44)] + [StructLayout(LayoutKind.Explicit, Size = 56)] public new partial struct __Internal { [FieldOffset(0)] @@ -24880,6 +24880,9 @@ namespace CppSharp [FieldOffset(40)] internal global::CppSharp.Parser.SourceLocation.__Internal location; + [FieldOffset(48)] + internal ulong value; + [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall, EntryPoint="??0IntegerLiteral@AST@CppParser@CppSharp@@QAE@XZ")] @@ -24954,11 +24957,24 @@ namespace CppSharp ((global::CppSharp.Parser.AST.IntegerLiteral.__Internal*)__Instance)->location = value.__Instance; } } + + public ulong Value + { + get + { + return ((global::CppSharp.Parser.AST.IntegerLiteral.__Internal*) __Instance)->value; + } + + set + { + ((global::CppSharp.Parser.AST.IntegerLiteral.__Internal*)__Instance)->value = value; + } + } } public unsafe partial class FixedPointLiteral : global::CppSharp.Parser.AST.Expr, IDisposable { - [StructLayout(LayoutKind.Explicit, Size = 44)] + [StructLayout(LayoutKind.Explicit, Size = 56)] public new partial struct __Internal { [FieldOffset(0)] @@ -25006,6 +25022,9 @@ namespace CppSharp [FieldOffset(40)] internal global::CppSharp.Parser.SourceLocation.__Internal location; + [FieldOffset(48)] + internal ulong value; + [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall, EntryPoint="??0FixedPointLiteral@AST@CppParser@CppSharp@@QAE@XZ")] @@ -25080,6 +25099,19 @@ namespace CppSharp ((global::CppSharp.Parser.AST.FixedPointLiteral.__Internal*)__Instance)->location = value.__Instance; } } + + public ulong Value + { + get + { + return ((global::CppSharp.Parser.AST.FixedPointLiteral.__Internal*) __Instance)->value; + } + + set + { + ((global::CppSharp.Parser.AST.FixedPointLiteral.__Internal*)__Instance)->value = value; + } + } } public unsafe partial class CharacterLiteral : global::CppSharp.Parser.AST.Expr, IDisposable diff --git a/src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/CppSharp.CppParser.cs b/src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/CppSharp.CppParser.cs index b40562cb..53cbbbd5 100644 --- a/src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/CppSharp.CppParser.cs +++ b/src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/CppSharp.CppParser.cs @@ -24831,7 +24831,7 @@ namespace CppSharp public unsafe partial class IntegerLiteral : global::CppSharp.Parser.AST.Expr, IDisposable { - [StructLayout(LayoutKind.Explicit, Size = 56)] + [StructLayout(LayoutKind.Explicit, Size = 64)] public new partial struct __Internal { [FieldOffset(0)] @@ -24879,6 +24879,9 @@ namespace CppSharp [FieldOffset(48)] internal global::CppSharp.Parser.SourceLocation.__Internal location; + [FieldOffset(56)] + internal ulong value; + [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint="_ZN8CppSharp9CppParser3AST14IntegerLiteralC2Ev")] @@ -24953,11 +24956,24 @@ namespace CppSharp ((global::CppSharp.Parser.AST.IntegerLiteral.__Internal*)__Instance)->location = value.__Instance; } } + + public ulong Value + { + get + { + return ((global::CppSharp.Parser.AST.IntegerLiteral.__Internal*) __Instance)->value; + } + + set + { + ((global::CppSharp.Parser.AST.IntegerLiteral.__Internal*)__Instance)->value = value; + } + } } public unsafe partial class FixedPointLiteral : global::CppSharp.Parser.AST.Expr, IDisposable { - [StructLayout(LayoutKind.Explicit, Size = 56)] + [StructLayout(LayoutKind.Explicit, Size = 64)] public new partial struct __Internal { [FieldOffset(0)] @@ -25005,6 +25021,9 @@ namespace CppSharp [FieldOffset(48)] internal global::CppSharp.Parser.SourceLocation.__Internal location; + [FieldOffset(56)] + internal ulong value; + [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint="_ZN8CppSharp9CppParser3AST17FixedPointLiteralC2Ev")] @@ -25079,6 +25098,19 @@ namespace CppSharp ((global::CppSharp.Parser.AST.FixedPointLiteral.__Internal*)__Instance)->location = value.__Instance; } } + + public ulong Value + { + get + { + return ((global::CppSharp.Parser.AST.FixedPointLiteral.__Internal*) __Instance)->value; + } + + set + { + ((global::CppSharp.Parser.AST.FixedPointLiteral.__Internal*)__Instance)->value = value; + } + } } public unsafe partial class CharacterLiteral : global::CppSharp.Parser.AST.Expr, IDisposable diff --git a/src/CppParser/Bindings/CSharp/x86_64-linux-gnu-cxx11abi/CppSharp.CppParser.cs b/src/CppParser/Bindings/CSharp/x86_64-linux-gnu-cxx11abi/CppSharp.CppParser.cs index 65a4cb5c..704ae20b 100644 --- a/src/CppParser/Bindings/CSharp/x86_64-linux-gnu-cxx11abi/CppSharp.CppParser.cs +++ b/src/CppParser/Bindings/CSharp/x86_64-linux-gnu-cxx11abi/CppSharp.CppParser.cs @@ -24831,7 +24831,7 @@ namespace CppSharp public unsafe partial class IntegerLiteral : global::CppSharp.Parser.AST.Expr, IDisposable { - [StructLayout(LayoutKind.Explicit, Size = 56)] + [StructLayout(LayoutKind.Explicit, Size = 64)] public new partial struct __Internal { [FieldOffset(0)] @@ -24879,6 +24879,9 @@ namespace CppSharp [FieldOffset(48)] internal global::CppSharp.Parser.SourceLocation.__Internal location; + [FieldOffset(56)] + internal ulong value; + [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint="_ZN8CppSharp9CppParser3AST14IntegerLiteralC2Ev")] @@ -24953,11 +24956,24 @@ namespace CppSharp ((global::CppSharp.Parser.AST.IntegerLiteral.__Internal*)__Instance)->location = value.__Instance; } } + + public ulong Value + { + get + { + return ((global::CppSharp.Parser.AST.IntegerLiteral.__Internal*) __Instance)->value; + } + + set + { + ((global::CppSharp.Parser.AST.IntegerLiteral.__Internal*)__Instance)->value = value; + } + } } public unsafe partial class FixedPointLiteral : global::CppSharp.Parser.AST.Expr, IDisposable { - [StructLayout(LayoutKind.Explicit, Size = 56)] + [StructLayout(LayoutKind.Explicit, Size = 64)] public new partial struct __Internal { [FieldOffset(0)] @@ -25005,6 +25021,9 @@ namespace CppSharp [FieldOffset(48)] internal global::CppSharp.Parser.SourceLocation.__Internal location; + [FieldOffset(56)] + internal ulong value; + [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint="_ZN8CppSharp9CppParser3AST17FixedPointLiteralC2Ev")] @@ -25079,6 +25098,19 @@ namespace CppSharp ((global::CppSharp.Parser.AST.FixedPointLiteral.__Internal*)__Instance)->location = value.__Instance; } } + + public ulong Value + { + get + { + return ((global::CppSharp.Parser.AST.FixedPointLiteral.__Internal*) __Instance)->value; + } + + set + { + ((global::CppSharp.Parser.AST.FixedPointLiteral.__Internal*)__Instance)->value = value; + } + } } public unsafe partial class CharacterLiteral : global::CppSharp.Parser.AST.Expr, IDisposable diff --git a/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/CppSharp.CppParser.cs b/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/CppSharp.CppParser.cs index 13d151bf..c1539c1d 100644 --- a/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/CppSharp.CppParser.cs +++ b/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/CppSharp.CppParser.cs @@ -24831,7 +24831,7 @@ namespace CppSharp public unsafe partial class IntegerLiteral : global::CppSharp.Parser.AST.Expr, IDisposable { - [StructLayout(LayoutKind.Explicit, Size = 56)] + [StructLayout(LayoutKind.Explicit, Size = 64)] public new partial struct __Internal { [FieldOffset(0)] @@ -24879,6 +24879,9 @@ namespace CppSharp [FieldOffset(48)] internal global::CppSharp.Parser.SourceLocation.__Internal location; + [FieldOffset(56)] + internal ulong value; + [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint="_ZN8CppSharp9CppParser3AST14IntegerLiteralC2Ev")] @@ -24953,11 +24956,24 @@ namespace CppSharp ((global::CppSharp.Parser.AST.IntegerLiteral.__Internal*)__Instance)->location = value.__Instance; } } + + public ulong Value + { + get + { + return ((global::CppSharp.Parser.AST.IntegerLiteral.__Internal*) __Instance)->value; + } + + set + { + ((global::CppSharp.Parser.AST.IntegerLiteral.__Internal*)__Instance)->value = value; + } + } } public unsafe partial class FixedPointLiteral : global::CppSharp.Parser.AST.Expr, IDisposable { - [StructLayout(LayoutKind.Explicit, Size = 56)] + [StructLayout(LayoutKind.Explicit, Size = 64)] public new partial struct __Internal { [FieldOffset(0)] @@ -25005,6 +25021,9 @@ namespace CppSharp [FieldOffset(48)] internal global::CppSharp.Parser.SourceLocation.__Internal location; + [FieldOffset(56)] + internal ulong value; + [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint="_ZN8CppSharp9CppParser3AST17FixedPointLiteralC2Ev")] @@ -25079,6 +25098,19 @@ namespace CppSharp ((global::CppSharp.Parser.AST.FixedPointLiteral.__Internal*)__Instance)->location = value.__Instance; } } + + public ulong Value + { + get + { + return ((global::CppSharp.Parser.AST.FixedPointLiteral.__Internal*) __Instance)->value; + } + + set + { + ((global::CppSharp.Parser.AST.FixedPointLiteral.__Internal*)__Instance)->value = value; + } + } } public unsafe partial class CharacterLiteral : global::CppSharp.Parser.AST.Expr, IDisposable diff --git a/src/CppParser/Bindings/CSharp/x86_64-pc-win32-msvc/CppSharp.CppParser.cs b/src/CppParser/Bindings/CSharp/x86_64-pc-win32-msvc/CppSharp.CppParser.cs index 8f342b3e..a6006bca 100644 --- a/src/CppParser/Bindings/CSharp/x86_64-pc-win32-msvc/CppSharp.CppParser.cs +++ b/src/CppParser/Bindings/CSharp/x86_64-pc-win32-msvc/CppSharp.CppParser.cs @@ -24832,7 +24832,7 @@ namespace CppSharp public unsafe partial class IntegerLiteral : global::CppSharp.Parser.AST.Expr, IDisposable { - [StructLayout(LayoutKind.Explicit, Size = 56)] + [StructLayout(LayoutKind.Explicit, Size = 64)] public new partial struct __Internal { [FieldOffset(0)] @@ -24880,6 +24880,9 @@ namespace CppSharp [FieldOffset(48)] internal global::CppSharp.Parser.SourceLocation.__Internal location; + [FieldOffset(56)] + internal ulong value; + [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint="??0IntegerLiteral@AST@CppParser@CppSharp@@QEAA@XZ")] @@ -24954,11 +24957,24 @@ namespace CppSharp ((global::CppSharp.Parser.AST.IntegerLiteral.__Internal*)__Instance)->location = value.__Instance; } } + + public ulong Value + { + get + { + return ((global::CppSharp.Parser.AST.IntegerLiteral.__Internal*) __Instance)->value; + } + + set + { + ((global::CppSharp.Parser.AST.IntegerLiteral.__Internal*)__Instance)->value = value; + } + } } public unsafe partial class FixedPointLiteral : global::CppSharp.Parser.AST.Expr, IDisposable { - [StructLayout(LayoutKind.Explicit, Size = 56)] + [StructLayout(LayoutKind.Explicit, Size = 64)] public new partial struct __Internal { [FieldOffset(0)] @@ -25006,6 +25022,9 @@ namespace CppSharp [FieldOffset(48)] internal global::CppSharp.Parser.SourceLocation.__Internal location; + [FieldOffset(56)] + internal ulong value; + [SuppressUnmanagedCodeSecurity] [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint="??0FixedPointLiteral@AST@CppParser@CppSharp@@QEAA@XZ")] @@ -25080,6 +25099,19 @@ namespace CppSharp ((global::CppSharp.Parser.AST.FixedPointLiteral.__Internal*)__Instance)->location = value.__Instance; } } + + public ulong Value + { + get + { + return ((global::CppSharp.Parser.AST.FixedPointLiteral.__Internal*) __Instance)->value; + } + + set + { + ((global::CppSharp.Parser.AST.FixedPointLiteral.__Internal*)__Instance)->value = value; + } + } } public unsafe partial class CharacterLiteral : global::CppSharp.Parser.AST.Expr, IDisposable diff --git a/src/CppParser/Bootstrap/Bootstrap.cs b/src/CppParser/Bootstrap/Bootstrap.cs index 3b9ffad6..9038a23c 100644 --- a/src/CppParser/Bootstrap/Bootstrap.cs +++ b/src/CppParser/Bootstrap/Bootstrap.cs @@ -294,6 +294,40 @@ namespace CppSharp if (@base.Class.Name.Contains("TrailingObjects")) @base.ExplicitlyIgnore(); + + if (@base.Class.Name == "APIntStorage") + { + @base.ExplicitlyIgnore(); + + var property = new Property + { + Access = AccessSpecifier.Public, + Name = "value", + Namespace = @class, + QualifiedType = new QualifiedType( + new BuiltinType(PrimitiveType.ULongLong)) + }; + + if (!@class.Properties.Exists(p => p.Name == property.Name)) + @class.Properties.Add(property); + } + + if (@base.Class.Name == "APFloatStorage") + { + @base.ExplicitlyIgnore(); + + var property = new Property + { + Access = AccessSpecifier.Public, + Name = "value", + Namespace = @class, + QualifiedType = new QualifiedType( + new BuiltinType(PrimitiveType.LongDouble)) + }; + + if (!@class.Properties.Exists(p => p.Name == property.Name)) + @class.Properties.Add(property); + } } // @@ -1146,7 +1180,7 @@ namespace CppSharp { var typeName = GetDeclTypeName(property); var fieldName = GetDeclName(property); - var methodName = property.GetMethod.Name; + var methodName = property.GetMethod?.Name; var validMethod = $"is{FirstLetterToUpperCase(property.Name)}"; var @class = property.Namespace as Class; @@ -1179,7 +1213,12 @@ namespace CppSharp WriteLine($"_S->{fieldName} = WalkTemplateArgument(S->{methodName}());"); else if (typeName.Contains("QualifiedType")) WriteLine($"_S->{fieldName} = GetQualifiedType(S->{methodName}());"); - else + else if (fieldName == "value" && @class.Bases.Exists(b => b.Class.Name.Contains("AP"))) { + // Use llvm::APInt or llvm::APFloat conversion methods + methodName = property.Type.IsPrimitiveType(PrimitiveType.ULongLong) ? + "getLimitedValue" : "convertToDouble"; + WriteLine($"_S->{fieldName} = S->getValue().{methodName}();"); + } else WriteLine($"_S->{fieldName} = S->{methodName}();"); if (validMethodExists) @@ -1344,12 +1383,7 @@ namespace CppSharp if (property.Access != AccessSpecifier.Public) return true; - if (property.GetMethod == null) - return true; - var @class = property.Namespace as Class; - if (property.GetMethod.Namespace != @class) - return true; if (!skipBaseCheck) { diff --git a/src/CppParser/Expr.cpp b/src/CppParser/Expr.cpp index 1308ea8d..45747d56 100644 --- a/src/CppParser/Expr.cpp +++ b/src/CppParser/Expr.cpp @@ -91,12 +91,14 @@ DeclRefExpr::DeclRefExpr() IntegerLiteral::IntegerLiteral() : Expr(StmtClass::IntegerLiteral) , location(SourceLocation()) + , value(0) { } FixedPointLiteral::FixedPointLiteral() : Expr(StmtClass::FixedPointLiteral) , location(SourceLocation()) + , value(0) { } diff --git a/src/CppParser/Expr.h b/src/CppParser/Expr.h index 6d3d488d..b33821aa 100644 --- a/src/CppParser/Expr.h +++ b/src/CppParser/Expr.h @@ -376,6 +376,7 @@ class CS_API IntegerLiteral : public Expr public: IntegerLiteral(); SourceLocation location; + unsigned long long value; }; class CS_API FixedPointLiteral : public Expr @@ -383,6 +384,7 @@ class CS_API FixedPointLiteral : public Expr public: FixedPointLiteral(); SourceLocation location; + unsigned long long value; }; class CS_API CharacterLiteral : public Expr diff --git a/src/CppParser/ParseExpr.cpp b/src/CppParser/ParseExpr.cpp index f884fbc1..c6bbee6c 100644 --- a/src/CppParser/ParseExpr.cpp +++ b/src/CppParser/ParseExpr.cpp @@ -97,6 +97,7 @@ AST::Expr* Parser::WalkExpression(const clang::Expr* Expr) _S->isXValue = S->isXValue(); _S->isGLValue = S->isGLValue(); _S->isOrdinaryOrBitFieldObject = S->isOrdinaryOrBitFieldObject(); + _S->value = S->getValue().getLimitedValue(); _Expr = _S; break; } @@ -114,6 +115,7 @@ AST::Expr* Parser::WalkExpression(const clang::Expr* Expr) _S->isXValue = S->isXValue(); _S->isGLValue = S->isGLValue(); _S->isOrdinaryOrBitFieldObject = S->isOrdinaryOrBitFieldObject(); + _S->value = S->getValue().getLimitedValue(); _Expr = _S; break; } diff --git a/src/Parser/ASTConverter.Expr.cs b/src/Parser/ASTConverter.Expr.cs index 150a17c3..019c4d9b 100644 --- a/src/Parser/ASTConverter.Expr.cs +++ b/src/Parser/ASTConverter.Expr.cs @@ -690,6 +690,7 @@ namespace CppSharp _expr.IsGLValue = expr.IsGLValue; _expr.IsOrdinaryOrBitFieldObject = expr.IsOrdinaryOrBitFieldObject; _expr.Location = VisitSourceLocation(expr.Location); + _expr.Value = expr.Value; return _expr; } @@ -710,6 +711,7 @@ namespace CppSharp _expr.IsGLValue = expr.IsGLValue; _expr.IsOrdinaryOrBitFieldObject = expr.IsOrdinaryOrBitFieldObject; _expr.Location = VisitSourceLocation(expr.Location); + _expr.Value = expr.Value; return _expr; }