本文整理汇总了C#中WellKnownType类的典型用法代码示例。如果您正苦于以下问题:C# WellKnownType类的具体用法?C# WellKnownType怎么用?C# WellKnownType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WellKnownType类属于命名空间,在下文中一共展示了WellKnownType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetWellKnownTypeSignatureName
private void SetWellKnownTypeSignatureName(WellKnownType wellKnownType, string mangledSignatureName)
{
var type = _compilation.TypeSystemContext.GetWellKnownType(wellKnownType);
var typeNode = _compilation.NodeFactory.ConstructedTypeSymbol(type);
_cppSignatureNames.Add(type, mangledSignatureName);
}
示例2: SetWellKnownType
internal void SetWellKnownType(WellKnownType wellKnownType)
{
TypeFlags flags;
switch (wellKnownType)
{
case WellKnownType.Void:
case WellKnownType.Boolean:
case WellKnownType.Char:
case WellKnownType.SByte:
case WellKnownType.Byte:
case WellKnownType.Int16:
case WellKnownType.UInt16:
case WellKnownType.Int32:
case WellKnownType.UInt32:
case WellKnownType.Int64:
case WellKnownType.UInt64:
case WellKnownType.IntPtr:
case WellKnownType.UIntPtr:
case WellKnownType.Single:
case WellKnownType.Double:
flags = (TypeFlags)wellKnownType;
break;
case WellKnownType.ValueType:
case WellKnownType.Enum:
flags = TypeFlags.Class;
break;
case WellKnownType.Nullable:
flags = TypeFlags.Nullable;
break;
case WellKnownType.Object:
case WellKnownType.String:
case WellKnownType.Array:
case WellKnownType.MulticastDelegate:
case WellKnownType.Exception:
flags = TypeFlags.Class;
break;
case WellKnownType.RuntimeTypeHandle:
case WellKnownType.RuntimeMethodHandle:
case WellKnownType.RuntimeFieldHandle:
flags = TypeFlags.ValueType;
break;
default:
throw new ArgumentException();
}
_typeFlags = flags;
}
示例3: GetWellKnownType
public override DefType GetWellKnownType(WellKnownType wellKnownType)
{
return _wellKnownTypes[(int)wellKnownType - 1];
}
示例4: GetWellKnownType
public override DefType GetWellKnownType(WellKnownType wellKnownType)
{
switch (wellKnownType)
{
case WellKnownType.Void:
return (DefType)ResolveRuntimeTypeHandle(typeof(void).TypeHandle);
case WellKnownType.Boolean:
return (DefType)ResolveRuntimeTypeHandle(typeof(Boolean).TypeHandle);
case WellKnownType.Char:
return (DefType)ResolveRuntimeTypeHandle(typeof(Char).TypeHandle);
case WellKnownType.SByte:
return (DefType)ResolveRuntimeTypeHandle(typeof(SByte).TypeHandle);
case WellKnownType.Byte:
return (DefType)ResolveRuntimeTypeHandle(typeof(Byte).TypeHandle);
case WellKnownType.Int16:
return (DefType)ResolveRuntimeTypeHandle(typeof(Int16).TypeHandle);
case WellKnownType.UInt16:
return (DefType)ResolveRuntimeTypeHandle(typeof(UInt16).TypeHandle);
case WellKnownType.Int32:
return (DefType)ResolveRuntimeTypeHandle(typeof(Int32).TypeHandle);
case WellKnownType.UInt32:
return (DefType)ResolveRuntimeTypeHandle(typeof(UInt32).TypeHandle);
case WellKnownType.Int64:
return (DefType)ResolveRuntimeTypeHandle(typeof(Int64).TypeHandle);
case WellKnownType.UInt64:
return (DefType)ResolveRuntimeTypeHandle(typeof(UInt64).TypeHandle);
case WellKnownType.IntPtr:
return (DefType)ResolveRuntimeTypeHandle(typeof(IntPtr).TypeHandle);
case WellKnownType.UIntPtr:
return (DefType)ResolveRuntimeTypeHandle(typeof(UIntPtr).TypeHandle);
case WellKnownType.Single:
return (DefType)ResolveRuntimeTypeHandle(typeof(Single).TypeHandle);
case WellKnownType.Double:
return (DefType)ResolveRuntimeTypeHandle(typeof(Double).TypeHandle);
case WellKnownType.ValueType:
return (DefType)ResolveRuntimeTypeHandle(typeof(ValueType).TypeHandle);
case WellKnownType.Enum:
return (DefType)ResolveRuntimeTypeHandle(typeof(Enum).TypeHandle);
case WellKnownType.Nullable:
return (DefType)ResolveRuntimeTypeHandle(typeof(Nullable<>).TypeHandle);
case WellKnownType.Object:
return (DefType)ResolveRuntimeTypeHandle(typeof(Object).TypeHandle);
case WellKnownType.String:
return (DefType)ResolveRuntimeTypeHandle(typeof(String).TypeHandle);
case WellKnownType.Array:
return (DefType)ResolveRuntimeTypeHandle(typeof(Array).TypeHandle);
case WellKnownType.MulticastDelegate:
return (DefType)ResolveRuntimeTypeHandle(typeof(MulticastDelegate).TypeHandle);
case WellKnownType.RuntimeTypeHandle:
return (DefType)ResolveRuntimeTypeHandle(typeof(RuntimeTypeHandle).TypeHandle);
case WellKnownType.RuntimeMethodHandle:
return (DefType)ResolveRuntimeTypeHandle(typeof(RuntimeMethodHandle).TypeHandle);
case WellKnownType.RuntimeFieldHandle:
return (DefType)ResolveRuntimeTypeHandle(typeof(RuntimeFieldHandle).TypeHandle);
case WellKnownType.Exception:
return (DefType)ResolveRuntimeTypeHandle(typeof(Exception).TypeHandle);
default:
throw new NotImplementedException();
}
}
示例5: ImportStoreIndirect
private void ImportStoreIndirect(WellKnownType wellKnownType)
{
ImportStoreIndirect(GetWellKnownType(wellKnownType));
}
示例6: WellKnownType
public NamedTypeSymbol WellKnownType(WellKnownType wt)
{
NamedTypeSymbol wellKnownType = Compilation.GetWellKnownType(wt);
Binder.ReportUseSiteDiagnostics(wellKnownType, Diagnostics, Syntax);
return wellKnownType;
}
示例7: TopLevel
public TopLevel(ModuleSymbol module, ref MetadataTypeName fullName, WellKnownType wellKnownType)
: this(module, ref fullName, (int)wellKnownType)
{
}
示例8: ImportConvert
private void ImportConvert(WellKnownType wellKnownType, bool checkOverflow, bool unsigned)
{
var op = _stack.Pop();
TypeDesc type = GetWellKnownType(wellKnownType);
PushTemp(GetStackValueKind(type));
Append("(");
Append(_writer.GetCppSignatureTypeName(type));
Append(")");
Append(op);
AppendSemicolon();
}
示例9: ImportLoadIndirect
void ImportLoadIndirect(WellKnownType wellKnownType)
{
ImportLoadIndirect(GetWellKnownType(wellKnownType));
}
示例10: ImportLoadElement
void ImportLoadElement(WellKnownType wellKnownType)
{
ImportLoadElement(GetWellKnownType(wellKnownType));
}
示例11: GetWellKnownType
public override DefType GetWellKnownType(WellKnownType wellKnownType)
{
Debug.Assert(_wellKnownTypes != null, "Forgot to call SetSystemModule?");
return _wellKnownTypes[(int)wellKnownType - 1];
}
示例12: RootWellKnownType
private void RootWellKnownType(WellKnownType wellKnownType, IRootingServiceProvider rootProvider)
{
var type = _context.GetWellKnownType(wellKnownType);
rootProvider.AddCompilationRoot(type, "Enables CPP codegen");
}
示例13: AddWellKnownType
private void AddWellKnownType(WellKnownType wellKnownType, DependencyAnalysisFramework.DependencyAnalyzerBase<NodeFactory> graph)
{
var type = TypeSystemContext.GetWellKnownType(wellKnownType);
var typeNode = ConstructedTypeSymbol(type);
graph.AddRoot(typeNode, "Enables CPP codegen");
}
示例14: SetWellKnownTypeSignatureName
private void SetWellKnownTypeSignatureName(WellKnownType wellKnownType, string mangledSignatureName)
{
var type = _compilation.TypeSystemContext.GetWellKnownType(wellKnownType);
_cppSignatureNames.Add(type, mangledSignatureName);
}
示例15: TopLevelWithCustomErrorInfo
public TopLevelWithCustomErrorInfo(ModuleSymbol module, ref MetadataTypeName emittedName, DiagnosticInfo errorInfo, WellKnownType typeId)
: base(module, ref emittedName, typeId)
{
Debug.Assert(errorInfo != null);
_errorInfo = errorInfo;
}