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); 1142AttributeInfo info = FindTargetAttribute(MetadataReader, token, AttributeDescription.RefSafetyRulesAttribute, out foundAttributeType); 1796blobReader = MetadataReader.GetBlobReader(valueBlob); 2007BlobReader reader = MetadataReader.GetBlobReader(valueBlob); 2105BlobReader reader = MetadataReader.GetBlobReader(valueBlob); 2498foreach (var attributeHandle in MetadataReader.GetCustomAttributes(hasAttribute)) 2522return FindTargetAttribute(MetadataReader, hasAttribute, description, out _); 2557foreach (var attributeHandle in MetadataReader.GetCustomAttributes(hasAttribute)) 2578foreach (var attributeHandle in MetadataReader.GetCustomAttributes(hasAttribute)) 2600int rid = MetadataReader.GetRowNumber(typeDef); 2614foreach (var attributeHandle in MetadataReader.GetCustomAttributes(typeDef)) 2642new int[(MetadataReader.TypeDefinitions.Count + 32) / 32], 2697if (MetadataReader.GetCustomAttribute(customAttribute).Parent.Kind != HandleKind.TypeDefinition) 2727return IsTargetAttribute(MetadataReader, customAttribute, namespaceName, typeName, out ctor, ignoreCase); 2788foreach (var assemblyRef in MetadataReader.AssemblyReferences) 2791if (MetadataReader.StringComparer.Equals(MetadataReader.GetAssemblyReference(assemblyRef).Name, assemblyName)) 2807return MetadataReader.GetAssemblyReference(assemblyRef); 2829foreach (var handle in MetadataReader.TypeReferences) 2831var typeRef = MetadataReader.GetTypeReference(handle); 2840if (!MetadataReader.StringComparer.Equals(typeRef.Name, typeName)) 2845if (MetadataReader.StringComparer.Equals(typeRef.Namespace, namespaceName)) 2866TypeReference typeRef = MetadataReader.GetTypeReference(handle); 2868name = MetadataReader.GetString(typeRef.Name); 2870@namespace = MetadataReader.GetString(typeRef.Namespace); 2887return GetTargetAttributeSignatureIndex(MetadataReader, customAttribute, description, out _); 3036return GetTypeAndConstructor(MetadataReader, customAttribute, out ctorType, out attributeCtor); 3106return GetAttributeNamespaceAndName(MetadataReader, typeDefOrRef, out namespaceHandle, out nameHandle); 3177foreach (var attributeHandle in MetadataReader.CustomAttributes) 3186var parent = (TypeDefinitionHandle)MetadataReader.GetCustomAttribute(attributeHandle).Parent; 3259BlobHandle signature = MetadataReader.GetTypeSpecification(typeSpec).Signature; 3262return MetadataReader.GetBlobReader(signature); 3272var methodSpec = MetadataReader.GetMethodSpecification(handle); 3287GenericParameter row = MetadataReader.GetGenericParameter(handle); 3288name = MetadataReader.GetString(row.Name); 3299return MetadataReader.GetString(MetadataReader.GetMethodDefinition(methodDef).Name); 3305return GetMethodSignatureOrThrow(MetadataReader, methodDef); 3317return GetMethodSignatureOrThrow(MetadataReader, methodDefOrRef); 3339return MetadataReader.GetMethodDefinition(methodDef).Attributes; 3345return MetadataReader.GetMethodDefinition(methodDef).GetDeclaringType(); 3351return MetadataReader.GetFieldDefinition(fieldDef).GetDeclaringType(); 3357return MetadataReader.GetMemberReference(memberRef).Parent; 3368MethodDefinition methodRow = MetadataReader.GetMethodDefinition(methodDef); 3369name = MetadataReader.GetString(methodRow.Name); 3382var impl = MetadataReader.GetMethodImplementation(methodImpl); 3390return MetadataReader.GetMethodDefinition(methodDef).GetGenericParameters(); 3396return MetadataReader.GetMethodDefinition(methodDef).GetParameters(); 3403var methodImport = MetadataReader.GetMethodDefinition(methodDef).GetImport(); 3411string entryPointName = MetadataReader.GetString(methodImport.Name); 3429return GetMemberRefNameOrThrow(MetadataReader, memberRef); 3441return GetSignatureOrThrow(MetadataReader, memberRef); 3457MemberReference row = MetadataReader.GetMemberReference(memberRef); 3459name = MetadataReader.GetString(row.Name); 3460signature = MetadataReader.GetBlobBytes(row.Signature); 3473Parameter parameter = MetadataReader.GetParameter(parameterDef); 3474name = MetadataReader.GetString(parameter.Name); 3481Parameter parameter = MetadataReader.GetParameter(parameterDef); 3482return MetadataReader.GetString(parameter.Name); 3488return MetadataReader.GetParameter(param).SequenceNumber; 3498return MetadataReader.GetString(MetadataReader.GetPropertyDefinition(propertyDef).Name); 3504return MetadataReader.GetPropertyDefinition(propertyDef).Signature; 3513PropertyDefinition property = MetadataReader.GetPropertyDefinition(propertyDef); 3514name = MetadataReader.GetString(property.Name); 3525return MetadataReader.GetString(MetadataReader.GetEventDefinition(eventDef).Name); 3535EventDefinition eventRow = MetadataReader.GetEventDefinition(eventDef); 3536name = MetadataReader.GetString(eventRow.Name); 3548return MetadataReader.GetString(MetadataReader.GetFieldDefinition(fieldDef).Name); 3554return MetadataReader.GetFieldDefinition(fieldDef).Signature; 3560return MetadataReader.GetFieldDefinition(fieldDef).Attributes; 3569FieldDefinition fieldRow = MetadataReader.GetFieldDefinition(fieldDef); 3571name = MetadataReader.GetString(fieldRow.Name); 3581var constantHandle = MetadataReader.GetParameter(param).GetDefaultValue(); 3598var constantHandle = MetadataReader.GetFieldDefinition(fieldDef).GetDefaultValue(); 3616return MetadataReader.GetCustomAttributes(handle); 3622return MetadataReader.GetCustomAttribute(handle).Value; 3631MetadataReader.GetFieldDefinition((FieldDefinitionHandle)fieldOrParameterToken).GetMarshallingDescriptor() : 3632MetadataReader.GetParameter((ParameterHandle)fieldOrParameterToken).GetMarshallingDescriptor(); 3647byte firstByte = MetadataReader.GetBlobReader(blob).ReadByte(); 3669return MetadataReader.GetBlobBytes(blob).AsImmutableOrNull(); 3681int offset = MetadataReader.GetFieldDefinition(fieldDef).GetOffset(); 3698var constantRow = MetadataReader.GetConstant(handle); 3699BlobReader reader = MetadataReader.GetBlobReader(constantRow.Value); 3825var forwarders = MetadataReader.ExportedTypes; 3828ExportedType exportedType = MetadataReader.GetExportedType(handle); 3855string name = MetadataReader.GetString(exportedType.Name); 3859string namespaceString = MetadataReader.GetString(ns); 3921return MetadataReader.GetPropertyDefinition(propertyDef).GetAccessors(); 3927return MetadataReader.GetEventDefinition(eventDef).GetAccessors(); 3933return MetadataReader.GetRowNumber(assemblyRef) - 1; 3963MethodDefinition method = MetadataReader.GetMethodDefinition(methodHandle);
MetadataReference\AssemblyMetadata.cs (1)
421if (!module.IsLinkedModule && module.MetadataReader.MetadataKind != MetadataKind.WindowsMetadata)
MetadataReference\ModuleMetadata.cs (1)
374internal MetadataReader MetadataReader => Module.MetadataReader;