本文整理汇总了C#中Cci类的典型用法代码示例。如果您正苦于以下问题:C# Cci类的具体用法?C# Cci怎么用?C# Cci使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Cci类属于命名空间,在下文中一共展示了Cci类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: MethodBody
public MethodBody(
byte[] ilBits,
ushort maxStack,
Cci.IMethodDefinition parent,
ImmutableArray<Cci.ILocalDefinition> locals,
SequencePointList sequencePoints,
DebugDocumentProvider debugDocumentProvider,
ImmutableArray<Cci.ExceptionHandlerRegion> exceptionHandlers,
ImmutableArray<Cci.LocalScope> localScopes,
Cci.CustomDebugInfoKind customDebugInfoKind,
bool hasDynamicLocalVariables,
ImmutableArray<Cci.NamespaceScope> namespaceScopes = default(ImmutableArray<Cci.NamespaceScope>),
string iteratorClassName = null,
ImmutableArray<Cci.LocalScope> iteratorScopes = default(ImmutableArray<Cci.LocalScope>),
Cci.AsyncMethodBodyDebugInfo asyncMethodDebugInfo = null)
{
Debug.Assert(!locals.IsDefault);
Debug.Assert(!exceptionHandlers.IsDefault);
Debug.Assert(!localScopes.IsDefault);
this.ilBits = ilBits;
this.asyncMethodDebugInfo = asyncMethodDebugInfo;
this.maxStack = maxStack;
this.parent = parent;
this.locals = locals;
this.sequencePoints = sequencePoints;
this.debugDocumentProvider = debugDocumentProvider;
this.exceptionHandlers = exceptionHandlers;
this.localScopes = localScopes;
this.customDebugInfoKind = customDebugInfoKind;
this.hasDynamicLocalVariables = hasDynamicLocalVariables;
this.namespaceScopes = namespaceScopes.IsDefault ? ImmutableArray<Cci.NamespaceScope>.Empty : namespaceScopes;
this.iteratorClassName = iteratorClassName;
this.iteratorScopes = iteratorScopes.IsDefault ? ImmutableArray<Cci.LocalScope>.Empty : iteratorScopes;
}
开发者ID:modulexcite,项目名称:pattern-matching-csharp,代码行数:35,代码来源:MethodBody.cs
示例2: TryGetPreviousHoistedLocalSlotIndex
/// <summary>
/// Returns an index of a slot that stores specified hoisted local variable in the previous generation.
/// </summary>
public abstract bool TryGetPreviousHoistedLocalSlotIndex(
SyntaxNode currentDeclarator,
Cci.ITypeReference currentType,
SynthesizedLocalKind synthesizedKind,
LocalDebugId currentId,
DiagnosticBag diagnostics,
out int slotIndex);
开发者ID:Rickinio,项目名称:roslyn,代码行数:10,代码来源:VariableSlotAllocator.cs
示例3: PrivateImplementationDetails
internal PrivateImplementationDetails(
Cci.IModule module,
int submissionSlotIndex,
Cci.ITypeReference systemObject,
Cci.ITypeReference systemValueType,
Cci.ITypeReference systemInt8Type,
Cci.ITypeReference systemInt16Type,
Cci.ITypeReference systemInt32Type,
Cci.ITypeReference systemInt64Type,
Cci.ICustomAttribute compilerGeneratedAttribute)
{
Debug.Assert(module != null);
Debug.Assert(systemObject != null);
Debug.Assert(systemValueType != null);
this.module = module;
this.systemObject = systemObject;
this.systemValueType = systemValueType;
this.systemInt8Type = systemInt8Type;
this.systemInt16Type = systemInt16Type;
this.systemInt32Type = systemInt32Type;
this.systemInt64Type = systemInt64Type;
this.compilerGeneratedAttribute = compilerGeneratedAttribute;
this.name = GetClassName(submissionSlotIndex);
}
开发者ID:pheede,项目名称:roslyn,代码行数:27,代码来源:PrivateImplementationDetails.cs
示例4: PermissionSetAttributeWithFileReference
public PermissionSetAttributeWithFileReference(Cci.ICustomAttribute sourceAttribute, string resolvedPermissionSetFilePath)
{
Debug.Assert(resolvedPermissionSetFilePath != null);
_sourceAttribute = sourceAttribute;
_resolvedPermissionSetFilePath = resolvedPermissionSetFilePath;
}
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:7,代码来源:PermissionSetAttribute.cs
示例5:
void Cci.IReference.Dispatch(Cci.MetadataVisitor visitor)
{
Debug.Assert(this.IsDefinitionOrDistinct());
if (!this.IsDefinition)
{
if (this.IsGenericMethod)
{
Debug.Assert(((Cci.IMethodReference)this).AsGenericMethodInstanceReference != null);
visitor.Visit((Cci.IGenericMethodInstanceReference)this);
}
else
{
Debug.Assert(((Cci.IMethodReference)this).AsSpecializedMethodReference != null);
visitor.Visit((Cci.ISpecializedMethodReference)this);
}
}
else
{
PEModuleBuilder moduleBeingBuilt = (PEModuleBuilder)visitor.Context.Module;
if (this.ContainingModule == moduleBeingBuilt.SourceModule)
{
Debug.Assert(((Cci.IMethodReference)this).GetResolvedMethod(visitor.Context) != null);
visitor.Visit((Cci.IMethodDefinition)this);
}
else
{
visitor.Visit((Cci.IMethodReference)this);
}
}
}
开发者ID:ehsansajjad465,项目名称:roslyn,代码行数:31,代码来源:MethodSymbolAdapter.cs
示例6: SignatureOnlyMethodSymbol
public SignatureOnlyMethodSymbol(
string name,
TypeSymbol containingType,
MethodKind methodKind,
Cci.CallingConvention callingConvention,
ImmutableArray<TypeParameterSymbol> typeParameters,
ImmutableArray<ParameterSymbol> parameters,
RefKind refKind,
TypeSymbol returnType,
ImmutableArray<CustomModifier> returnTypeCustomModifiers,
ushort countOfCustomModifiersPrecedingByRef,
ImmutableArray<MethodSymbol> explicitInterfaceImplementations)
{
_callingConvention = callingConvention;
_typeParameters = typeParameters;
_refKind = refKind;
_returnType = returnType;
_returnTypeCustomModifiers = returnTypeCustomModifiers;
_countOfCustomModifiersPrecedingByRef = countOfCustomModifiersPrecedingByRef;
_parameters = parameters;
_explicitInterfaceImplementations = explicitInterfaceImplementations.NullToEmpty();
_containingType = containingType;
_methodKind = methodKind;
_name = name;
}
开发者ID:otawfik-ms,项目名称:roslyn,代码行数:25,代码来源:SignatureOnlyMethodSymbol.cs
示例7: PrivateImplementationDetails
internal PrivateImplementationDetails(
Cci.IModule moduleBuilder,
string moduleName,
int submissionSlotIndex,
Cci.ITypeReference systemObject,
Cci.ITypeReference systemValueType,
Cci.ITypeReference systemInt8Type,
Cci.ITypeReference systemInt16Type,
Cci.ITypeReference systemInt32Type,
Cci.ITypeReference systemInt64Type,
Cci.ICustomAttribute compilerGeneratedAttribute)
{
Debug.Assert(systemObject != null);
Debug.Assert(systemValueType != null);
_moduleBuilder = moduleBuilder;
_systemObject = systemObject;
_systemValueType = systemValueType;
_systemInt8Type = systemInt8Type;
_systemInt16Type = systemInt16Type;
_systemInt32Type = systemInt32Type;
_systemInt64Type = systemInt64Type;
_compilerGeneratedAttribute = compilerGeneratedAttribute;
var isNetModule = moduleBuilder.AsAssembly == null;
_name = GetClassName(moduleName, submissionSlotIndex, isNetModule);
}
开发者ID:SoumikMukherjeeDOTNET,项目名称:roslyn,代码行数:29,代码来源:PrivateImplementationDetails.cs
示例8: MetadataConstant
public MetadataConstant(Cci.ITypeReference type, object value)
{
Debug.Assert(type != null);
AssertValidConstant(value);
this.type = type;
this.value = value;
}
开发者ID:EkardNT,项目名称:Roslyn,代码行数:8,代码来源:MetadataConstant.cs
示例9: PermissionSetAttributeWithFileReference
public PermissionSetAttributeWithFileReference(Cci.ICustomAttribute sourceAttribute, string resolvedPermissionSetFilePath)
{
Debug.Assert(!String.IsNullOrEmpty(resolvedPermissionSetFilePath));
Debug.Assert(PathUtilities.IsAbsolute(resolvedPermissionSetFilePath));
this.sourceAttribute = sourceAttribute;
this.resolvedPermissionSetFilePath = resolvedPermissionSetFilePath;
}
开发者ID:pheede,项目名称:roslyn,代码行数:8,代码来源:PermissionSetAttribute.cs
示例10: ExpandedVarargsMethodReference
public ExpandedVarargsMethodReference(Cci.IMethodReference underlyingMethod, ImmutableArray<Cci.IParameterTypeInformation> argListParams)
{
Debug.Assert(underlyingMethod.AcceptsExtraArguments);
Debug.Assert(!argListParams.IsEmpty);
_underlyingMethod = underlyingMethod;
_argListParams = argListParams;
}
开发者ID:GuilhermeSa,项目名称:roslyn,代码行数:8,代码来源:ExpandedVarargsMethodReference.cs
示例11: PENetModuleBuilder
internal PENetModuleBuilder(
SourceModuleSymbol sourceModule,
EmitOptions emitOptions,
Cci.ModulePropertiesForSerialization serializationProperties,
IEnumerable<ResourceDescription> manifestResources)
: base(sourceModule, emitOptions, OutputKind.NetModule, serializationProperties, manifestResources)
{
}
开发者ID:CAPCHIK,项目名称:roslyn,代码行数:8,代码来源:PENetModuleBuilder.cs
示例12: EmitContext
public EmitContext(Cci.IModule module, SyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics)
{
Debug.Assert(module != null);
Debug.Assert(diagnostics != null);
this.Module = module;
this.SyntaxNodeOpt = syntaxNodeOpt;
this.Diagnostics = diagnostics;
}
开发者ID:EkardNT,项目名称:Roslyn,代码行数:9,代码来源:Context.cs
示例13: EmitToken
internal void EmitToken(Cci.IReference value, SyntaxNode syntaxNode, DiagnosticBag diagnostics, bool encodeAsRawToken = false)
{
uint token = module?.GetFakeSymbolTokenForIL(value, syntaxNode, diagnostics) ?? 0xFFFF;
// Setting the high bit indicates that the token value is to be interpreted literally rather than as a handle.
if (encodeAsRawToken)
{
token |= Cci.MetadataWriter.LiteralMethodDefinitionToken;
}
this.GetCurrentWriter().WriteUInt32(token);
}
开发者ID:Rickinio,项目名称:roslyn,代码行数:10,代码来源:ILBuilderEmit.cs
示例14: EncHoistedLocalMetadata
public EncHoistedLocalMetadata(string name, Cci.ITypeReference type, SynthesizedLocalKind synthesizedKind)
{
Debug.Assert(name != null);
Debug.Assert(type != null);
Debug.Assert(synthesizedKind.IsLongLived());
this.Name = name;
this.Type = type;
this.SynthesizedKind = synthesizedKind;
}
开发者ID:Rickinio,项目名称:roslyn,代码行数:10,代码来源:EncHoistedLocalMetadata.cs
示例15: GetPreviousLocal
public abstract LocalDefinition GetPreviousLocal(
Cci.ITypeReference type,
ILocalSymbolInternal symbol,
string nameOpt,
SynthesizedLocalKind kind,
LocalDebugId id,
LocalVariableAttributes pdbAttributes,
LocalSlotConstraints constraints,
bool isDynamic,
ImmutableArray<TypedConstant> dynamicTransformFlags);
开发者ID:Rickinio,项目名称:roslyn,代码行数:10,代码来源:VariableSlotAllocator.cs
示例16: PEDeltaAssemblyBuilder
public PEDeltaAssemblyBuilder(
SourceAssemblySymbol sourceAssembly,
EmitOptions emitOptions,
OutputKind outputKind,
Cci.ModulePropertiesForSerialization serializationProperties,
IEnumerable<ResourceDescription> manifestResources,
EmitBaseline previousGeneration,
IEnumerable<SemanticEdit> edits,
Func<ISymbol, bool> isAddedSymbol)
: base(sourceAssembly, emitOptions, outputKind, serializationProperties, manifestResources, additionalTypes: ImmutableArray<NamedTypeSymbol>.Empty)
{
var initialBaseline = previousGeneration.InitialBaseline;
var context = new EmitContext(this, null, new DiagnosticBag());
// Hydrate symbols from initial metadata. Once we do so it is important to reuse these symbols across all generations,
// in order for the symbol matcher to be able to use reference equality once it maps symbols to initial metadata.
var metadataSymbols = GetOrCreateMetadataSymbols(initialBaseline, sourceAssembly.DeclaringCompilation);
var metadataDecoder = (MetadataDecoder)metadataSymbols.MetadataDecoder;
var metadataAssembly = (PEAssemblySymbol)metadataDecoder.ModuleSymbol.ContainingAssembly;
var matchToMetadata = new CSharpSymbolMatcher(metadataSymbols.AnonymousTypes, sourceAssembly, context, metadataAssembly);
CSharpSymbolMatcher matchToPrevious = null;
if (previousGeneration.Ordinal > 0)
{
var previousAssembly = ((CSharpCompilation)previousGeneration.Compilation).SourceAssembly;
var previousContext = new EmitContext((PEModuleBuilder)previousGeneration.PEModuleBuilder, null, new DiagnosticBag());
matchToPrevious = new CSharpSymbolMatcher(
previousGeneration.AnonymousTypeMap,
sourceAssembly: sourceAssembly,
sourceContext: context,
otherAssembly: previousAssembly,
otherContext: previousContext,
otherSynthesizedMembersOpt: previousGeneration.SynthesizedMembers);
}
_previousDefinitions = new CSharpDefinitionMap(previousGeneration.OriginalMetadata.Module, edits, metadataDecoder, matchToMetadata, matchToPrevious);
_previousGeneration = previousGeneration;
_changes = new SymbolChanges(_previousDefinitions, edits, isAddedSymbol);
// Workaround for https://github.com/dotnet/roslyn/issues/3192.
// When compiling state machine we stash types of awaiters and state-machine hoisted variables,
// so that next generation can look variables up and reuse their slots if possible.
//
// When we are about to allocate a slot for a lifted variable while compiling the next generation
// we map its type to the previous generation and then check the slot types that we stashed earlier.
// If the variable type matches we reuse it. In order to compare the previous variable type with the current one
// both need to be completely lowered (translated). Standard translation only goes one level deep.
// Generic arguments are not translated until they are needed by metadata writer.
//
// In order to get the fully lowered form we run the type symbols of stashed variables thru a deep translator
// that translates the symbol recursively.
_deepTranslator = new CSharpSymbolMatcher.DeepTranslator(sourceAssembly.GetSpecialType(SpecialType.System_Object));
}
开发者ID:GeertVL,项目名称:roslyn,代码行数:55,代码来源:PEDeltaAssemblyBuilder.cs
示例17: VisitTypeReference
private static void VisitTypeReference(Cci.ITypeReference typeReference, EmitContext context)
{
Debug.Assert(typeReference != null);
Cci.IArrayTypeReference arrayType = typeReference as Cci.IArrayTypeReference;
if (arrayType != null)
{
VisitTypeReference(arrayType.GetElementType(context), context);
return;
}
Cci.IPointerTypeReference pointerType = typeReference as Cci.IPointerTypeReference;
if (pointerType != null)
{
VisitTypeReference(pointerType.GetTargetType(context), context);
return;
}
Debug.Assert(!(typeReference is Cci.IManagedPointerTypeReference));
//Cci.IManagedPointerTypeReference managedPointerType = typeReference as Cci.IManagedPointerTypeReference;
//if (managedPointerType != null)
//{
// VisitTypeReference(managedPointerType.GetTargetType(this.context));
// return;
//}
Cci.IModifiedTypeReference modifiedType = typeReference as Cci.IModifiedTypeReference;
if (modifiedType != null)
{
foreach (var custModifier in modifiedType.CustomModifiers)
{
VisitTypeReference(custModifier.GetModifier(context), context);
}
VisitTypeReference(modifiedType.UnmodifiedType, context);
return;
}
// Visit containing type
Cci.INestedTypeReference nestedType = typeReference.AsNestedTypeReference;
if (nestedType != null)
{
VisitTypeReference(nestedType.GetContainingType(context), context);
}
// Visit generic arguments
Cci.IGenericTypeInstanceReference genericInstance = typeReference.AsGenericTypeInstanceReference;
if (genericInstance != null)
{
foreach (var arg in genericInstance.GetGenericArguments(context))
{
VisitTypeReference(arg, context);
}
}
}
开发者ID:Rickinio,项目名称:roslyn,代码行数:54,代码来源:ReferenceDependencyWalker.cs
示例18: LocalConstantDefinition
public LocalConstantDefinition(string name, Location location, Cci.IMetadataConstant compileTimeValue, bool isDynamic = false,
ImmutableArray<TypedConstant> dynamicTransformFlags = default(ImmutableArray<TypedConstant>))
{
Debug.Assert(!string.IsNullOrEmpty(name));
Debug.Assert(compileTimeValue != null);
_name = name;
_location = location;
_compileTimeValue = compileTimeValue;
_isDynamic = isDynamic;
_dynamicTransformFlags = dynamicTransformFlags;
}
开发者ID:CAPCHIK,项目名称:roslyn,代码行数:12,代码来源:LocalConstantDefinition.cs
示例19: TryGetFieldHandle
internal override bool TryGetFieldHandle(Cci.IFieldDefinition def, out FieldHandle handle)
{
var other = this.mapToMetadata.MapDefinition(def) as PEFieldSymbol;
if ((object)other != null)
{
handle = other.Handle;
return true;
}
else
{
handle = default(FieldHandle);
return false;
}
}
开发者ID:pheede,项目名称:roslyn,代码行数:14,代码来源:CSharpDefinitionMap.cs
示例20: SourceSpan
public SourceSpan(
Cci.DebugSourceDocument document,
int startLine,
int startColumn,
int endLine,
int endColumn)
{
Debug.Assert(document != null);
StartLine = startLine;
StartColumn = startColumn;
EndLine = endLine;
EndColumn = endColumn;
Document = document;
}
开发者ID:Rickinio,项目名称:roslyn,代码行数:15,代码来源:SourceSpan.cs
注:本文中的Cci类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论