当前位置: 首页>>代码示例>>C#>>正文


C# ParserTargetInfo类代码示例

本文整理汇总了C#中ParserTargetInfo的典型用法代码示例。如果您正苦于以下问题:C# ParserTargetInfo类的具体用法?C# ParserTargetInfo怎么用?C# ParserTargetInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ParserTargetInfo类属于命名空间,在下文中一共展示了ParserTargetInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ParserTargetInfo

 protected ParserTargetInfo(ParserTargetInfo.Internal* native, bool skipVTables = false)
 {
     if (native == null)
         return;
     __Instance = new global::System.IntPtr(native);
 }
开发者ID:RainsSoft,项目名称:CppSharp,代码行数:6,代码来源:Target.cs

示例2: __CreateInstance

 public static ParserTargetInfo __CreateInstance(ParserTargetInfo.Internal native, bool skipVTables = false)
 {
     return new ParserTargetInfo(native, skipVTables);
 }
开发者ID:ymlai87416,项目名称:CppSharp,代码行数:4,代码来源:Target.cs

示例3: DumpSizes

        static void DumpSizes(TextWriter writer, ParserTargetInfo target)
        {
            var sizes = new[]
            {
                new { Name = "gint8", Size = target.CharWidth},
                new { Name = "gint16", Size = target.ShortWidth},
                new { Name = "gint32", Size = target.IntWidth},
                new { Name = "gint64", Size = GetTypeSize(target, target.Int64Type)},
                new { Name = "float", Size = target.FloatWidth},
                new { Name = "double", Size = target.DoubleWidth},
                new { Name = "gpointer", Size = GetTypeSize(target, target.IntPtrType)},
            };

            // Write the size info for the basic types.
            foreach (var size in sizes)
                writer.WriteLine("DECL_SIZE2({0},{1})", size.Name, size.Size / 8);
        }
开发者ID:sushihangover,项目名称:playscript,代码行数:17,代码来源:MonoAotOffsetsDumper.cs

示例4: __CopyValue

 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));
     return (ParserTargetInfo.Internal*) ret;
 }
开发者ID:RainsSoft,项目名称:CppSharp,代码行数:6,代码来源:Target.cs

示例5: Dump

        static void Dump(ASTContext ctx, ParserTargetInfo targetInfo, Target target)
        {
            var targetFile = target.Triple;

            if (!string.IsNullOrEmpty (OutputDir))
                targetFile = Path.Combine (OutputDir, targetFile);

            targetFile += ".h";

            using (var writer = new StreamWriter(targetFile))
            //using (var writer = Console.Out)
            {
                writer.WriteLine("#ifndef USED_CROSS_COMPILER_OFFSETS");
                writer.WriteLine("#ifdef {0}", target.Defines[0]);
                writer.WriteLine ("#ifdef {0}", GetTargetPlatformDefine (target.Platform));
                writer.WriteLine("#ifndef HAVE_BOEHM_GC");
                writer.WriteLine("#define HAS_CROSS_COMPILER_OFFSETS");
                writer.WriteLine("#if defined (USE_CROSS_COMPILE_OFFSETS) || defined (MONO_CROSS_COMPILE)");
                writer.WriteLine("#if !defined (DISABLE_METADATA_OFFSETS)");
                writer.WriteLine("#define USED_CROSS_COMPILER_OFFSETS");

                DumpAligns(writer, targetInfo);
                DumpSizes(writer, targetInfo);
                DumpMetadataOffsets(writer, ctx, target);

                writer.WriteLine("#endif //disable metadata check");

                DumpJITOffsets(writer, ctx);

                writer.WriteLine("#endif //cross compiler checks");
                writer.WriteLine("#endif //gc check");
                writer.WriteLine("#endif //os check");
                writer.WriteLine("#endif //arch check");
                writer.WriteLine("#endif //USED_CROSS_COMPILER_OFFSETS check");
            }

            Console.WriteLine("Generated offsets file: {0}", targetFile);
        }
开发者ID:sushihangover,项目名称:playscript,代码行数:38,代码来源:MonoAotOffsetsDumper.cs

示例6: DumpAligns

        static void DumpAligns(TextWriter writer, ParserTargetInfo target)
        {
            var aligns = new[]
            {
                new { Name = "gint8", Align = target.CharAlign},
                new { Name = "gint16", Align = target.ShortAlign},
                new { Name = "gint32", Align = target.IntAlign},
                new { Name = "gint64", Align = GetTypeAlign(target, target.Int64Type)},
                new { Name = "float", Align = target.FloatAlign},
                new { Name = "double", Align = target.DoubleAlign},
                new { Name = "gpointer", Align = GetTypeAlign(target, target.IntPtrType)},
            };

            // Write the alignment info for the basic types.
            foreach (var align in aligns)
                writer.WriteLine("DECL_ALIGN2({0},{1})", align.Name, align.Align / 8);
        }
