本文整理汇总了C#中IType.GetRttiStringName方法的典型用法代码示例。如果您正苦于以下问题:C# IType.GetRttiStringName方法的具体用法?C# IType.GetRttiStringName怎么用?C# IType.GetRttiStringName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IType
的用法示例。
在下文中一共展示了IType.GetRttiStringName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WriteRttiClassInfoDefinition
/// <summary>
/// </summary>
/// <param name="type">
/// </param>
/// <param name="llvmWriter">
/// </param>
public static void WriteRttiClassInfoDefinition(IType type, LlvmWriter llvmWriter)
{
var writer = llvmWriter.Output;
writer.WriteLine("{");
writer.Indent++;
writer.WriteLine("i8* bitcast (i8** getelementptr inbounds (i8** @_ZTVN10__cxxabiv117__class_type_infoE, i32 2) to i8*),");
writer.WriteLine("i8* getelementptr inbounds ([{1} x i8]* @\"{0}\", i32 0, i32 0)", type.GetRttiStringName(), type.StringLength());
writer.Indent--;
writer.WriteLine("}");
}
示例2: WriteRttiClassInfoDefinition
/// <summary>
/// </summary>
/// <param name="type">
/// </param>
/// <param name="llvmWriter">
/// </param>
public static void WriteRttiClassInfoDefinition(IType type, LlvmWriter llvmWriter)
{
var writer = llvmWriter.Output;
writer.WriteLine("{");
writer.Indent++;
writer.WriteLine("i8* bitcast (i8** getelementptr inbounds (i8** @_ZTVN10__cxxabiv120__si_class_type_infoE, i32 2) to i8*),");
writer.WriteLine("i8* getelementptr inbounds ([{1} x i8]* @\"{0}\", i32 0, i32 0),", type.GetRttiStringName(), type.StringLength());
writer.Write("i8* bitcast (");
var singleInheritanceType = type.GetInterfaces().First();
singleInheritanceType.WriteRttiClassInfoDeclaration(writer);
writer.WriteLine("* @\"{0}\" to i8*)", singleInheritanceType.GetRttiInfoName());
writer.Indent--;
writer.WriteLine("}");
}
示例3: WriteRttiClassInfoDefinition
/// <summary>
/// </summary>
/// <param name="type">
/// </param>
/// <param name="llvmWriter">
/// </param>
public static void WriteRttiClassInfoDefinition(IType type, LlvmWriter llvmWriter)
{
var writer = llvmWriter.Output;
var @interfaces = type.GetInterfaces();
writer.WriteLine("{");
writer.Indent++;
writer.WriteLine(
"i8* bitcast (i8** getelementptr inbounds (i8** @_ZTVN10__cxxabiv121__vmi_class_type_infoE, i32 2) to i8*),");
writer.WriteLine(
"i8* getelementptr inbounds ([{1} x i8]* @\"{0}\", i32 0, i32 0),",
type.GetRttiStringName(),
type.StringLength());
writer.WriteLine("i32 0,");
writer.WriteLine("i32 {0}", @interfaces.Count() + (type.BaseType != null ? 1 : 0));
var nextFlag = 2;
if (type.BaseType != null)
{
writer.Write(",i8* bitcast (");
type.BaseType.WriteRttiClassInfoDeclaration(writer);
writer.WriteLine("* @\"{0}\" to i8*),", type.BaseType.GetRttiInfoName());
// if class does not have any virtual method then next value should be 0, else 2 (and next class should be +1024)
writer.WriteLine("i32 {0}", nextFlag);
// apply fields shift + base item
// nextFlag += 1024 * (type.BaseType.GetFieldsShift() + 1);
nextFlag += 1024 * (type.BaseType.GetTypeSize(llvmWriter) / LlvmWriter.PointerSize);
}
foreach (var @interface in type.GetInterfaces())
{
writer.Write(",i8* bitcast (");
@interface.WriteRttiClassInfoDeclaration(writer);
writer.WriteLine("* @\"{0}\" to i8*),", @interface.GetRttiInfoName());
writer.WriteLine("i32 {0}", nextFlag);
nextFlag += 1024;
}
writer.Indent--;
writer.WriteLine("}");
}