153 references to MetadataReader
Microsoft.CodeAnalysis (153)
DiagnosticAnalyzer\AnalyzerFileReference.cs (2)
361var declaringTypeDef = peModule.MetadataReader.GetTypeDefinition(declaringType); 362return GetFullyQualifiedTypeName(declaringTypeDef, peModule) + "+" + peModule.MetadataReader.GetString(typeDef.Name);
Emit\EditAndContinue\EmitBaseline.cs (1)
351var reader = module.Module.MetadataReader;
MetadataReader\MetadataDecoder.cs (4)
1141var signatureHandle = Module.MetadataReader.GetStandaloneSignature(handle).Signature; 1142var signatureReader = Module.MetadataReader.GetBlobReader(signatureHandle); 1180var reader = Module.MetadataReader; 2039var interfaceImpl = Module.MetadataReader.GetInterfaceImplementation(interfaceImplHandle);
MetadataReader\PEAssembly.cs (1)
192var value = _modules[0].MetadataReader.DeclaresTheObjectClass();
MetadataReader\PEModule.cs (143)
282return MetadataReader.IsAssembly; 290return !MetadataReader.IsAssembly; 358_lazyName = MetadataReader.GetString(MetadataReader.GetModuleDefinition().Name); 368return MetadataReader.GetModuleVersionIdOrThrow(); 384foreach (var fileHandle in MetadataReader.AssemblyFiles) 386var file = MetadataReader.GetAssemblyFile(fileHandle); 392string moduleName = MetadataReader.GetString(file.Name); 416foreach (var handle in MetadataReader.TypeReferences) 418TypeReference typeRef = MetadataReader.GetTypeReference(handle); 434if (MetadataReader.ManifestResources.Count == 0) 440foreach (var handle in MetadataReader.ManifestResources) 442var resource = MetadataReader.GetManifestResource(handle); 445string resourceName = MetadataReader.GetString(resource.Name); 456return MetadataReader.GetString(MetadataReader.GetModuleReference(moduleRef).Name); 470_lazyAssemblyReferences = this.MetadataReader.GetReferencedAssembliesOrThrow(); 483get { return MetadataReader.MetadataVersion; } 493return MetadataReader.GetBlobReader(blob); 499var attributeTypeName = MetadataReader.GetString(nameHandle); 500var attributeTypeNamespaceName = MetadataReader.GetString(namespaceHandle); 512return MetadataReader.ReadAssemblyIdentityOrThrow(); 522return MetadataReader.GetTypeDefinition(typeDef).GetDeclaringType(); 528TypeDefinition typeDefinition = MetadataReader.GetTypeDefinition(typeDef); 529string name = MetadataReader.GetString(typeDefinition.Name); 544string namespaceName = MetadataReader.GetString(typeDefinition.Namespace); 560return MetadataReader.GetString(MetadataReader.GetTypeDefinition(typeDef).Namespace); 566return MetadataReader.GetTypeDefinition(typeDef).BaseType; 572return MetadataReader.GetTypeDefinition(typeDef).Attributes; 578return MetadataReader.GetTypeDefinition(typeDef).GetGenericParameters(); 584return MetadataReader.GetTypeDefinition(typeDef).GetGenericParameters().Count > 0; 595TypeDefinition row = MetadataReader.GetTypeDefinition(typeDef); 596name = MetadataReader.GetString(row.Name); 597@namespace = MetadataReader.GetString(row.Namespace); 605return IsNestedTypeDefOrThrow(MetadataReader, typeDef); 617return MetadataReader.GetTypeDefinition(typeDef).Attributes.IsInterface(); 635foreach (var typeDef in MetadataReader.TypeDefinitions) 637var row = MetadataReader.GetTypeDefinition(typeDef); 762string @namespace = MetadataReader.GetString(kvp.Key); 861select MetadataReader.GetString(id.NamespaceHandle); 879return MetadataReader.GetTypeDefinition(container).GetNestedTypes(); 885return MetadataReader.GetTypeDefinition(typeDef).GetMethodImplementations(); 894return MetadataReader.GetTypeDefinition(typeDef).GetInterfaceImplementations(); 900return MetadataReader.GetTypeDefinition(typeDef).GetMethods(); 906return MetadataReader.GetTypeDefinition(typeDef).GetProperties(); 912return MetadataReader.GetTypeDefinition(typeDef).GetEvents(); 918return MetadataReader.GetTypeDefinition(typeDef).GetFields(); 924return MetadataReader.GetTypeDefinition(typeDef).BaseType; 934var def = MetadataReader.GetTypeDefinition(typeDef); 1147AttributeInfo info = FindTargetAttribute(MetadataReader, token, AttributeDescription.RefSafetyRulesAttribute, out foundAttributeType); 1801blobReader = MetadataReader.GetBlobReader(valueBlob); 2012BlobReader reader = MetadataReader.GetBlobReader(valueBlob); 2110BlobReader reader = MetadataReader.GetBlobReader(valueBlob); 2503foreach (var attributeHandle in MetadataReader.GetCustomAttributes(hasAttribute)) 2527return FindTargetAttribute(MetadataReader, hasAttribute, description, out _); 2562foreach (var attributeHandle in MetadataReader.GetCustomAttributes(hasAttribute)) 2583foreach (var attributeHandle in MetadataReader.GetCustomAttributes(hasAttribute)) 2605int rid = MetadataReader.GetRowNumber(typeDef); 2619foreach (var attributeHandle in MetadataReader.GetCustomAttributes(typeDef)) 2647new int[(MetadataReader.TypeDefinitions.Count + 32) / 32], 2702if (MetadataReader.GetCustomAttribute(customAttribute).Parent.Kind != HandleKind.TypeDefinition) 2732return IsTargetAttribute(MetadataReader, customAttribute, namespaceName, typeName, out ctor, ignoreCase); 2793foreach (var assemblyRef in MetadataReader.AssemblyReferences) 2796if (MetadataReader.StringComparer.Equals(MetadataReader.GetAssemblyReference(assemblyRef).Name, assemblyName)) 2812return MetadataReader.GetAssemblyReference(assemblyRef); 2834foreach (var handle in MetadataReader.TypeReferences) 2836var typeRef = MetadataReader.GetTypeReference(handle); 2845if (!MetadataReader.StringComparer.Equals(typeRef.Name, typeName)) 2850if (MetadataReader.StringComparer.Equals(typeRef.Namespace, namespaceName)) 2871TypeReference typeRef = MetadataReader.GetTypeReference(handle); 2873name = MetadataReader.GetString(typeRef.Name); 2875@namespace = MetadataReader.GetString(typeRef.Namespace); 2892return GetTargetAttributeSignatureIndex(MetadataReader, customAttribute, description, out _); 3041return GetTypeAndConstructor(MetadataReader, customAttribute, out ctorType, out attributeCtor); 3111return GetAttributeNamespaceAndName(MetadataReader, typeDefOrRef, out namespaceHandle, out nameHandle); 3182foreach (var attributeHandle in MetadataReader.CustomAttributes) 3191var parent = (TypeDefinitionHandle)MetadataReader.GetCustomAttribute(attributeHandle).Parent; 3264BlobHandle signature = MetadataReader.GetTypeSpecification(typeSpec).Signature; 3267return MetadataReader.GetBlobReader(signature); 3277var methodSpec = MetadataReader.GetMethodSpecification(handle); 3292GenericParameter row = MetadataReader.GetGenericParameter(handle); 3293name = MetadataReader.GetString(row.Name); 3304return MetadataReader.GetString(MetadataReader.GetMethodDefinition(methodDef).Name); 3310return GetMethodSignatureOrThrow(MetadataReader, methodDef); 3322return GetMethodSignatureOrThrow(MetadataReader, methodDefOrRef); 3344return MetadataReader.GetMethodDefinition(methodDef).Attributes; 3350return MetadataReader.GetMethodDefinition(methodDef).GetDeclaringType(); 3356return MetadataReader.GetFieldDefinition(fieldDef).GetDeclaringType(); 3362return MetadataReader.GetMemberReference(memberRef).Parent; 3373MethodDefinition methodRow = MetadataReader.GetMethodDefinition(methodDef); 3374name = MetadataReader.GetString(methodRow.Name); 3387var impl = MetadataReader.GetMethodImplementation(methodImpl); 3395return MetadataReader.GetMethodDefinition(methodDef).GetGenericParameters(); 3401return MetadataReader.GetMethodDefinition(methodDef).GetParameters(); 3408var methodImport = MetadataReader.GetMethodDefinition(methodDef).GetImport(); 3416string entryPointName = MetadataReader.GetString(methodImport.Name); 3434return GetMemberRefNameOrThrow(MetadataReader, memberRef); 3446return GetSignatureOrThrow(MetadataReader, memberRef); 3462MemberReference row = MetadataReader.GetMemberReference(memberRef); 3464name = MetadataReader.GetString(row.Name); 3465signature = MetadataReader.GetBlobBytes(row.Signature); 3478Parameter parameter = MetadataReader.GetParameter(parameterDef); 3479name = MetadataReader.GetString(parameter.Name); 3486Parameter parameter = MetadataReader.GetParameter(parameterDef); 3487return MetadataReader.GetString(parameter.Name); 3493return MetadataReader.GetParameter(param).SequenceNumber; 3503return MetadataReader.GetString(MetadataReader.GetPropertyDefinition(propertyDef).Name); 3509return MetadataReader.GetPropertyDefinition(propertyDef).Signature; 3518PropertyDefinition property = MetadataReader.GetPropertyDefinition(propertyDef); 3519name = MetadataReader.GetString(property.Name); 3530return MetadataReader.GetString(MetadataReader.GetEventDefinition(eventDef).Name); 3540EventDefinition eventRow = MetadataReader.GetEventDefinition(eventDef); 3541name = MetadataReader.GetString(eventRow.Name); 3553return MetadataReader.GetString(MetadataReader.GetFieldDefinition(fieldDef).Name); 3559return MetadataReader.GetFieldDefinition(fieldDef).Signature; 3565return MetadataReader.GetFieldDefinition(fieldDef).Attributes; 3574FieldDefinition fieldRow = MetadataReader.GetFieldDefinition(fieldDef); 3576name = MetadataReader.GetString(fieldRow.Name); 3586var constantHandle = MetadataReader.GetParameter(param).GetDefaultValue(); 3603var constantHandle = MetadataReader.GetFieldDefinition(fieldDef).GetDefaultValue(); 3621return MetadataReader.GetCustomAttributes(handle); 3627return MetadataReader.GetCustomAttribute(handle).Value; 3636MetadataReader.GetFieldDefinition((FieldDefinitionHandle)fieldOrParameterToken).GetMarshallingDescriptor() : 3637MetadataReader.GetParameter((ParameterHandle)fieldOrParameterToken).GetMarshallingDescriptor(); 3652byte firstByte = MetadataReader.GetBlobReader(blob).ReadByte(); 3674return MetadataReader.GetBlobBytes(blob).AsImmutableOrNull(); 3686int offset = MetadataReader.GetFieldDefinition(fieldDef).GetOffset(); 3703var constantRow = MetadataReader.GetConstant(handle); 3704BlobReader reader = MetadataReader.GetBlobReader(constantRow.Value); 3830var forwarders = MetadataReader.ExportedTypes; 3833ExportedType exportedType = MetadataReader.GetExportedType(handle); 3860string name = MetadataReader.GetString(exportedType.Name); 3864string namespaceString = MetadataReader.GetString(ns); 3926return MetadataReader.GetPropertyDefinition(propertyDef).GetAccessors(); 3932return MetadataReader.GetEventDefinition(eventDef).GetAccessors(); 3938return MetadataReader.GetRowNumber(assemblyRef) - 1; 3968MethodDefinition method = MetadataReader.GetMethodDefinition(methodHandle);
MetadataReference\AssemblyMetadata.cs (1)
421if (!module.IsLinkedModule && module.MetadataReader.MetadataKind != MetadataKind.WindowsMetadata)
MetadataReference\ModuleMetadata.cs (1)
367internal MetadataReader MetadataReader => Module.MetadataReader;