开发者ID:sushihangover,项目名称:playscript,代码行数:17,代码来源:MonoAotOffsetsDumper.cs

示例7: GetTypeAlign

 static uint GetTypeAlign(ParserTargetInfo target, ParserIntType type)
 {
     switch (type)
     {
         case ParserIntType.SignedChar:
         case ParserIntType.UnsignedChar:
             return target.CharAlign;
         case ParserIntType.SignedShort:
         case ParserIntType.UnsignedShort:
             return target.ShortAlign;
         case ParserIntType.SignedInt:
         case ParserIntType.UnsignedInt:
             return target.IntAlign;
         case ParserIntType.SignedLong:
         case ParserIntType.UnsignedLong:
             return target.LongAlign;
         case ParserIntType.SignedLongLong:
         case ParserIntType.UnsignedLongLong:
             return target.LongLongAlign;
         default:
             throw new Exception("Type has no alignment");
     }
 }
开发者ID:sushihangover,项目名称:playscript,代码行数:23,代码来源:MonoAotOffsetsDumper.cs

示例8: ParserTargetInfo

 private ParserTargetInfo(ParserTargetInfo.Internal native)
     : this(__CopyValue(native))
 {
     __ownsNativeInstance = true;
 }
开发者ID:KonajuGames,项目名称:CppSharp,代码行数:5,代码来源:Target.cs

示例9: ParserTargetInfo

 internal ParserTargetInfo(ParserTargetInfo.Internal* native)
     : this(new global::System.IntPtr(native))
 {
 }
开发者ID:vovkasm,项目名称:CppSharp,代码行数:4,代码来源:Target.cs

示例10: ParserTargetInfo

 protected ParserTargetInfo(ParserTargetInfo.Internal* native, bool isInternalImpl = false)
 {
     __Instance = new global::System.IntPtr(native);
 }
开发者ID:xistoso,项目名称:CppSharp,代码行数:4,代码来源:Target.cs

示例11: __CreateInstance

 public static ParserTargetInfo __CreateInstance(ParserTargetInfo.Internal native)
 {
     return new ParserTargetInfo(native);
 }
开发者ID:xistoso,项目名称:CppSharp,代码行数:4,代码来源:Target.cs

示例12: __CopyValue

 private static void* __CopyValue(ParserTargetInfo.Internal native)
 {
     var ret = Marshal.AllocHGlobal(176);
     CppSharp.Parser.ParserTargetInfo.Internal.cctor_1(ret, new global::System.IntPtr(&native));
     return ret.ToPointer();
 }
开发者ID:ymlai87416,项目名称:CppSharp,代码行数:6,代码来源:Target.cs

示例13: GetTypeSize

 static uint GetTypeSize(ParserTargetInfo target, ParserIntType type)
 {
     switch (type)
     {
         case ParserIntType.SignedChar:
         case ParserIntType.UnsignedChar:
             return target.CharWidth;
         case ParserIntType.SignedShort:
         case ParserIntType.UnsignedShort:
             return target.ShortWidth;
         case ParserIntType.SignedInt:
         case ParserIntType.UnsignedInt:
             return target.IntWidth;
         case ParserIntType.SignedLong:
         case ParserIntType.UnsignedLong:
             return target.LongWidth;
         case ParserIntType.SignedLongLong:
         case ParserIntType.UnsignedLongLong:
             return target.LongLongWidth;
         default:
             throw new Exception("Type has no size");
     }
 }
开发者ID:sushihangover,项目名称:playscript,代码行数:23,代码来源:MonoAotOffsetsDumper.cs

示例14: ParserTargetInfo

 private ParserTargetInfo(ParserTargetInfo.Internal native, bool skipVTables = false)
     : this(__CopyValue(native), skipVTables)
 {
     __ownsNativeInstance = true;
     NativeToManagedMap[__Instance] = this;
 }
开发者ID:ymlai87416,项目名称:CppSharp,代码行数:6,代码来源:Target.cs

示例15: ParserTargetInfo

 internal ParserTargetInfo(ParserTargetInfo.Internal native)
     : this(&native)
 {
 }
开发者ID:kidleon,项目名称:CppSharp,代码行数:4,代码来源:Target.cs


注:本文中的ParserTargetInfo类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。