Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/runtime.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTlakaelel Axayakatl Ceja <tlakaelel_axayakatl@outlook.com>2022-09-01 23:02:43 +0300
committerGitHub <noreply@github.com>2022-09-01 23:02:43 +0300
commitab2d195f169a08bf8eb978b472b2d3aca61b0a46 (patch)
tree4e441a8841728347e13d9a14f0b457340d134ef1 /src/coreclr/tools/Common
parent7a45201181d37329b7ab0bee541ed7c42b5d94b6 (diff)
Run code quality analyzers in the coreclr/tools directory (#74825)
Run codeanalysis analyzers in the coreclr/tools directory
Diffstat (limited to 'src/coreclr/tools/Common')
-rw-r--r--src/coreclr/tools/Common/CommandLine/ArgumentParser.cs2
-rw-r--r--src/coreclr/tools/Common/CommandLine/ArgumentSyntax.cs33
-rw-r--r--src/coreclr/tools/Common/CommandLine/ArgumentSyntax_Definers.cs2
-rw-r--r--src/coreclr/tools/Common/CommandLine/ArgumentToken.cs4
-rw-r--r--src/coreclr/tools/Common/CommandLine/CommandLineException.cs2
-rw-r--r--src/coreclr/tools/Common/CommandLine/CommandLineHelpers.cs6
-rw-r--r--src/coreclr/tools/Common/CommandLine/HelpTextGenerator.cs8
-rw-r--r--src/coreclr/tools/Common/Compiler/CodeGenerationFailedException.cs2
-rw-r--r--src/coreclr/tools/Common/Compiler/CompilerTypeSystemContext.Validation.cs4
-rw-r--r--src/coreclr/tools/Common/Compiler/CompilerTypeSystemContext.cs28
-rw-r--r--src/coreclr/tools/Common/Compiler/DependencyAnalysis/CompilerComparer.cs1
-rw-r--r--src/coreclr/tools/Common/Compiler/DependencyAnalysis/EmbeddedDataContainerNode.cs4
-rw-r--r--src/coreclr/tools/Common/Compiler/DependencyAnalysis/INodeWithRuntimeDeterminedDependencies.cs3
-rw-r--r--src/coreclr/tools/Common/Compiler/DependencyAnalysis/ISymbolNode.cs5
-rw-r--r--src/coreclr/tools/Common/Compiler/DependencyAnalysis/MethodReadOnlyDataNode.cs2
-rw-r--r--src/coreclr/tools/Common/Compiler/DependencyAnalysis/ObjectAndOffsetSymbolNode.cs2
-rw-r--r--src/coreclr/tools/Common/Compiler/DependencyAnalysis/ObjectDataBuilder.cs10
-rw-r--r--src/coreclr/tools/Common/Compiler/DependencyAnalysis/ObjectNode.cs4
-rw-r--r--src/coreclr/tools/Common/Compiler/DependencyAnalysis/ObjectNodeSection.cs4
-rw-r--r--src/coreclr/tools/Common/Compiler/DependencyAnalysis/ShadowConcreteMethodNode.cs2
-rw-r--r--src/coreclr/tools/Common/Compiler/DependencyAnalysis/SortableDependencyNode.cs3
-rw-r--r--src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_ARM/ARMEmitter.cs3
-rw-r--r--src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_ARM/Register.cs8
-rw-r--r--src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_ARM/TargetRegisterMap.cs2
-rw-r--r--src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_ARM64/ARM64Emitter.cs4
-rw-r--r--src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_ARM64/AddrMode.cs2
-rw-r--r--src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_ARM64/Register.cs10
-rw-r--r--src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_ARM64/TargetRegisterMap.cs2
-rw-r--r--src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_LoongArch64/AddrMode.cs2
-rw-r--r--src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_LoongArch64/Register.cs6
-rw-r--r--src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_LoongArch64/TargetRegisterMap.cs2
-rw-r--r--src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_X64/AddrMode.cs2
-rw-r--r--src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_X64/Register.cs6
-rw-r--r--src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_X64/X64Emitter.cs9
-rw-r--r--src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_X86/AddrMode.cs2
-rw-r--r--src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_X86/Register.cs8
-rw-r--r--src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_X86/TargetRegisterMap.cs2
-rw-r--r--src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_X86/X86Emitter.cs9
-rw-r--r--src/coreclr/tools/Common/Compiler/DevirtualizationManager.cs3
-rw-r--r--src/coreclr/tools/Common/Compiler/DisplayNameHelpers.cs8
-rw-r--r--src/coreclr/tools/Common/Compiler/HardwareIntrinsicHelpers.cs5
-rw-r--r--src/coreclr/tools/Common/Compiler/InstructionSetSupport.cs5
-rw-r--r--src/coreclr/tools/Common/Compiler/MethodExtensions.cs3
-rw-r--r--src/coreclr/tools/Common/Compiler/NativeAotNameMangler.cs47
-rw-r--r--src/coreclr/tools/Common/Compiler/TypeExtensions.cs10
-rw-r--r--src/coreclr/tools/Common/Compiler/VectorFieldLayoutAlgorithm.cs6
-rw-r--r--src/coreclr/tools/Common/Internal/LowLevelLinq/LowLevelEnumerable.ToList.cs2
-rw-r--r--src/coreclr/tools/Common/Internal/Metadata/NativeFormat/Generator/MdBinaryWriterGen.cs4
-rw-r--r--src/coreclr/tools/Common/Internal/Metadata/NativeFormat/Generator/ReaderGen.cs5
-rw-r--r--src/coreclr/tools/Common/Internal/Metadata/NativeFormat/Generator/SchemaDef.cs14
-rw-r--r--src/coreclr/tools/Common/Internal/Metadata/NativeFormat/Generator/WriterGen.cs15
-rw-r--r--src/coreclr/tools/Common/Internal/Metadata/NativeFormat/MdBinaryReader.cs7
-rw-r--r--src/coreclr/tools/Common/Internal/Metadata/NativeFormat/MdBinaryReaderGen.cs4
-rw-r--r--src/coreclr/tools/Common/Internal/Metadata/NativeFormat/NativeFormatReaderGen.cs2
-rw-r--r--src/coreclr/tools/Common/Internal/Metadata/NativeFormat/NativeMetadataReader.cs4
-rw-r--r--src/coreclr/tools/Common/Internal/NativeFormat/NativeFormatReader.Primitives.cs2
-rw-r--r--src/coreclr/tools/Common/Internal/NativeFormat/NativeFormatReader.String.cs1
-rw-r--r--src/coreclr/tools/Common/Internal/NativeFormat/NativeFormatReader.cs3
-rw-r--r--src/coreclr/tools/Common/Internal/NativeFormat/NativeFormatWriter.cs135
-rw-r--r--src/coreclr/tools/Common/Internal/Runtime/CorConstants.cs2
-rw-r--r--src/coreclr/tools/Common/Internal/Runtime/EETypeBuilderHelpers.cs3
-rw-r--r--src/coreclr/tools/Common/Internal/Runtime/EETypeOptionalFieldsBuilder.cs16
-rw-r--r--src/coreclr/tools/Common/Internal/Runtime/GCDescEncoder.cs2
-rw-r--r--src/coreclr/tools/Common/Internal/Runtime/InterfaceDispatchCellCachePointerFlags.cs2
-rw-r--r--src/coreclr/tools/Common/Internal/Runtime/ModuleHeaders.cs3
-rw-r--r--src/coreclr/tools/Common/Internal/Runtime/ReadyToRunConstants.cs2
-rw-r--r--src/coreclr/tools/Common/Internal/Runtime/UniversalGenericParameterLayout.cs15
-rw-r--r--src/coreclr/tools/Common/Internal/Text/Utf8String.cs3
-rw-r--r--src/coreclr/tools/Common/Internal/Text/Utf8StringBuilder.cs4
-rw-r--r--src/coreclr/tools/Common/JitInterface/CorInfoBase.cs356
-rw-r--r--src/coreclr/tools/Common/JitInterface/CorInfoHelpFunc.cs18
-rw-r--r--src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs158
-rw-r--r--src/coreclr/tools/Common/JitInterface/CorInfoInstructionSet.cs10
-rw-r--r--src/coreclr/tools/Common/JitInterface/CorInfoTypes.VarInfo.cs1
-rw-r--r--src/coreclr/tools/Common/JitInterface/CorInfoTypes.cs11
-rw-r--r--src/coreclr/tools/Common/JitInterface/JitConfigProvider.cs7
-rw-r--r--src/coreclr/tools/Common/JitInterface/LoongArch64PassStructInRegister.cs9
-rw-r--r--src/coreclr/tools/Common/JitInterface/MemoryHelper.cs2
-rw-r--r--src/coreclr/tools/Common/JitInterface/SystemVStructClassificator.cs14
-rw-r--r--src/coreclr/tools/Common/JitInterface/ThunkGenerator/InstructionSetGenerator.cs10
-rw-r--r--src/coreclr/tools/Common/JitInterface/ThunkGenerator/Program.cs6
-rw-r--r--src/coreclr/tools/Common/JitInterface/TypeString.cs6
-rw-r--r--src/coreclr/tools/Common/JitInterface/UnboxingMethodDesc.cs3
-rw-r--r--src/coreclr/tools/Common/JitInterface/UnboxingMethodDescFactory.cs4
-rw-r--r--src/coreclr/tools/Common/Pgo/PgoFormat.cs30
-rw-r--r--src/coreclr/tools/Common/Pgo/TypeSystemEntityOrUnknown.cs4
-rw-r--r--src/coreclr/tools/Common/Sorting/ISortableDataStructureAccessor.cs4
-rw-r--r--src/coreclr/tools/Common/Sorting/ListAccessor.cs1
-rw-r--r--src/coreclr/tools/Common/Sorting/MergeSort.cs2
-rw-r--r--src/coreclr/tools/Common/Sorting/MergeSortCore.cs5
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Canon/ArrayType.Canon.cs4
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Canon/ByRefType.Canon.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Canon/CanonTypes.Diagnostic.cs7
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Canon/CanonTypes.Interop.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Canon/CanonTypes.Sorting.cs6
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Canon/DefType.Canon.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Canon/FunctionPointerType.Canon.cs4
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Canon/InstantiatedMethod.Canon.cs10
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Canon/InstantiatedType.Canon.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Canon/MetadataType.Canon.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Canon/MethodDelegator.Canon.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Canon/MethodDesc.Canon.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Canon/MethodForInstantiatedType.Canon.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Canon/ParameterizedType.Canon.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Canon/PointerType.Canon.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Canon/SignatureVariable.Canon.cs4
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Canon/TypeDesc.Canon.cs11
-rw-r--r--src/coreclr/tools/Common/TypeSystem/CodeGen/FieldDesc.CodeGen.cs4
-rw-r--r--src/coreclr/tools/Common/TypeSystem/CodeGen/MethodDelegator.CodeGen.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/CodeGen/NativeStructType.CodeGen.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/CodeGen/TargetDetails.CodeGen.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/CodeGen/TypeDesc.CodeGen.cs4
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Common/ArrayOfTRuntimeInterfacesAlgorithm.cs1
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Common/ArrayType.cs1
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Common/BaseTypeRuntimeInterfacesAlgorithm.cs3
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Common/CastingHelper.cs4
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Common/ConstructedTypeRewritingHelpers.cs1
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Common/DefType.Diagnostic.cs4
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Common/DefType.FieldLayout.cs18
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Common/FieldDesc.FieldLayout.cs1
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Common/FieldDesc.ToString.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Common/FieldDesc.cs5
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Common/FieldForInstantiatedType.cs4
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Common/FunctionPointerType.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Common/GenericParameterDesc.Diagnostic.cs1
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Common/GenericParameterDesc.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Common/InstantiatedMethod.cs4
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Common/InstantiatedType.Interfaces.cs5
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Common/InstantiatedType.MethodImpls.cs4
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Common/InstantiatedType.cs4
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Common/LayoutInt.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Common/LinqPoison.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Common/MetadataFieldLayoutAlgorithm.cs19
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Common/MetadataRuntimeInterfacesAlgorithm.cs9
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Common/MetadataType.Interfaces.cs3
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Common/MetadataType.MethodImpls.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Common/MetadataTypeSystemContext.cs1
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Common/MetadataVirtualMethodAlgorithm.cs16
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Common/MethodDelegator.Diagnostic.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Common/MethodDesc.Diagnostic.cs4
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Common/MethodDesc.ToString.cs4
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Common/MethodDesc.cs6
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Common/MethodForInstantiatedType.cs4
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Common/ModuleDesc.cs1
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Common/ParameterizedType.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Common/SignatureVariable.cs4
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Common/TargetArchitecture.cs3
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Common/TargetDetails.ToString.cs5
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Common/ThrowHelper.Common.cs1
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Common/TypeDesc.Interfaces.cs1
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Common/TypeDesc.ToString.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Common/TypeDesc.cs12
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Common/TypeHashingAlgorithms.cs1
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Common/TypeSystemConstraintsHelpers.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Common/TypeSystemContext.cs12
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Common/TypeSystemException.Resources.cs3
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Common/TypeSystemException.cs6
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Common/TypeSystemHelpers.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Common/UniversalCanonLayoutAlgorithm.cs4
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Common/Utilities/CustomAttributeTypeNameFormatter.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Common/Utilities/CustomAttributeTypeNameParser.cs31
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Common/Utilities/DebugNameFormatter.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Common/Utilities/ExceptionTypeNameFormatter.Metadata.cs6
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Common/Utilities/GCPointerMap.Algorithm.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Common/Utilities/GCPointerMap.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Common/Utilities/LockFreeReaderHashtable.cs5
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Common/Utilities/TypeNameFormatter.cs1
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Common/WellKnownType.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Ecma/CachingMetadataStringDecoder.cs4
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Ecma/EcmaAssembly.Symbols.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Ecma/EcmaField.CodeGen.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Ecma/EcmaField.Serialization.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Ecma/EcmaField.Sorting.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Ecma/EcmaGenericParameter.Sorting.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Ecma/EcmaGenericParameter.cs6
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Ecma/EcmaMethod.Sorting.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Ecma/EcmaMethod.cs4
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Ecma/EcmaModule.Sorting.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Ecma/EcmaModule.Symbols.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Ecma/EcmaModule.cs44
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Ecma/EcmaSignatureEncoder.cs5
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Ecma/EcmaSignatureParser.cs38
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Ecma/EcmaSignatureTranslator.cs21
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Ecma/EcmaType.Diagnostic.cs7
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Ecma/EcmaType.Interfaces.cs6
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Ecma/EcmaType.MethodImpls.cs13
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Ecma/EcmaType.Serialization.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Ecma/EcmaType.Sorting.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Ecma/EcmaType.cs3
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Ecma/IEcmaModule.cs7
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Ecma/IMetadataStringDecoderProvider.cs1
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Ecma/MetadataExtensions.cs8
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Ecma/SymbolReader/PortablePdbSymbolReader.cs4
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Ecma/SymbolReader/UnmanagedPdbSymbolReader.cs58
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/DelegateInfo.cs5
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/EcmaMethodIL.Symbols.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/HelperExtensions.cs10
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/ILDisassembler.cs17
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/ILImporter.cs13
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/ILOpcode.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/ILReader.cs9
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/ILStackHelper.cs4
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/ILTokenReplacer.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/InstantiatedMethodIL.cs13
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/MethodIL.Symbols.cs6
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/MethodIL.cs8
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/MethodILDebugView.cs14
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/NativeAotILProvider.cs6
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/Stubs/ArrayMethodILEmitter.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/Stubs/AssemblyGetExecutingAssemblyMethodThunk.Sorting.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/Stubs/AssemblyGetExecutingAssemblyMethodThunk.cs6
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/Stubs/CalliMarshallingMethodThunk.Mangling.cs1
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/Stubs/CalliMarshallingMethodThunk.Sorting.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/Stubs/CalliMarshallingMethodThunk.cs4
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/Stubs/ComparerIntrinsics.cs10
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/Stubs/DelegateMarshallingMethodThunk.Mangling.cs1
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/Stubs/DelegateMarshallingMethodThunk.Sorting.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/Stubs/DelegateMarshallingMethodThunk.cs10
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/Stubs/DelegateThunks.Sorting.cs14
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/Stubs/DelegateThunks.cs6
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/Stubs/DynamicInvokeMethodThunk.Mangling.cs1
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/Stubs/DynamicInvokeMethodThunk.Sorting.cs5
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/Stubs/DynamicInvokeMethodThunk.cs6
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/Stubs/EnumThunks.Sorting.cs4
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/Stubs/EnumThunks.cs4
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/Stubs/ForwardDelegateCreationThunk.Sorting.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/Stubs/ForwardDelegateCreationThunk.cs20
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/Stubs/GetCanonTypeIntrinsic.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/Stubs/ILEmitter.cs21
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/Stubs/InterlockedIntrinsics.cs1
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/Stubs/MemoryMarshalIntrinsics.cs3
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/Stubs/MethodBaseGetCurrentMethodThunk.Mangling.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/Stubs/MethodBaseGetCurrentMethodThunk.Sorting.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/Stubs/MethodBaseGetCurrentMethodThunk.cs6
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/Stubs/PInvokeILCodeStreams.cs4
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/Stubs/PInvokeILEmitter.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/Stubs/PInvokeLazyFixupField.Sorting.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/Stubs/PInvokeTargetNativeMethod.Diagnostic.cs4
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/Stubs/PInvokeTargetNativeMethod.Mangling.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/Stubs/PInvokeTargetNativeMethod.Sorting.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/Stubs/PInvokeTargetNativeMethod.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/Stubs/RuntimeHelpersIntrinsics.cs1
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/Stubs/StreamIntrinsics.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/Stubs/StructMarshallingThunk.Sorting.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/Stubs/StructMarshallingThunk.cs20
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/Stubs/TypeGetTypeMethodThunk.Sorting.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/Stubs/TypeGetTypeMethodThunk.cs6
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/Stubs/UnsafeIntrinsics.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/Stubs/ValueTypeGetFieldHelperMethodOverride.Sorting.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/Stubs/ValueTypeGetFieldHelperMethodOverride.cs4
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Interop/FieldDesc.Interop.cs4
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Interop/IL/InlineArrayType.Sorting.cs6
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Interop/IL/InlineArrayType.cs15
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Interop/IL/MarshalHelpers.Aot.cs6
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Interop/IL/MarshalHelpers.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Interop/IL/MarshalUtils.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Interop/IL/Marshaller.Aot.cs49
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Interop/IL/Marshaller.cs54
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Interop/IL/MarshallerKind.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Interop/IL/NativeStructType.Mangling.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Interop/IL/NativeStructType.Sorting.cs4
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Interop/IL/NativeStructType.cs3
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Interop/IL/PInvokeDelegateWrapper.Mangling.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Interop/IL/PInvokeDelegateWrapper.Sorting.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Interop/IL/PInvokeDelegateWrapper.cs5
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Interop/IL/PInvokeDelegateWrapperConstructor.Sorting.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Interop/IL/PInvokeDelegateWrapperConstructor.cs9
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Interop/InteropStateManager.cs41
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Interop/InteropTypes.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Interop/MarshalAsDescriptor.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Interop/MetadataType.Interop.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Interop/MethodDelegator.Interop.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Interop/MethodDesc.Interop.cs6
-rw-r--r--src/coreclr/tools/Common/TypeSystem/MetadataEmitter/TypeSystemMetadataEmitter.cs54
-rw-r--r--src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/ArrayType.RuntimeDetermined.cs4
-rw-r--r--src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/ByRefType.RuntimeDetermined.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/DefType.RuntimeDetermined.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/FieldDesc.RuntimeDetermined.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/FunctionPointerType.RuntimeDetermined.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/GenericParameterDesc.RuntimeDetermined.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/MethodDesc.RuntimeDetermined.cs4
-rw-r--r--src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/MethodForRuntimeDeterminedType.Diagnostic.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/MethodForRuntimeDeterminedType.Sorting.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/MethodForRuntimeDeterminedType.cs1
-rw-r--r--src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/ParameterizedType.RuntimeDetermined.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/PointerType.RuntimeDetermined.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/RuntimeDeterminedCanonicalizationAlgorithm.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/RuntimeDeterminedFieldLayoutAlgorithm.cs5
-rw-r--r--src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/RuntimeDeterminedType.Diagnostic.cs6
-rw-r--r--src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/RuntimeDeterminedType.Sorting.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/RuntimeDeterminedType.cs7
-rw-r--r--src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/SignatureVariable.RuntimeDetermined.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/TypeDesc.RuntimeDetermined.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/TypeSystemContext.RuntimeDetermined.cs6
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Serialization/FieldDesc.Serialization.cs4
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Serialization/TypeDesc.Serialization.cs4
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Sorting/ArrayType.Sorting.cs4
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Sorting/ByRefType.Sorting.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Sorting/FieldDesc.Sorting.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Sorting/FieldForInstantiatedType.Sorting.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Sorting/FunctionPointerType.Sorting.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Sorting/InstantiatedMethod.Sorting.cs6
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Sorting/InstantiatedType.Sorting.cs8
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Sorting/MethodDesc.Sorting.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Sorting/MethodForInstantiatedType.Sorting.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Sorting/MethodSignature.Sorting.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Sorting/PointerType.Sorting.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Sorting/SignatureVariable.Sorting.cs8
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Sorting/TypeDesc.Sorting.cs2
-rw-r--r--src/coreclr/tools/Common/TypeSystem/Sorting/TypeSystemComparer.cs1
310 files changed, 1047 insertions, 1443 deletions
diff --git a/src/coreclr/tools/Common/CommandLine/ArgumentParser.cs b/src/coreclr/tools/Common/CommandLine/ArgumentParser.cs
index 86515f5cb13..b538a669b93 100644
--- a/src/coreclr/tools/Common/CommandLine/ArgumentParser.cs
+++ b/src/coreclr/tools/Common/CommandLine/ArgumentParser.cs
@@ -18,7 +18,7 @@ namespace Internal.CommandLine
public ArgumentParser(IEnumerable<string> arguments, Func<string, IEnumerable<string>> responseFileReader)
{
if (arguments == null)
- throw new ArgumentNullException("arguments");
+ throw new ArgumentNullException(nameof(arguments));
_tokens = ArgumentLexer.Lex(arguments, responseFileReader);
}
diff --git a/src/coreclr/tools/Common/CommandLine/ArgumentSyntax.cs b/src/coreclr/tools/Common/CommandLine/ArgumentSyntax.cs
index 4cea1200b3a..976f2a559b1 100644
--- a/src/coreclr/tools/Common/CommandLine/ArgumentSyntax.cs
+++ b/src/coreclr/tools/Common/CommandLine/ArgumentSyntax.cs
@@ -34,10 +34,10 @@ namespace Internal.CommandLine
public static ArgumentSyntax Parse(IEnumerable<string> arguments, Action<ArgumentSyntax> defineAction)
{
if (arguments == null)
- throw new ArgumentNullException("arguments");
+ throw new ArgumentNullException(nameof(arguments));
if (defineAction == null)
- throw new ArgumentNullException("defineAction");
+ throw new ArgumentNullException(nameof(defineAction));
var syntax = new ArgumentSyntax(arguments);
defineAction(syntax);
@@ -107,12 +107,12 @@ namespace Internal.CommandLine
public ArgumentCommand<T> DefineCommand<T>(string name, T value)
{
if (string.IsNullOrEmpty(name))
- throw new ArgumentException(Strings.NameMissing, "name");
+ throw new ArgumentException(Strings.NameMissing, nameof(name));
if (!IsValidName(name))
{
var message = string.Format(Strings.CommandNameIsNotValidFmt, name);
- throw new ArgumentException(message, "name");
+ throw new ArgumentException(message, nameof(name));
}
if (_commands.Any(c => string.Equals(c.Name, name, StringComparison.Ordinal)))
@@ -143,7 +143,7 @@ namespace Internal.CommandLine
public Argument<T> DefineOption<T>(string name, T defaultValue, Func<string, T> valueConverter, bool isRequired)
{
if (string.IsNullOrEmpty(name))
- throw new ArgumentException(Strings.NameMissing, "name");
+ throw new ArgumentException(Strings.NameMissing, nameof(name));
if (DefinedParameters.Any())
throw new InvalidOperationException(Strings.OptionsMustBeDefinedBeforeParameters);
@@ -178,7 +178,7 @@ namespace Internal.CommandLine
public ArgumentList<T> DefineOptionList<T>(string name, IReadOnlyList<T> defaultValue, Func<string, T> valueConverter, bool isRequired)
{
if (string.IsNullOrEmpty(name))
- throw new ArgumentException(Strings.NameMissing, "name");
+ throw new ArgumentException(Strings.NameMissing, nameof(name));
if (DefinedParameters.Any())
throw new InvalidOperationException(Strings.OptionsMustBeDefinedBeforeParameters);
@@ -213,12 +213,12 @@ namespace Internal.CommandLine
public Argument<T> DefineParameter<T>(string name, T defaultValue, Func<string, T> valueConverter)
{
if (string.IsNullOrEmpty(name))
- throw new ArgumentException(Strings.NameMissing, "name");
+ throw new ArgumentException(Strings.NameMissing, nameof(name));
if (!IsValidName(name))
{
var message = string.Format(Strings.ParameterNameIsNotValidFmt, name);
- throw new ArgumentException(message, "name");
+ throw new ArgumentException(message, nameof(name));
}
if (DefinedParameters.Any(p => p.IsList))
@@ -252,12 +252,12 @@ namespace Internal.CommandLine
public ArgumentList<T> DefineParameterList<T>(string name, IReadOnlyList<T> defaultValue, Func<string, T> valueConverter)
{
if (string.IsNullOrEmpty(name))
- throw new ArgumentException(Strings.NameMissing, "name");
+ throw new ArgumentException(Strings.NameMissing, nameof(name));
if (!IsValidName(name))
{
var message = string.Format(Strings.ParameterNameIsNotValidFmt, name);
- throw new ArgumentException(message, "name");
+ throw new ArgumentException(message, nameof(name));
}
if (DefinedParameters.Any(p => p.IsList))
@@ -304,7 +304,7 @@ namespace Internal.CommandLine
if (!IsValidName(alias))
{
var message = string.Format(Strings.OptionNameIsNotValidFmt, alias);
- throw new ArgumentException(message, "name");
+ throw new ArgumentException(message, nameof(name));
}
foreach (var option in DefinedOptions)
@@ -358,8 +358,7 @@ namespace Internal.CommandLine
{
get
{
- if (_parser == null)
- _parser = new ArgumentParser(_arguments, ParseResponseFile);
+ _parser ??= new ArgumentParser(_arguments, ParseResponseFile);
return _parser;
}
@@ -457,15 +456,15 @@ namespace Internal.CommandLine
public IReadOnlyList<string> ExtraHelpParagraphs
{
+ get
+ {
+ return _extraHelpParagraphs.ToArray();
+ }
set
{
_extraHelpParagraphs.Clear();
_extraHelpParagraphs.AddRange(value);
}
- get
- {
- return _extraHelpParagraphs.ToArray();
- }
}
}
}
diff --git a/src/coreclr/tools/Common/CommandLine/ArgumentSyntax_Definers.cs b/src/coreclr/tools/Common/CommandLine/ArgumentSyntax_Definers.cs
index 0d98ced079d..83d9f675b42 100644
--- a/src/coreclr/tools/Common/CommandLine/ArgumentSyntax_Definers.cs
+++ b/src/coreclr/tools/Common/CommandLine/ArgumentSyntax_Definers.cs
@@ -10,7 +10,7 @@ namespace Internal.CommandLine
public partial class ArgumentSyntax
{
private static readonly Func<string, string> s_stringParser = v => v;
- private static readonly Func<string, bool> s_booleanParser = v => bool.Parse(v);
+ private static readonly Func<string, bool> s_booleanParser = bool.Parse;
private static readonly Func<string, int> s_int32Parser = v => int.Parse(v, CultureInfo.InvariantCulture);
// Commands
diff --git a/src/coreclr/tools/Common/CommandLine/ArgumentToken.cs b/src/coreclr/tools/Common/CommandLine/ArgumentToken.cs
index c93c63f961b..83ef63435d8 100644
--- a/src/coreclr/tools/Common/CommandLine/ArgumentToken.cs
+++ b/src/coreclr/tools/Common/CommandLine/ArgumentToken.cs
@@ -49,14 +49,14 @@ namespace Internal.CommandLine
public override bool Equals(object obj)
{
- if (ReferenceEquals(obj, null))
+ if (obj is null)
return false;
if (ReferenceEquals(obj, this))
return true;
var other = obj as ArgumentToken;
- return !ReferenceEquals(other, null) && Equals(other);
+ return other is not null && Equals(other);
}
public override int GetHashCode()
diff --git a/src/coreclr/tools/Common/CommandLine/CommandLineException.cs b/src/coreclr/tools/Common/CommandLine/CommandLineException.cs
index 1c42daf007f..3785047b6a5 100644
--- a/src/coreclr/tools/Common/CommandLine/CommandLineException.cs
+++ b/src/coreclr/tools/Common/CommandLine/CommandLineException.cs
@@ -5,7 +5,7 @@ using System;
namespace Internal.CommandLine
{
- internal class CommandLineException : Exception
+ internal sealed class CommandLineException : Exception
{
public CommandLineException(string message)
: base(message)
diff --git a/src/coreclr/tools/Common/CommandLine/CommandLineHelpers.cs b/src/coreclr/tools/Common/CommandLine/CommandLineHelpers.cs
index 25f2c7b9851..d7fa472f748 100644
--- a/src/coreclr/tools/Common/CommandLine/CommandLineHelpers.cs
+++ b/src/coreclr/tools/Common/CommandLine/CommandLineHelpers.cs
@@ -12,7 +12,7 @@ namespace Internal.CommandLine
//
// Helpers for command line processing
//
- internal class Helpers
+ internal static class Helpers
{
// Helper to create a collection of paths unique in their simple names.
public static void AppendExpandedPaths(Dictionary<string, string> dictionary, string pattern, bool strict)
@@ -102,7 +102,7 @@ namespace Internal.CommandLine
}
}
- HashCode hashCodeOfArgs = new HashCode();
+ HashCode hashCodeOfArgs = default(HashCode);
foreach (string s in details)
hashCodeOfArgs.Add(s);
@@ -143,7 +143,7 @@ namespace Internal.CommandLine
Dictionary<string, string> dictionary = new Dictionary<string, string>();
foreach (string optInList in (IEnumerable)option.Value)
{
- Helpers.AppendExpandedPaths(dictionary, optInList, false);
+ AppendExpandedPaths(dictionary, optInList, false);
}
foreach (string inputFile in dictionary.Values)
{
diff --git a/src/coreclr/tools/Common/CommandLine/HelpTextGenerator.cs b/src/coreclr/tools/Common/CommandLine/HelpTextGenerator.cs
index afe1f0a1a5d..3c2f6219013 100644
--- a/src/coreclr/tools/Common/CommandLine/HelpTextGenerator.cs
+++ b/src/coreclr/tools/Common/CommandLine/HelpTextGenerator.cs
@@ -65,7 +65,7 @@ namespace Internal.CommandLine
sb.Append(usageHeader);
if (syntaxElements.Any())
- sb.Append(@" ");
+ sb.Append(' ');
var syntaxIndent = usageHeader.Length + 1;
var syntaxMaxWidth = maxWidth - syntaxIndent;
@@ -169,7 +169,7 @@ namespace Internal.CommandLine
{
var sb = new StringBuilder();
- sb.Append(@"[");
+ sb.Append('[');
sb.Append(option.GetDisplayName());
if (!option.IsFlag)
@@ -178,7 +178,7 @@ namespace Internal.CommandLine
if (option.IsList)
sb.Append(@"...");
- sb.Append(@"]");
+ sb.Append(']');
return sb.ToString();
}
@@ -252,7 +252,7 @@ namespace Internal.CommandLine
}
if (sb.Length > 0)
- sb.Append(@" ");
+ sb.Append(' ');
sb.Append(token);
}
diff --git a/src/coreclr/tools/Common/Compiler/CodeGenerationFailedException.cs b/src/coreclr/tools/Common/Compiler/CodeGenerationFailedException.cs
index 0001807c0cf..671bb60ec2e 100644
--- a/src/coreclr/tools/Common/Compiler/CodeGenerationFailedException.cs
+++ b/src/coreclr/tools/Common/Compiler/CodeGenerationFailedException.cs
@@ -19,7 +19,7 @@ namespace ILCompiler
}
public CodeGenerationFailedException(MethodDesc method, Exception inner)
- : base(String.Format(MessageText, method), inner)
+ : base(string.Format(MessageText, method), inner)
{
Method = method;
}
diff --git a/src/coreclr/tools/Common/Compiler/CompilerTypeSystemContext.Validation.cs b/src/coreclr/tools/Common/Compiler/CompilerTypeSystemContext.Validation.cs
index 2766d7226bf..dcbccd62283 100644
--- a/src/coreclr/tools/Common/Compiler/CompilerTypeSystemContext.Validation.cs
+++ b/src/coreclr/tools/Common/Compiler/CompilerTypeSystemContext.Validation.cs
@@ -9,7 +9,7 @@ namespace ILCompiler
{
// Validates types to the extent that is required to make sure the compilation won't fail
// in unpredictable spots.
- partial class CompilerTypeSystemContext
+ public partial class CompilerTypeSystemContext
{
/// <summary>
/// Ensures that the type can be fully loaded. The method will throw one of the type system
@@ -33,7 +33,7 @@ namespace ILCompiler
}
}
- class ValidTypeHashTable : LockFreeReaderHashtable<TypeDesc, TypeDesc>
+ private sealed class ValidTypeHashTable : LockFreeReaderHashtable<TypeDesc, TypeDesc>
{
protected override bool CompareKeyToValue(TypeDesc key, TypeDesc value) => key == value;
protected override bool CompareValueToValue(TypeDesc value1, TypeDesc value2) => value1 == value2;
diff --git a/src/coreclr/tools/Common/Compiler/CompilerTypeSystemContext.cs b/src/coreclr/tools/Common/Compiler/CompilerTypeSystemContext.cs
index 510a657cc84..21a1a0307e6 100644
--- a/src/coreclr/tools/Common/Compiler/CompilerTypeSystemContext.cs
+++ b/src/coreclr/tools/Common/Compiler/CompilerTypeSystemContext.cs
@@ -21,7 +21,7 @@ namespace ILCompiler
private MetadataStringDecoder _metadataStringDecoder;
- private class ModuleData
+ private sealed class ModuleData
{
public string SimpleName;
public string FilePath;
@@ -30,7 +30,7 @@ namespace ILCompiler
public MemoryMappedViewAccessor MappedViewAccessor;
}
- private class ModuleHashtable : LockFreeReaderHashtable<EcmaModule, ModuleData>
+ private sealed class ModuleHashtable : LockFreeReaderHashtable<EcmaModule, ModuleData>
{
protected override int GetKeyHashCode(EcmaModule key)
{
@@ -42,11 +42,11 @@ namespace ILCompiler
}
protected override bool CompareKeyToValue(EcmaModule key, ModuleData value)
{
- return Object.ReferenceEquals(key, value.Module);
+ return ReferenceEquals(key, value.Module);
}
protected override bool CompareValueToValue(ModuleData value1, ModuleData value2)
{
- return Object.ReferenceEquals(value1.Module, value2.Module);
+ return ReferenceEquals(value1.Module, value2.Module);
}
protected override ModuleData CreateValueFromKey(EcmaModule key)
{
@@ -56,9 +56,9 @@ namespace ILCompiler
}
private readonly ModuleHashtable _moduleHashtable = new ModuleHashtable();
- private class SimpleNameHashtable : LockFreeReaderHashtable<string, ModuleData>
+ private sealed class SimpleNameHashtable : LockFreeReaderHashtable<string, ModuleData>
{
- StringComparer _comparer = StringComparer.OrdinalIgnoreCase;
+ private StringComparer _comparer = StringComparer.OrdinalIgnoreCase;
protected override int GetKeyHashCode(string key)
{
@@ -254,10 +254,8 @@ namespace ILCompiler
}
finally
{
- if (mappedViewAccessor != null)
- mappedViewAccessor.Dispose();
- if (pdbReader != null)
- pdbReader.Dispose();
+ mappedViewAccessor?.Dispose();
+ pdbReader?.Dispose();
}
}
@@ -314,8 +312,7 @@ namespace ILCompiler
public MetadataStringDecoder GetMetadataStringDecoder()
{
- if (_metadataStringDecoder == null)
- _metadataStringDecoder = new CachingMetadataStringDecoder(0x10000); // TODO: Tune the size
+ _metadataStringDecoder ??= new CachingMetadataStringDecoder(0x10000); // TODO: Tune the size
return _metadataStringDecoder;
}
@@ -354,11 +351,8 @@ namespace ILCompiler
// Try to open the symbol file as portable pdb first
PdbSymbolReader reader = PortablePdbSymbolReader.TryOpen(pdbFileName, GetMetadataStringDecoder(), pdbContentId);
- if (reader == null)
- {
- // Fallback to the diasymreader for non-portable pdbs
- reader = UnmanagedPdbSymbolReader.TryOpenSymbolReaderForMetadataFile(peFilePath, Path.GetDirectoryName(pdbFileName));
- }
+ // Fallback to the diasymreader for non-portable pdbs
+ reader ??= UnmanagedPdbSymbolReader.TryOpenSymbolReaderForMetadataFile(peFilePath, Path.GetDirectoryName(pdbFileName));
return reader;
}
diff --git a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/CompilerComparer.cs b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/CompilerComparer.cs
index 46f9e704a84..c95c6c318dc 100644
--- a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/CompilerComparer.cs
+++ b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/CompilerComparer.cs
@@ -1,7 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
using System.Diagnostics;
using System.Collections.Generic;
diff --git a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/EmbeddedDataContainerNode.cs b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/EmbeddedDataContainerNode.cs
index da756fcd16b..3aa40631fb3 100644
--- a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/EmbeddedDataContainerNode.cs
+++ b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/EmbeddedDataContainerNode.cs
@@ -1,12 +1,10 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using Internal.TypeSystem;
-
namespace ILCompiler.DependencyAnalysis
{
/// <summary>
- /// Represents a node that contains a set of embedded objects. The main function is
+ /// Represents a node that contains a set of embedded objects. The main function is
/// to serve as a base class, providing symbol name boundaries and node ordering.
/// </summary>
public abstract class EmbeddedDataContainerNode : ObjectNode
diff --git a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/INodeWithRuntimeDeterminedDependencies.cs b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/INodeWithRuntimeDeterminedDependencies.cs
index 301cf4d2948..645835a365d 100644
--- a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/INodeWithRuntimeDeterminedDependencies.cs
+++ b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/INodeWithRuntimeDeterminedDependencies.cs
@@ -4,11 +4,10 @@
using System.Collections.Generic;
using Internal.TypeSystem;
+using DependencyListEntry = ILCompiler.DependencyAnalysisFramework.DependencyNodeCore<ILCompiler.DependencyAnalysis.NodeFactory>.DependencyListEntry;
namespace ILCompiler.DependencyAnalysis
{
- using DependencyListEntry = DependencyAnalysisFramework.DependencyNodeCore<NodeFactory>.DependencyListEntry;
-
/// <summary>
/// Represents a node whose dependencies are runtime determined (they depend on the generic context)
/// and which provides means to compute concrete dependencies when given the generic context.
diff --git a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/ISymbolNode.cs b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/ISymbolNode.cs
index 92ea4ca92b1..336c0121502 100644
--- a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/ISymbolNode.cs
+++ b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/ISymbolNode.cs
@@ -76,13 +76,12 @@ namespace ILCompiler.DependencyAnalysis
public static class ISymbolNodeExtensions
{
[ThreadStatic]
- static Utf8StringBuilder s_cachedUtf8StringBuilder;
+ private static Utf8StringBuilder s_cachedUtf8StringBuilder;
public static string GetMangledName(this ISymbolNode symbolNode, NameMangler nameMangler)
{
Utf8StringBuilder sb = s_cachedUtf8StringBuilder;
- if (sb == null)
- sb = new Utf8StringBuilder();
+ sb ??= new Utf8StringBuilder();
symbolNode.AppendMangledName(nameMangler, sb);
string ret = sb.ToString();
diff --git a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/MethodReadOnlyDataNode.cs b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/MethodReadOnlyDataNode.cs
index 20526662242..9a8e941f022 100644
--- a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/MethodReadOnlyDataNode.cs
+++ b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/MethodReadOnlyDataNode.cs
@@ -1,7 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
using System.Diagnostics;
using Internal.Text;
@@ -52,4 +51,3 @@ namespace ILCompiler.DependencyAnalysis
#endif
}
}
-
diff --git a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/ObjectAndOffsetSymbolNode.cs b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/ObjectAndOffsetSymbolNode.cs
index ab8cb36d111..0f15706ea68 100644
--- a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/ObjectAndOffsetSymbolNode.cs
+++ b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/ObjectAndOffsetSymbolNode.cs
@@ -24,7 +24,7 @@ namespace ILCompiler.DependencyAnalysis
_includeCompilationUnitPrefix = includeCompilationUnitPrefix;
}
- protected override string GetName(NodeFactory factory) => $"Symbol {_name.ToString()} at offset {_offset.ToStringInvariant()}";
+ protected override string GetName(NodeFactory factory) => $"Symbol {_name} at offset {_offset.ToStringInvariant()}";
public override bool HasConditionalStaticDependencies => false;
public override bool HasDynamicDependencies => false;
diff --git a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/ObjectDataBuilder.cs b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/ObjectDataBuilder.cs
index f20020ad710..ff5cee89663 100644
--- a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/ObjectDataBuilder.cs
+++ b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/ObjectDataBuilder.cs
@@ -21,10 +21,10 @@ namespace ILCompiler.DependencyAnalysis
public ObjectDataBuilder(TargetDetails target, bool relocsOnly)
{
_target = target;
- _data = new ArrayBuilder<byte>();
- _relocs = new ArrayBuilder<Relocation>();
+ _data = default(ArrayBuilder<byte>);
+ _relocs = default(ArrayBuilder<Relocation>);
Alignment = 1;
- _definedSymbols = new ArrayBuilder<ISymbolDefinitionNode>();
+ _definedSymbols = default(ArrayBuilder<ISymbolDefinitionNode>);
#if DEBUG
_numReservations = 0;
_checkAllSymbolDependenciesMustBeMarked = !relocsOnly;
@@ -213,7 +213,9 @@ namespace ILCompiler.DependencyAnalysis
return ticket;
}
+#pragma warning disable CA1822 // Mark members as static
private int ReturnReservationTicket(Reservation reservation)
+#pragma warning restore CA1822 // Mark members as static
{
#if DEBUG
Debug.Assert(_numReservations > 0);
@@ -308,7 +310,7 @@ namespace ILCompiler.DependencyAnalysis
Debug.Assert(delta == 0);
// Do not vacate space for this kind of relocation, because
// the space is embedded in the instruction.
- break;
+ break;
default:
throw new NotImplementedException();
}
diff --git a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/ObjectNode.cs b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/ObjectNode.cs
index 68b984519d2..5122c584ae0 100644
--- a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/ObjectNode.cs
+++ b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/ObjectNode.cs
@@ -5,7 +5,6 @@ using System;
using System.Collections.Generic;
using ILCompiler.DependencyAnalysisFramework;
-using Internal.TypeSystem;
namespace ILCompiler.DependencyAnalysis
{
@@ -61,8 +60,7 @@ namespace ILCompiler.DependencyAnalysis
if (relocs != null)
{
- if (dependencies == null)
- dependencies = new DependencyList();
+ dependencies ??= new DependencyList();
foreach (Relocation reloc in relocs)
{
diff --git a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/ObjectNodeSection.cs b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/ObjectNodeSection.cs
index f4a6179b7f3..c5ad884fa4c 100644
--- a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/ObjectNodeSection.cs
+++ b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/ObjectNodeSection.cs
@@ -1,8 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-
namespace ILCompiler.DependencyAnalysis
{
public enum SectionType
@@ -41,7 +39,7 @@ namespace ILCompiler.DependencyAnalysis
return this == DataSection || this == ReadOnlyDataSection || this == FoldableReadOnlyDataSection || this == TextSection || this == XDataSection || this == BssSection;
}
}
-
+
public static readonly ObjectNodeSection XDataSection = new ObjectNodeSection("xdata", SectionType.ReadOnly);
public static readonly ObjectNodeSection DataSection = new ObjectNodeSection("data", SectionType.Writeable);
public static readonly ObjectNodeSection ReadOnlyDataSection = new ObjectNodeSection("rdata", SectionType.ReadOnly);
diff --git a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/ShadowConcreteMethodNode.cs b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/ShadowConcreteMethodNode.cs
index 57ea2b98149..140a97f7092 100644
--- a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/ShadowConcreteMethodNode.cs
+++ b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/ShadowConcreteMethodNode.cs
@@ -85,7 +85,7 @@ namespace ILCompiler.DependencyAnalysis
return dependencies;
}
- protected override string GetName(NodeFactory factory) => $"{Method.ToString()} backed by {CanonicalMethodNode.GetMangledName(factory.NameMangler)}";
+ protected override string GetName(NodeFactory factory) => $"{Method} backed by {CanonicalMethodNode.GetMangledName(factory.NameMangler)}";
public sealed override bool HasConditionalStaticDependencies => false;
public sealed override bool HasDynamicDependencies => false;
diff --git a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/SortableDependencyNode.cs b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/SortableDependencyNode.cs
index 2c677d51b05..a29c732e081 100644
--- a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/SortableDependencyNode.cs
+++ b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/SortableDependencyNode.cs
@@ -7,7 +7,6 @@ using System.Diagnostics;
using System.Runtime.CompilerServices;
using ILCompiler.DependencyAnalysisFramework;
-using Internal.TypeSystem;
namespace ILCompiler.DependencyAnalysis
{
@@ -49,7 +48,7 @@ namespace ILCompiler.DependencyAnalysis
protected enum ObjectNodeOrder
{
//
- // The ordering of this sequence of nodes is deliberate and currently required for
+ // The ordering of this sequence of nodes is deliberate and currently required for
// compiler correctness.
//
diff --git a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_ARM/ARMEmitter.cs b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_ARM/ARMEmitter.cs
index 53bcb335e05..dd41f891552 100644
--- a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_ARM/ARMEmitter.cs
+++ b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_ARM/ARMEmitter.cs
@@ -1,7 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
using System.Diagnostics;
namespace ILCompiler.DependencyAnalysis.ARM
@@ -82,7 +81,7 @@ namespace ILCompiler.DependencyAnalysis.ARM
Builder.EmitByte(0xde);
Builder.EmitByte(0xfe);
}
-
+
// push reg
// reg range: [0..12, LR]
public void EmitPUSH(Register reg)
diff --git a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_ARM/Register.cs b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_ARM/Register.cs
index 59cc4b74753..52177862570 100644
--- a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_ARM/Register.cs
+++ b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_ARM/Register.cs
@@ -1,12 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
namespace ILCompiler.DependencyAnalysis.ARM
{
public enum Register
@@ -27,7 +21,7 @@ namespace ILCompiler.DependencyAnalysis.ARM
R13 = 13,
R14 = 14,
R15 = 15,
-
+
None = 16,
RegDirect = 24,
diff --git a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_ARM/TargetRegisterMap.cs b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_ARM/TargetRegisterMap.cs
index 73dc986c569..4091fa26344 100644
--- a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_ARM/TargetRegisterMap.cs
+++ b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_ARM/TargetRegisterMap.cs
@@ -1,8 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-
using Internal.TypeSystem;
namespace ILCompiler.DependencyAnalysis.ARM
diff --git a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_ARM64/ARM64Emitter.cs b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_ARM64/ARM64Emitter.cs
index 895f2f9d1a0..7ef040f23c2 100644
--- a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_ARM64/ARM64Emitter.cs
+++ b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_ARM64/ARM64Emitter.cs
@@ -175,11 +175,11 @@ namespace ILCompiler.DependencyAnalysis.ARM64
uint offset = symbol.RepresentsIndirectionCell ? 6u : 2u;
Builder.EmitUInt(0b01010100_0000000000000000000_0_0001u | offset << 5);
-
+
EmitJMP(symbol);
}
- private bool InSignedByteRange(int i)
+ private static bool InSignedByteRange(int i)
{
return i == (int)(sbyte)i;
}
diff --git a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_ARM64/AddrMode.cs b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_ARM64/AddrMode.cs
index 410eb8b349f..e984d130bc2 100644
--- a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_ARM64/AddrMode.cs
+++ b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_ARM64/AddrMode.cs
@@ -1,8 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-
namespace ILCompiler.DependencyAnalysis.ARM64
{
public enum AddrModeSize
diff --git a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_ARM64/Register.cs b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_ARM64/Register.cs
index aa102c85db7..05b853de18c 100644
--- a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_ARM64/Register.cs
+++ b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_ARM64/Register.cs
@@ -1,12 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
namespace ILCompiler.DependencyAnalysis.ARM64
{
public enum Register
@@ -42,9 +36,9 @@ namespace ILCompiler.DependencyAnalysis.ARM64
X28 = 28,
X29 = 29,
X30 = 30,
-
+
X31 = 31,
-
+
None = 32,
NoIndex = 128,
}
diff --git a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_ARM64/TargetRegisterMap.cs b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_ARM64/TargetRegisterMap.cs
index 5a328f4c650..1ea6409b34d 100644
--- a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_ARM64/TargetRegisterMap.cs
+++ b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_ARM64/TargetRegisterMap.cs
@@ -1,8 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-
using Internal.TypeSystem;
namespace ILCompiler.DependencyAnalysis.ARM64
diff --git a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_LoongArch64/AddrMode.cs b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_LoongArch64/AddrMode.cs
index 5616941cae2..117c766383d 100644
--- a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_LoongArch64/AddrMode.cs
+++ b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_LoongArch64/AddrMode.cs
@@ -1,8 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-
namespace ILCompiler.DependencyAnalysis.LoongArch64
{
public enum AddrModeSize
diff --git a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_LoongArch64/Register.cs b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_LoongArch64/Register.cs
index 1ce65e76622..44596447974 100644
--- a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_LoongArch64/Register.cs
+++ b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_LoongArch64/Register.cs
@@ -1,12 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
namespace ILCompiler.DependencyAnalysis.LoongArch64
{
public enum Register
diff --git a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_LoongArch64/TargetRegisterMap.cs b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_LoongArch64/TargetRegisterMap.cs
index a1b5808c94b..e66dd4824e3 100644
--- a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_LoongArch64/TargetRegisterMap.cs
+++ b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_LoongArch64/TargetRegisterMap.cs
@@ -1,8 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-
using Internal.TypeSystem;
namespace ILCompiler.DependencyAnalysis.LoongArch64
diff --git a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_X64/AddrMode.cs b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_X64/AddrMode.cs
index c787523125f..f13f68773f3 100644
--- a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_X64/AddrMode.cs
+++ b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_X64/AddrMode.cs
@@ -1,8 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-
namespace ILCompiler.DependencyAnalysis.X64
{
public enum AddrModeSize
diff --git a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_X64/Register.cs b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_X64/Register.cs
index 9b88bd61595..09768266eb0 100644
--- a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_X64/Register.cs
+++ b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_X64/Register.cs
@@ -1,12 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
namespace ILCompiler.DependencyAnalysis.X64
{
public enum Register
diff --git a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_X64/X64Emitter.cs b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_X64/X64Emitter.cs
index 17135f6c4e4..b88bb7f1002 100644
--- a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_X64/X64Emitter.cs
+++ b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_X64/X64Emitter.cs
@@ -189,7 +189,7 @@ namespace ILCompiler.DependencyAnalysis.X64
Builder.EmitByte((byte)(0xC0 | (((int)reg & 0x07) << 3) | ((int)reg & 0x07)));
}
- private bool InSignedByteRange(int i)
+ private static bool InSignedByteRange(int i)
{
return i == (int)(sbyte)i;
}
@@ -228,8 +228,7 @@ namespace ILCompiler.DependencyAnalysis.X64
{
byte lowOrderBitsOfBaseReg = (byte)((int)addrMode.BaseReg & 0x07);
modRM |= lowOrderBitsOfBaseReg;
- int offsetSize = 0;
-
+ int offsetSize;
if (addrMode.Offset == 0 && (lowOrderBitsOfBaseReg != (byte)Register.RBP))
{
offsetSize = 0;
@@ -250,7 +249,7 @@ namespace ILCompiler.DependencyAnalysis.X64
if (addrMode.BaseReg == Register.None)
{
- //# ifdef _TARGET_AMD64_
+ //# ifdef _TARGET_AMD64_
// x64 requires SIB to avoid RIP relative address
emitSibByte = true;
//#else
@@ -287,7 +286,7 @@ namespace ILCompiler.DependencyAnalysis.X64
modRM = (byte)((modRM & 0xF8) | (int)Register.RSP);
Builder.EmitByte(modRM);
- int indexRegAsInt = (int)(addrMode.IndexReg.HasValue ? addrMode.IndexReg.Value : Register.RSP);
+ int indexRegAsInt = (int)(addrMode.IndexReg ?? Register.RSP);
Builder.EmitByte((byte)((addrMode.Scale << 6) + ((indexRegAsInt & 0x07) << 3) + ((int)sibByteBaseRegister & 0x07)));
}
diff --git a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_X86/AddrMode.cs b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_X86/AddrMode.cs
index b09e5a32ad1..302e234ded3 100644
--- a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_X86/AddrMode.cs
+++ b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_X86/AddrMode.cs
@@ -1,8 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-
namespace ILCompiler.DependencyAnalysis.X86
{
public enum AddrModeSize
diff --git a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_X86/Register.cs b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_X86/Register.cs
index e75f86e6bc3..4989557832c 100644
--- a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_X86/Register.cs
+++ b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_X86/Register.cs
@@ -1,12 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
namespace ILCompiler.DependencyAnalysis.X86
{
public enum Register
@@ -19,7 +13,7 @@ namespace ILCompiler.DependencyAnalysis.X86
EBP = 5,
ESI = 6,
EDI = 7,
-
+
None = 8,
RegDirect = 24,
diff --git a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_X86/TargetRegisterMap.cs b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_X86/TargetRegisterMap.cs
index 70ca0daf934..de2c913f8e1 100644
--- a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_X86/TargetRegisterMap.cs
+++ b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_X86/TargetRegisterMap.cs
@@ -26,7 +26,7 @@ namespace ILCompiler.DependencyAnalysis.X86
Arg1 = Register.EDX;
Result = Register.EAX;
break;
-
+
default:
throw new NotImplementedException();
}
diff --git a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_X86/X86Emitter.cs b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_X86/X86Emitter.cs
index cd95c3cbcf0..e386e9a34da 100644
--- a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_X86/X86Emitter.cs
+++ b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_X86/X86Emitter.cs
@@ -118,7 +118,7 @@ namespace ILCompiler.DependencyAnalysis.X86
Builder.EmitByte(0xC3);
}
- private bool InSignedByteRange(int i)
+ private static bool InSignedByteRange(int i)
{
return i == (int)(sbyte)i;
}
@@ -157,8 +157,7 @@ namespace ILCompiler.DependencyAnalysis.X86
{
byte lowOrderBitsOfBaseReg = (byte)((int)addrMode.BaseReg & 0x07);
modRM |= lowOrderBitsOfBaseReg;
- int offsetSize = 0;
-
+ int offsetSize;
if (addrMode.Offset == 0 && (lowOrderBitsOfBaseReg != (byte)Register.EBP))
{
offsetSize = 0;
@@ -208,7 +207,7 @@ namespace ILCompiler.DependencyAnalysis.X86
{
modRM = (byte)((modRM & 0xF8) | (int)Register.ESP);
Builder.EmitByte(modRM);
- int indexRegAsInt = (int)(addrMode.IndexReg.HasValue ? addrMode.IndexReg.Value : Register.ESP);
+ int indexRegAsInt = (int)(addrMode.IndexReg ?? Register.ESP);
Builder.EmitByte((byte)((addrMode.Scale << 6) + ((indexRegAsInt & 0x07) << 3) + ((int)sibByteBaseRegister & 0x07)));
}
EmitImmediate(addrMode.Offset, offsetSize);
@@ -226,7 +225,7 @@ namespace ILCompiler.DependencyAnalysis.X86
Builder.EmitByte((byte)(opcode >> 16));
}
Builder.EmitByte((byte)(opcode >> 8));
- }
+ }
private void EmitIndirInstruction(int opcode, byte subOpcode, ref AddrMode addrMode)
{
diff --git a/src/coreclr/tools/Common/Compiler/DevirtualizationManager.cs b/src/coreclr/tools/Common/Compiler/DevirtualizationManager.cs
index 2fb34cede26..6222ec6d649 100644
--- a/src/coreclr/tools/Common/Compiler/DevirtualizationManager.cs
+++ b/src/coreclr/tools/Common/Compiler/DevirtualizationManager.cs
@@ -1,7 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
using Internal.TypeSystem;
using CORINFO_DEVIRTUALIZATION_DETAIL = Internal.JitInterface.CORINFO_DEVIRTUALIZATION_DETAIL;
using Debug = System.Diagnostics.Debug;
@@ -107,7 +106,6 @@ namespace ILCompiler
}
else
{
- MethodDesc dimMethod = null;
// This isn't the correct lookup algorithm for variant default interface methods
// but as we will drop any results we find in any case, it doesn't matter much.
// Non-variant dispatch can simply use ResolveInterfaceMethodToDefaultImplementationOnType
@@ -130,6 +128,7 @@ namespace ILCompiler
if (defaultInterfaceDispatchDeclMethod != null)
{
+ MethodDesc dimMethod;
switch (implType.ResolveInterfaceMethodToDefaultImplementationOnType(defaultInterfaceDispatchDeclMethod, out dimMethod))
{
case DefaultInterfaceMethodResolution.Diamond:
diff --git a/src/coreclr/tools/Common/Compiler/DisplayNameHelpers.cs b/src/coreclr/tools/Common/Compiler/DisplayNameHelpers.cs
index 55be359be4b..341c361253d 100644
--- a/src/coreclr/tools/Common/Compiler/DisplayNameHelpers.cs
+++ b/src/coreclr/tools/Common/Compiler/DisplayNameHelpers.cs
@@ -7,8 +7,6 @@ using System.Text;
using Internal.TypeSystem;
using Internal.TypeSystem.Ecma;
-using Debug = System.Diagnostics.Debug;
-
namespace ILCompiler
{
public static class DisplayNameHelpers
@@ -140,9 +138,9 @@ namespace ILCompiler
return Formatter.Instance.FormatName(type, FormatOptions.None);
}
- private class Formatter : TypeNameFormatter<Formatter.Unit, FormatOptions>
+ private sealed class Formatter : TypeNameFormatter<Formatter.Unit, FormatOptions>
{
- public readonly static Formatter Instance = new Formatter();
+ public static readonly Formatter Instance = new Formatter();
public override Unit AppendName(StringBuilder sb, ArrayType type, FormatOptions options)
{
@@ -243,7 +241,7 @@ namespace ILCompiler
return default;
}
- private void NamespaceQualify(StringBuilder sb, DefType type, FormatOptions options)
+ private static void NamespaceQualify(StringBuilder sb, DefType type, FormatOptions options)
{
if ((options & FormatOptions.NamespaceQualify) != 0)
{
diff --git a/src/coreclr/tools/Common/Compiler/HardwareIntrinsicHelpers.cs b/src/coreclr/tools/Common/Compiler/HardwareIntrinsicHelpers.cs
index f20fa1ae352..a523f1c5f09 100644
--- a/src/coreclr/tools/Common/Compiler/HardwareIntrinsicHelpers.cs
+++ b/src/coreclr/tools/Common/Compiler/HardwareIntrinsicHelpers.cs
@@ -1,12 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-
using Internal.TypeSystem;
-using Internal.IL;
-using Internal.IL.Stubs;
-using System.Diagnostics;
namespace ILCompiler
{
diff --git a/src/coreclr/tools/Common/Compiler/InstructionSetSupport.cs b/src/coreclr/tools/Common/Compiler/InstructionSetSupport.cs
index 1ce1851dc1d..affc29d1931 100644
--- a/src/coreclr/tools/Common/Compiler/InstructionSetSupport.cs
+++ b/src/coreclr/tools/Common/Compiler/InstructionSetSupport.cs
@@ -4,7 +4,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
-using System.Linq;
using Internal.TypeSystem;
using Internal.JitInterface;
@@ -124,8 +123,8 @@ namespace ILCompiler
public class InstructionSetSupportBuilder
{
- static Dictionary<TargetArchitecture, Dictionary<string, InstructionSet>> s_instructionSetSupport = ComputeInstructionSetSupport();
- static Dictionary<TargetArchitecture, InstructionSetFlags> s_nonSpecifiableInstructionSets = ComputeNonSpecifiableInstructionSetSupport();
+ private static Dictionary<TargetArchitecture, Dictionary<string, InstructionSet>> s_instructionSetSupport = ComputeInstructionSetSupport();
+ private static Dictionary<TargetArchitecture, InstructionSetFlags> s_nonSpecifiableInstructionSets = ComputeNonSpecifiableInstructionSetSupport();
private static Dictionary<TargetArchitecture, Dictionary<string, InstructionSet>> ComputeInstructionSetSupport()
{
diff --git a/src/coreclr/tools/Common/Compiler/MethodExtensions.cs b/src/coreclr/tools/Common/Compiler/MethodExtensions.cs
index 6b7513410e3..dd43f2d4c2a 100644
--- a/src/coreclr/tools/Common/Compiler/MethodExtensions.cs
+++ b/src/coreclr/tools/Common/Compiler/MethodExtensions.cs
@@ -1,12 +1,9 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
using Internal.TypeSystem;
using Internal.TypeSystem.Ecma;
-using Debug = System.Diagnostics.Debug;
-
namespace ILCompiler
{
public static class MethodExtensions
diff --git a/src/coreclr/tools/Common/Compiler/NativeAotNameMangler.cs b/src/coreclr/tools/Common/Compiler/NativeAotNameMangler.cs
index 65e58642aca..bcb1aeeed2a 100644
--- a/src/coreclr/tools/Common/Compiler/NativeAotNameMangler.cs
+++ b/src/coreclr/tools/Common/Compiler/NativeAotNameMangler.cs
@@ -15,8 +15,6 @@ namespace ILCompiler
{
public class NativeAotNameMangler : NameMangler
{
- private SHA256 _sha256;
-
#if !READYTORUN
private readonly bool _mangleForCplusPlus;
@@ -32,12 +30,12 @@ namespace ILCompiler
public override string CompilationUnitPrefix
{
- set { _compilationUnitPrefix = SanitizeNameWithHash(value); }
get
{
Debug.Assert(_compilationUnitPrefix != null);
return _compilationUnitPrefix;
}
+ set { _compilationUnitPrefix = SanitizeNameWithHash(value); }
}
//
@@ -50,29 +48,25 @@ namespace ILCompiler
{
char c = s[i];
- if (((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z')))
+ if (char.IsAsciiLetter(c))
{
- if (sb != null)
- sb.Append(c);
+ sb?.Append(c);
continue;
}
- if ((c >= '0') && (c <= '9'))
+ if (char.IsAsciiDigit(c))
{
// C identifiers cannot start with a digit. Prepend underscores.
if (i == 0)
{
- if (sb == null)
- sb = new StringBuilder(s.Length + 2);
- sb.Append("_");
+ sb ??= new StringBuilder(s.Length + 2);
+ sb.Append('_');
}
- if (sb != null)
- sb.Append(c);
+ sb?.Append(c);
continue;
}
- if (sb == null)
- sb = new StringBuilder(s, 0, i, s.Length);
+ sb ??= new StringBuilder(s, 0, i, s.Length);
// For CppCodeGen, replace "." (C# namespace separator) with "::" (C++ namespace separator)
if (typeName && c == '.' && _mangleForCplusPlus)
@@ -83,7 +77,7 @@ namespace ILCompiler
// Everything else is replaced by underscore.
// TODO: We assume that there won't be collisions with our own or C++ built-in identifiers.
- sb.Append("_");
+ sb.Append('_');
}
string sanitizedName = (sb != null) ? sb.ToString() : s;
@@ -121,16 +115,11 @@ namespace ILCompiler
byte[] hash;
lock (this)
{
- if (_sha256 == null)
- {
- // Use SHA256 hash here to provide a high degree of uniqueness to symbol names without requiring them to be long
- // This hash function provides an exceedingly high likelihood that no two strings will be given equal symbol names
- // This is not considered used for security purpose; however collisions would be highly unfortunate as they will cause compilation
- // failure.
- _sha256 = SHA256.Create();
- }
-
- hash = _sha256.ComputeHash(GetBytesFromString(literal));
+ // Use SHA256 hash here to provide a high degree of uniqueness to symbol names without requiring them to be long
+ // This hash function provides an exceedingly high likelihood that no two strings will be given equal symbol names
+ // This is not considered used for security purpose; however collisions would be highly unfortunate as they will cause compilation
+ // failure.
+ hash = SHA256.HashData(GetBytesFromString(literal));
}
mangledName += "_" + BitConverter.ToString(hash).Replace("-", "");
@@ -151,7 +140,7 @@ namespace ILCompiler
/// <param name="origName">Name to check for uniqueness.</param>
/// <param name="set">Set of names already used.</param>
/// <returns>A name based on <param name="origName"/> that is not part of <param name="set"/>.</returns>
- private string DisambiguateName(string origName, ISet<string> set)
+ private static string DisambiguateName(string origName, ISet<string> set)
{
int iter = 0;
string result = origName;
@@ -193,10 +182,8 @@ namespace ILCompiler
/// <returns>Mangled name for <param name="type"/>.</returns>
private string ComputeMangledTypeName(TypeDesc type)
{
- if (type is EcmaType)
+ if (type is EcmaType ecmaType)
{
- EcmaType ecmaType = (EcmaType)type;
-
string assemblyName = ((EcmaAssembly)ecmaType.EcmaModule).GetName().Name;
bool isSystemPrivate = assemblyName.StartsWith("System.Private.");
@@ -204,7 +191,7 @@ namespace ILCompiler
// but we already have a problem due to running SanitizeName without disambiguating the result
// This problem needs a better fix.
if (isSystemPrivate && !_mangleForCplusPlus)
- assemblyName = "S.P." + assemblyName.Substring(15);
+ assemblyName = string.Concat("S.P.", assemblyName.AsSpan(15));
string prependAssemblyName = SanitizeName(assemblyName);
var deduplicator = new HashSet<string>();
diff --git a/src/coreclr/tools/Common/Compiler/TypeExtensions.cs b/src/coreclr/tools/Common/Compiler/TypeExtensions.cs
index 47cdc09d7bb..f50028f09c4 100644
--- a/src/coreclr/tools/Common/Compiler/TypeExtensions.cs
+++ b/src/coreclr/tools/Common/Compiler/TypeExtensions.cs
@@ -3,8 +3,6 @@
using System;
using System.Runtime.CompilerServices;
-
-using Internal.IL;
using Internal.TypeSystem;
using Debug = System.Diagnostics.Debug;
@@ -91,9 +89,9 @@ namespace ILCompiler
public static bool IsArrayMethod(this MethodDesc method)
{
var arrayMethod = method as ArrayMethod;
- return arrayMethod != null && (arrayMethod.Kind == ArrayMethodKind.Address ||
- arrayMethod.Kind == ArrayMethodKind.Get ||
- arrayMethod.Kind == ArrayMethodKind.Set ||
+ return arrayMethod != null && (arrayMethod.Kind == ArrayMethodKind.Address ||
+ arrayMethod.Kind == ArrayMethodKind.Get ||
+ arrayMethod.Kind == ArrayMethodKind.Set ||
arrayMethod.Kind == ArrayMethodKind.Ctor);
}
@@ -279,7 +277,7 @@ namespace ILCompiler
if (ta.IsInterface)
{
//
- // Both classes are interfaces. Check that if one
+ // Both classes are interfaces. Check that if one
// interface extends the other.
//
// Does tb extend ta ?
diff --git a/src/coreclr/tools/Common/Compiler/VectorFieldLayoutAlgorithm.cs b/src/coreclr/tools/Common/Compiler/VectorFieldLayoutAlgorithm.cs
index a4e49bde5fe..e2be8774058 100644
--- a/src/coreclr/tools/Common/Compiler/VectorFieldLayoutAlgorithm.cs
+++ b/src/coreclr/tools/Common/Compiler/VectorFieldLayoutAlgorithm.cs
@@ -36,7 +36,7 @@ namespace ILCompiler
{
if (defType.Context.Target.Architecture == TargetArchitecture.ARM)
{
- // The Procedure Call Standard for ARM defaults to 8-byte alignment for __m128
+ // The Procedure Call Standard for ARM defaults to 8-byte alignment for __m128
alignment = new LayoutInt(8);
}
else
@@ -50,13 +50,13 @@ namespace ILCompiler
if (defType.Context.Target.Architecture == TargetArchitecture.ARM)
{
- // No such type exists for the Procedure Call Standard for ARM. We will default
+ // No such type exists for the Procedure Call Standard for ARM. We will default
// to the same alignment as __m128, which is supported by the ABI.
alignment = new LayoutInt(8);
}
else if (defType.Context.Target.Architecture == TargetArchitecture.ARM64)
{
- // The Procedure Call Standard for ARM 64-bit (with SVE support) defaults to
+ // The Procedure Call Standard for ARM 64-bit (with SVE support) defaults to
// 16-byte alignment for __m256.
alignment = new LayoutInt(16);
}
diff --git a/src/coreclr/tools/Common/Internal/LowLevelLinq/LowLevelEnumerable.ToList.cs b/src/coreclr/tools/Common/Internal/LowLevelLinq/LowLevelEnumerable.ToList.cs
index 8ab46e8b8ca..09fa4608ff6 100644
--- a/src/coreclr/tools/Common/Internal/LowLevelLinq/LowLevelEnumerable.ToList.cs
+++ b/src/coreclr/tools/Common/Internal/LowLevelLinq/LowLevelEnumerable.ToList.cs
@@ -1,8 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-using System.Diagnostics;
using System.Collections.Generic;
namespace Internal.LowLevelLinq
diff --git a/src/coreclr/tools/Common/Internal/Metadata/NativeFormat/Generator/MdBinaryWriterGen.cs b/src/coreclr/tools/Common/Internal/Metadata/NativeFormat/Generator/MdBinaryWriterGen.cs
index 19e870feb39..2069fd6c78a 100644
--- a/src/coreclr/tools/Common/Internal/Metadata/NativeFormat/Generator/MdBinaryWriterGen.cs
+++ b/src/coreclr/tools/Common/Internal/Metadata/NativeFormat/Generator/MdBinaryWriterGen.cs
@@ -19,13 +19,9 @@ class MdBinaryWriterGen : CsWriter
WriteLine("#pragma warning disable 649");
WriteLine();
- WriteLine("using System;");
- WriteLine("using System.IO;");
WriteLine("using System.Collections.Generic;");
WriteLine("using System.Reflection;");
- WriteLine("using Internal.LowLevelLinq;");
WriteLine("using Internal.NativeFormat;");
- WriteLine("using Debug = System.Diagnostics.Debug;");
WriteLine();
OpenScope("namespace Internal.Metadata.NativeFormat.Writer");
diff --git a/src/coreclr/tools/Common/Internal/Metadata/NativeFormat/Generator/ReaderGen.cs b/src/coreclr/tools/Common/Internal/Metadata/NativeFormat/Generator/ReaderGen.cs
index 21242607049..d8d13be9591 100644
--- a/src/coreclr/tools/Common/Internal/Metadata/NativeFormat/Generator/ReaderGen.cs
+++ b/src/coreclr/tools/Common/Internal/Metadata/NativeFormat/Generator/ReaderGen.cs
@@ -25,10 +25,7 @@ class ReaderGen : CsWriter
WriteLine("#pragma warning disable IDE0059");
WriteLine();
- WriteLine("using System;");
WriteLine("using System.Reflection;");
- WriteLine("using System.Collections.Generic;");
- WriteLine("using System.Runtime.CompilerServices;");
WriteLine("using Internal.NativeFormat;");
WriteLine();
@@ -266,7 +263,7 @@ class ReaderGen : CsWriter
if (record.Name == "ConstantStringValue")
{
WriteLine("if (IsNull(handle))");
- WriteLine(" return new ConstantStringValue();");
+ WriteLine(" return default(ConstantStringValue);");
}
WriteLine($"{record.Name} record;");
WriteLine("record._reader = this;");
diff --git a/src/coreclr/tools/Common/Internal/Metadata/NativeFormat/Generator/SchemaDef.cs b/src/coreclr/tools/Common/Internal/Metadata/NativeFormat/Generator/SchemaDef.cs
index 0b298003342..dbad36a8914 100644
--- a/src/coreclr/tools/Common/Internal/Metadata/NativeFormat/Generator/SchemaDef.cs
+++ b/src/coreclr/tools/Common/Internal/Metadata/NativeFormat/Generator/SchemaDef.cs
@@ -274,7 +274,7 @@ class SchemaDef
(
from primitiveType in PrimitiveTypes select
new RecordDef(
- name: "Constant" + primitiveType.TypeName + "Value",
+ name: "Constant" + primitiveType.Name + "Value",
members: new MemberDef[] {
new MemberDef(name: "Value", typeName: primitiveType.Name,
flags: primitiveType.CustomCompare ? MemberDefFlags.CustomCompare : 0)
@@ -309,9 +309,9 @@ class SchemaDef
(
from primitiveType in PrimitiveTypes select
new RecordDef(
- name: "Constant" + primitiveType.TypeName + "Array",
+ name: "Constant" + primitiveType.Name + "Array",
members: new MemberDef[] {
- new MemberDef(name: "Value", typeName: primitiveType.TypeName,
+ new MemberDef(name: "Value", typeName: primitiveType.Name,
flags: MemberDefFlags.Array | (primitiveType.CustomCompare ? MemberDefFlags.CustomCompare : 0))
}
)
@@ -759,10 +759,10 @@ class SchemaDef
public static readonly string[] TypeNamesWithCollectionTypes =
RecordSchema.SelectMany(r =>
from member in r.Members
- let memberTypeName = member.TypeName as string
- where memberTypeName != null &&
+ let memberName = member.Name as string
+ where memberName != null &&
(member.Flags & MemberDefFlags.Collection) != 0 &&
- !PrimitiveTypes.Any(pt => pt.TypeName == memberTypeName)
- select memberTypeName
+ !PrimitiveTypes.Any(pt => pt.Name == memberName)
+ select memberName
).Concat(new[] { "ScopeDefinition" }).Distinct().ToArray();
}
diff --git a/src/coreclr/tools/Common/Internal/Metadata/NativeFormat/Generator/WriterGen.cs b/src/coreclr/tools/Common/Internal/Metadata/NativeFormat/Generator/WriterGen.cs
index 6b03f4d8c78..14156a9bc00 100644
--- a/src/coreclr/tools/Common/Internal/Metadata/NativeFormat/Generator/WriterGen.cs
+++ b/src/coreclr/tools/Common/Internal/Metadata/NativeFormat/Generator/WriterGen.cs
@@ -13,15 +13,10 @@ class WriterGen : CsWriter
WriteLine("#pragma warning disable 649");
WriteLine();
- WriteLine("using System;");
- WriteLine("using System.IO;");
WriteLine("using System.Collections.Generic;");
WriteLine("using System.Reflection;");
WriteLine("using System.Threading;");
- WriteLine("using Internal.LowLevelLinq;");
- WriteLine("using Internal.Metadata.NativeFormat.Writer;");
WriteLine("using Internal.NativeFormat;");
- WriteLine("using HandleType = Internal.Metadata.NativeFormat.HandleType;");
WriteLine("using Debug = System.Diagnostics.Debug;");
WriteLine();
@@ -64,8 +59,8 @@ class WriterGen : CsWriter
}
CloseScope("Visit");
- OpenScope("public override sealed bool Equals(Object obj)");
- WriteLine("if (Object.ReferenceEquals(this, obj)) return true;");
+ OpenScope("public sealed override bool Equals(object obj)");
+ WriteLine("if (ReferenceEquals(this, obj)) return true;");
WriteLine($"var other = obj as {record.Name};");
WriteLine("if (other == null) return false;");
if ((record.Flags & RecordDefFlags.ReentrantEquals) != 0)
@@ -94,7 +89,7 @@ class WriterGen : CsWriter
else
if ((member.Flags & (MemberDefFlags.Map | MemberDefFlags.RecordRef)) != 0)
{
- WriteLine($"if (!Object.Equals({member.Name}, other.{member.Name})) return false;");
+ WriteLine($"if (!Equals({member.Name}, other.{member.Name})) return false;");
}
else
if ((member.Flags & MemberDefFlags.CustomCompare) != 0)
@@ -113,7 +108,7 @@ class WriterGen : CsWriter
WriteLine("finally");
WriteLine("{");
WriteLine(" var popped = _equalsReentrancyGuard.Value.Pop();");
- WriteLine(" Debug.Assert(Object.ReferenceEquals(other, popped));");
+ WriteLine(" Debug.Assert(ReferenceEquals(other, popped));");
WriteLine("}");
}
WriteLine("return true;");
@@ -121,7 +116,7 @@ class WriterGen : CsWriter
if ((record.Flags & RecordDefFlags.ReentrantEquals) != 0)
WriteLine("private ThreadLocal<ReentrancyGuardStack> _equalsReentrancyGuard;");
- OpenScope("public override sealed int GetHashCode()");
+ OpenScope("public sealed override int GetHashCode()");
WriteLine("if (_hash != 0)");
WriteLine(" return _hash;");
WriteLine("EnterGetHashCode();");
diff --git a/src/coreclr/tools/Common/Internal/Metadata/NativeFormat/MdBinaryReader.cs b/src/coreclr/tools/Common/Internal/Metadata/NativeFormat/MdBinaryReader.cs
index 660c2f5d20d..b52493d1b4b 100644
--- a/src/coreclr/tools/Common/Internal/Metadata/NativeFormat/MdBinaryReader.cs
+++ b/src/coreclr/tools/Common/Internal/Metadata/NativeFormat/MdBinaryReader.cs
@@ -1,13 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-using System.IO;
-using System.Collections.Generic;
-using System.Reflection;
-using Debug = System.Diagnostics.Debug;
-using System.Threading;
-using System.Text;
using Internal.NativeFormat;
namespace Internal.Metadata.NativeFormat
diff --git a/src/coreclr/tools/Common/Internal/Metadata/NativeFormat/MdBinaryReaderGen.cs b/src/coreclr/tools/Common/Internal/Metadata/NativeFormat/MdBinaryReaderGen.cs
index d0e425b3679..f295f220a0d 100644
--- a/src/coreclr/tools/Common/Internal/Metadata/NativeFormat/MdBinaryReaderGen.cs
+++ b/src/coreclr/tools/Common/Internal/Metadata/NativeFormat/MdBinaryReaderGen.cs
@@ -5,12 +5,8 @@
#pragma warning disable 649
-using System;
-using System.IO;
-using System.Collections.Generic;
using System.Reflection;
using Internal.NativeFormat;
-using Debug = System.Diagnostics.Debug;
namespace Internal.Metadata.NativeFormat
{
diff --git a/src/coreclr/tools/Common/Internal/Metadata/NativeFormat/NativeFormatReaderGen.cs b/src/coreclr/tools/Common/Internal/Metadata/NativeFormat/NativeFormatReaderGen.cs
index faa24815ba5..ad38fab1bf2 100644
--- a/src/coreclr/tools/Common/Internal/Metadata/NativeFormat/NativeFormatReaderGen.cs
+++ b/src/coreclr/tools/Common/Internal/Metadata/NativeFormat/NativeFormatReaderGen.cs
@@ -10700,7 +10700,7 @@ namespace Internal.Metadata.NativeFormat
public ConstantStringValue GetConstantStringValue(ConstantStringValueHandle handle)
{
if (IsNull(handle))
- return new ConstantStringValue();
+ return default(ConstantStringValue);
ConstantStringValue record;
record._reader = this;
record._handle = handle;
diff --git a/src/coreclr/tools/Common/Internal/Metadata/NativeFormat/NativeMetadataReader.cs b/src/coreclr/tools/Common/Internal/Metadata/NativeFormat/NativeMetadataReader.cs
index 170dbc9efda..673867d0f99 100644
--- a/src/coreclr/tools/Common/Internal/Metadata/NativeFormat/NativeMetadataReader.cs
+++ b/src/coreclr/tools/Common/Internal/Metadata/NativeFormat/NativeMetadataReader.cs
@@ -6,10 +6,12 @@
#pragma warning disable CA1066 // IEquatable<T> implementations aren't used
using System;
+#pragma warning disable IDE0005 // Using directive is unnecessary.
using System.IO;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.CompilerServices;
+#pragma warning restore IDE0005 // Using directive is unnecessary.
using Internal.NativeFormat;
namespace Internal.Metadata.NativeFormat
@@ -248,7 +250,7 @@ namespace Internal.Metadata.NativeFormat
}
}
- internal partial class MetadataHeader
+ internal sealed partial class MetadataHeader
{
/// <todo>
/// Signature should be updated every time the metadata schema changes.
diff --git a/src/coreclr/tools/Common/Internal/NativeFormat/NativeFormatReader.Primitives.cs b/src/coreclr/tools/Common/Internal/NativeFormat/NativeFormatReader.Primitives.cs
index e30810799e6..7f7a8ebdcec 100644
--- a/src/coreclr/tools/Common/Internal/NativeFormat/NativeFormatReader.Primitives.cs
+++ b/src/coreclr/tools/Common/Internal/NativeFormat/NativeFormatReader.Primitives.cs
@@ -7,9 +7,7 @@
// Utilities to read native data from images, that are written by the NativeFormatWriter engine
// ---------------------------------------------------------------------------
-using System;
using System.Diagnostics;
-using System.Runtime.CompilerServices;
namespace Internal.NativeFormat
{
diff --git a/src/coreclr/tools/Common/Internal/NativeFormat/NativeFormatReader.String.cs b/src/coreclr/tools/Common/Internal/NativeFormat/NativeFormatReader.String.cs
index a044494d834..e3b90b71132 100644
--- a/src/coreclr/tools/Common/Internal/NativeFormat/NativeFormatReader.String.cs
+++ b/src/coreclr/tools/Common/Internal/NativeFormat/NativeFormatReader.String.cs
@@ -7,7 +7,6 @@
// UTF8 string reading methods
// ---------------------------------------------------------------------------
-using System;
using System.Text;
namespace Internal.NativeFormat
diff --git a/src/coreclr/tools/Common/Internal/NativeFormat/NativeFormatReader.cs b/src/coreclr/tools/Common/Internal/NativeFormat/NativeFormatReader.cs
index 61dcffe2403..91ed075a79d 100644
--- a/src/coreclr/tools/Common/Internal/NativeFormat/NativeFormatReader.cs
+++ b/src/coreclr/tools/Common/Internal/NativeFormat/NativeFormatReader.cs
@@ -9,7 +9,6 @@
using System;
using System.Diagnostics;
-using System.Runtime.CompilerServices;
namespace Internal.NativeFormat
{
@@ -215,7 +214,7 @@ namespace Internal.NativeFormat
}
}
- internal unsafe partial class NativeReader
+ internal sealed unsafe partial class NativeReader
{
private readonly byte* _base;
private readonly uint _size;
diff --git a/src/coreclr/tools/Common/Internal/NativeFormat/NativeFormatWriter.cs b/src/coreclr/tools/Common/Internal/NativeFormat/NativeFormatWriter.cs
index e81869f783a..bd4f0e20dac 100644
--- a/src/coreclr/tools/Common/Internal/NativeFormat/NativeFormatWriter.cs
+++ b/src/coreclr/tools/Common/Internal/NativeFormat/NativeFormatWriter.cs
@@ -92,24 +92,23 @@ namespace Internal.NativeFormat
#endif
class NativeWriter
{
- List<Section> _sections = new List<Section>();
+ private List<Section> _sections = new List<Section>();
- enum SavePhase
+ private enum SavePhase
{
Initial,
Shrinking,
Growing
}
+ private int _iteration;
+ private SavePhase _phase; // Current save phase
+ private int _offsetAdjustment; // Cumulative offset adjustment compared to previous iteration
+ private int _paddingSize; // How much padding was used
- int _iteration = 0;
- SavePhase _phase; // Current save phase
- int _offsetAdjustment; // Cumulative offset adjustment compared to previous iteration
- int _paddingSize; // How much padding was used
+ private Dictionary<Vertex, Vertex> _unifier = new Dictionary<Vertex, Vertex>();
- Dictionary<Vertex, Vertex> _unifier = new Dictionary<Vertex, Vertex>();
-
- NativePrimitiveEncoder _encoder = new NativePrimitiveEncoder();
+ private NativePrimitiveEncoder _encoder;
#if NATIVEFORMAT_COMPRESSION
struct Tentative
@@ -397,17 +396,7 @@ namespace Internal.NativeFormat
}
}
-#if NATIVEFORMAT_COMPRESSION
- // TODO:
-#else
- internal struct TypeSignatureCompressor
- {
- internal TypeSignatureCompressor(NativeWriter pWriter) { }
- internal void Pack(Vertex vertex) { }
- }
-#endif
-
- T Unify<T>(T vertex) where T : Vertex
+ private T Unify<T>(T vertex) where T : Vertex
{
Vertex existing;
if (_unifier.TryGetValue(vertex, out existing))
@@ -537,9 +526,9 @@ namespace Internal.NativeFormat
}
}
- class PlacedVertex : Vertex
+ internal sealed class PlacedVertex : Vertex
{
- Vertex _unified;
+ private Vertex _unified;
public PlacedVertex(Vertex unified)
{
@@ -559,7 +548,7 @@ namespace Internal.NativeFormat
#endif
class UnsignedConstant : Vertex
{
- uint _value;
+ private uint _value;
public UnsignedConstant(uint value)
{
@@ -586,7 +575,7 @@ namespace Internal.NativeFormat
}
}
- class Tuple : Vertex
+ internal sealed class Tuple : Vertex
{
private Vertex _item1;
private Vertex _item2;
@@ -603,8 +592,7 @@ namespace Internal.NativeFormat
{
_item1.Save(writer);
_item2.Save(writer);
- if (_item3 != null)
- _item3.Save(writer);
+ _item3?.Save(writer);
}
public override int GetHashCode()
@@ -621,9 +609,9 @@ namespace Internal.NativeFormat
if (other == null)
return false;
- return Object.Equals(_item1, other._item1) &&
- Object.Equals(_item2, other._item2) &&
- Object.Equals(_item3, other._item3);
+ return Equals(_item1, other._item1) &&
+ Equals(_item2, other._item2) &&
+ Equals(_item3, other._item3);
}
}
@@ -639,9 +627,9 @@ namespace Internal.NativeFormat
#endif
class VertexBag : Vertex
{
- enum EntryType { Vertex, Unsigned, Signed }
+ private enum EntryType { Vertex, Unsigned, Signed }
- struct Entry
+ private struct Entry
{
internal BagElementKind _id;
internal EntryType _type;
@@ -752,7 +740,7 @@ namespace Internal.NativeFormat
return false;
for (int i = 0; i < _elements.Count; i++)
- if (!Object.Equals(_elements[i], other._elements[i]))
+ if (!Equals(_elements[i], other._elements[i]))
return false;
return true;
@@ -804,7 +792,7 @@ namespace Internal.NativeFormat
if (other == null)
return false;
- return Object.Equals(_methodName, other._methodName) && Object.Equals(_signature, other._signature);
+ return Equals(_methodName, other._methodName) && Equals(_signature, other._signature);
}
}
@@ -876,7 +864,7 @@ namespace Internal.NativeFormat
if (other == null)
return false;
- return Object.Equals(_item, other._item);
+ return Equals(_item, other._item);
}
}
@@ -916,7 +904,7 @@ namespace Internal.NativeFormat
if (other == null)
return false;
- return Object.Equals(_item, other._item);
+ return Equals(_item, other._item);
}
}
@@ -936,11 +924,7 @@ namespace Internal.NativeFormat
internal override void Save(NativeWriter writer)
{
- NativeWriter.TypeSignatureCompressor compressor = new NativeWriter.TypeSignatureCompressor(writer);
-
writer.WriteUnsigned((uint)TypeSignatureKind.External | (_externalTypeId << 4));
-
- compressor.Pack(this);
}
public override int GetHashCode()
@@ -1021,8 +1005,8 @@ namespace Internal.NativeFormat
if (!(
_flags == other._flags &&
_fptrReferenceId == other._fptrReferenceId &&
- Object.Equals(_containingType, other._containingType) &&
- Object.Equals(_methodNameAndSig, other._methodNameAndSig)))
+ Equals(_containingType, other._containingType) &&
+ Equals(_methodNameAndSig, other._methodNameAndSig)))
{
return false;
}
@@ -1032,7 +1016,7 @@ namespace Internal.NativeFormat
if (other._args == null) return false;
if (other._args.Length != _args.Length) return false;
for (uint iArg = 0; _args != null && iArg < _args.Length; iArg++)
- if (!Object.Equals(_args[iArg], other._args[iArg]))
+ if (!Equals(_args[iArg], other._args[iArg]))
return false;
}
else if (other._args != null)
@@ -1079,10 +1063,10 @@ namespace Internal.NativeFormat
if (other == null)
return false;
- if (!Object.Equals(other._containingType, _containingType))
+ if (!Equals(other._containingType, _containingType))
return false;
- if (!Object.Equals(other._name, _name))
+ if (!Equals(other._name, _name))
return false;
return true;
@@ -1108,8 +1092,7 @@ namespace Internal.NativeFormat
internal override void Save(NativeWriter writer)
{
writer.WriteUnsigned((uint)_kind);
- if (_signature != null)
- _signature.Save(writer);
+ _signature?.Save(writer);
}
public override int GetHashCode()
@@ -1126,7 +1109,7 @@ namespace Internal.NativeFormat
if (other._kind != _kind)
return false;
- if (!Object.Equals(other._signature, _signature))
+ if (!Equals(other._signature, _signature))
return false;
return true;
@@ -1166,7 +1149,7 @@ namespace Internal.NativeFormat
if (other == null)
return false;
- if (!Object.Equals(other._type, _type))
+ if (!Equals(other._type, _type))
return false;
if (other._staticDataKind != _staticDataKind)
@@ -1209,7 +1192,7 @@ namespace Internal.NativeFormat
if (other == null)
return false;
- if (!Object.Equals(other._type, _type))
+ if (!Equals(other._type, _type))
return false;
if (other._slot != _slot)
@@ -1273,13 +1256,13 @@ namespace Internal.NativeFormat
_callingConvention == other._callingConvention &&
_genericArgCount == other._genericArgCount &&
_parameters.Length == other._parameters.Length &&
- Object.Equals(_returnType, other._returnType)))
+ Equals(_returnType, other._returnType)))
{
return false;
}
for (int i = 0; i < _parameters.Length; i++)
- if (!Object.Equals(_parameters[i], other._parameters[i]))
+ if (!Equals(_parameters[i], other._parameters[i]))
return false;
return true;
@@ -1304,12 +1287,8 @@ namespace Internal.NativeFormat
internal override void Save(NativeWriter writer)
{
- NativeWriter.TypeSignatureCompressor compressor = new NativeWriter.TypeSignatureCompressor(writer);
-
writer.WriteUnsigned((uint)TypeSignatureKind.Modifier | ((uint)_modifier << 4));
_param.Save(writer);
-
- compressor.Pack(this);
}
public override int GetHashCode()
@@ -1323,7 +1302,7 @@ namespace Internal.NativeFormat
if (other == null)
return false;
- return _modifier == other._modifier && Object.Equals(_param, other._param);
+ return _modifier == other._modifier && Equals(_param, other._param);
}
}
@@ -1343,11 +1322,7 @@ namespace Internal.NativeFormat
internal override void Save(NativeWriter writer)
{
- NativeWriter.TypeSignatureCompressor compressor = new NativeWriter.TypeSignatureCompressor(writer);
-
writer.WriteUnsigned((uint)TypeSignatureKind.Variable | (_variableId << 4));
-
- compressor.Pack(this);
}
public override int GetHashCode()
@@ -1383,14 +1358,10 @@ namespace Internal.NativeFormat
internal override void Save(NativeWriter writer)
{
- NativeWriter.TypeSignatureCompressor compressor = new NativeWriter.TypeSignatureCompressor(writer);
-
writer.WriteUnsigned((uint)TypeSignatureKind.Instantiation | ((uint)_args.Length << 4));
_typeDef.Save(writer);
for (int iArg = 0; iArg < _args.Length; iArg++)
_args[iArg].Save(writer);
-
- compressor.Pack(this);
}
public override int GetHashCode()
@@ -1409,11 +1380,11 @@ namespace Internal.NativeFormat
if (other == null)
return false;
- if (_args.Length != other._args.Length || !Object.Equals(_typeDef, other._typeDef))
+ if (_args.Length != other._args.Length || !Equals(_typeDef, other._typeDef))
return false;
for (uint iArg = 0; iArg < _args.Length; iArg++)
- if (!Object.Equals(_args[iArg], other._args[iArg]))
+ if (!Equals(_args[iArg], other._args[iArg]))
return false;
return true;
@@ -1444,8 +1415,6 @@ namespace Internal.NativeFormat
internal override void Save(NativeWriter writer)
{
- NativeWriter.TypeSignatureCompressor compressor = new NativeWriter.TypeSignatureCompressor(writer);
-
writer.WriteUnsigned((uint)TypeSignatureKind.MultiDimArray | ((uint)_rank << 4));
_arrayElementType.Save(writer);
@@ -1456,8 +1425,6 @@ namespace Internal.NativeFormat
writer.WriteUnsigned((uint)_lowerBounds.Length);
foreach (uint b in _lowerBounds)
writer.WriteUnsigned(b);
-
- compressor.Pack(this);
}
public override int GetHashCode()
@@ -1479,7 +1446,7 @@ namespace Internal.NativeFormat
if (other == null)
return false;
- if (!Object.Equals(_arrayElementType, other._arrayElementType) ||
+ if (!Equals(_arrayElementType, other._arrayElementType) ||
_rank != other._rank ||
_bounds.Length != other._bounds.Length ||
_lowerBounds.Length != other._lowerBounds.Length)
@@ -1741,7 +1708,7 @@ namespace Internal.NativeFormat
/// </summary>
private uint _entryIndexSize;
- class VertexLeaf : Vertex
+ private sealed class VertexLeaf : Vertex
{
private Vertex _vertex;
private int _leafIndex;
@@ -1756,14 +1723,11 @@ namespace Internal.NativeFormat
{
writer.WriteUnsigned((uint)_leafIndex << 2);
- if (_vertex != null)
- {
- _vertex.Save(writer);
- }
+ _vertex?.Save(writer);
}
}
- class VertexTree : Vertex
+ private sealed class VertexTree : Vertex
{
private Vertex _first;
private Vertex _second;
@@ -1801,8 +1765,7 @@ namespace Internal.NativeFormat
writer.WriteUnsigned(value);
- if (_first != null)
- _first.Save(writer);
+ _first?.Save(writer);
}
}
@@ -1830,7 +1793,7 @@ namespace Internal.NativeFormat
if (first == null || second == null)
{
VertexLeaf leaf = new VertexLeaf(
- first == null ? second : first,
+ first ?? second,
(first == null ? index + 1 : index) & (BlockSize - 1));
if (place)
@@ -1921,8 +1884,7 @@ namespace Internal.NativeFormat
VertexLeaf nullBlock = null;
for (int i = 0; i < _entries.Count; i += BlockSize)
{
- bool isLeaf;
- Vertex block = ExpandBlock(i, 4, true, out isLeaf);
+ Vertex block = ExpandBlock(i, 4, true, out _);
if (block == null)
{
@@ -2009,7 +1971,7 @@ namespace Internal.NativeFormat
#endif
class VertexHashtable : Vertex
{
- struct Entry
+ private struct Entry
{
public Entry(uint hashcode, Vertex vertex)
{
@@ -2059,7 +2021,7 @@ namespace Internal.NativeFormat
}
// Returns 1 + log2(x) rounded up, 0 iff x == 0
- static int HighestBit(uint x)
+ private static int HighestBit(uint x)
{
int ret = 0;
while (x != 0)
@@ -2071,7 +2033,7 @@ namespace Internal.NativeFormat
}
// Helper method to back patch entry index in the bucket table
- static void PatchEntryIndex(NativeWriter writer, int patchOffset, int entryIndexSize, int entryIndex)
+ private static void PatchEntryIndex(NativeWriter writer, int patchOffset, int entryIndexSize, int entryIndex)
{
if (entryIndexSize == 0)
{
@@ -2091,7 +2053,7 @@ namespace Internal.NativeFormat
}
}
- void ComputeLayout()
+ private void ComputeLayout()
{
uint bucketsEstimate = (uint)(_Entries.Count / _nFillFactor);
@@ -2117,7 +2079,6 @@ namespace Internal.NativeFormat
ComputeLayout();
int nEntries = _Entries.Count;
- int startOffset = writer.GetCurrentOffset();
uint bucketMask = (_nBuckets - 1);
// Lowest two bits are entry index size, the rest is log2 number of buckets
diff --git a/src/coreclr/tools/Common/Internal/Runtime/CorConstants.cs b/src/coreclr/tools/Common/Internal/Runtime/CorConstants.cs
index 5591b062f55..9754321213b 100644
--- a/src/coreclr/tools/Common/Internal/Runtime/CorConstants.cs
+++ b/src/coreclr/tools/Common/Internal/Runtime/CorConstants.cs
@@ -1,8 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-
namespace Internal.CorConstants
{
public enum CorElementType : byte
diff --git a/src/coreclr/tools/Common/Internal/Runtime/EETypeBuilderHelpers.cs b/src/coreclr/tools/Common/Internal/Runtime/EETypeBuilderHelpers.cs
index a225665dcee..db9e131861c 100644
--- a/src/coreclr/tools/Common/Internal/Runtime/EETypeBuilderHelpers.cs
+++ b/src/coreclr/tools/Common/Internal/Runtime/EETypeBuilderHelpers.cs
@@ -1,7 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
using System.Diagnostics;
using Internal.TypeSystem;
@@ -97,7 +96,9 @@ namespace Internal.Runtime
// the rest of the padding data.
// If paddings of greater than 7 bytes are necessary, then the high bits of the field represent that padding
private const uint ValueTypePaddingLowMask = 0x7;
+#pragma warning disable CA1823 // Avoid unused private fields
private const uint ValueTypePaddingHighMask = 0xFFFFFF00;
+#pragma warning restore CA1823 // Avoid unused private fields
private const uint ValueTypePaddingMax = 0x07FFFFFF;
private const int ValueTypePaddingHighShift = 8;
private const uint ValueTypePaddingAlignmentMask = 0xF8;
diff --git a/src/coreclr/tools/Common/Internal/Runtime/EETypeOptionalFieldsBuilder.cs b/src/coreclr/tools/Common/Internal/Runtime/EETypeOptionalFieldsBuilder.cs
index 6481e6ef32c..e8d7f8407ec 100644
--- a/src/coreclr/tools/Common/Internal/Runtime/EETypeOptionalFieldsBuilder.cs
+++ b/src/coreclr/tools/Common/Internal/Runtime/EETypeOptionalFieldsBuilder.cs
@@ -2,15 +2,13 @@
// The .NET Foundation licenses this file to you under the MIT license.
using System;
-using System.Runtime.InteropServices;
-using Internal.Runtime;
using Internal.NativeFormat;
using System.Diagnostics;
using System.Text;
namespace Internal.Runtime
{
- internal unsafe partial class EETypeOptionalFieldsBuilder
+ internal sealed unsafe partial class EETypeOptionalFieldsBuilder
{
private NativePrimitiveEncoder _encoder;
private OptionalField[] _rgFields = new OptionalField[(int)EETypeOptionalFieldTag.Count];
@@ -18,17 +16,17 @@ namespace Internal.Runtime
private struct OptionalField
{
internal bool _fieldPresent;
- internal UInt32 _value;
+ internal uint _value;
}
internal EETypeOptionalFieldsBuilder() { }
- internal UInt32 GetFieldValue(EETypeOptionalFieldTag eTag, UInt32 defaultValueIfNotFound)
+ internal uint GetFieldValue(EETypeOptionalFieldTag eTag, uint defaultValueIfNotFound)
{
return _rgFields[(int)eTag]._fieldPresent ? _rgFields[(int)eTag]._value : defaultValueIfNotFound;
}
- internal void SetFieldValue(EETypeOptionalFieldTag eTag, UInt32 value)
+ internal void SetFieldValue(EETypeOptionalFieldTag eTag, uint value)
{
_rgFields[(int)eTag]._fieldPresent = true;
_rgFields[(int)eTag]._value = value;
@@ -49,7 +47,7 @@ namespace Internal.Runtime
if (eLastTag == EETypeOptionalFieldTag.Count)
return 0;
- _encoder = new NativePrimitiveEncoder();
+ _encoder = default(NativePrimitiveEncoder);
_encoder.Init();
for (EETypeOptionalFieldTag eTag = 0; eTag < EETypeOptionalFieldTag.Count; eTag++)
@@ -98,13 +96,13 @@ namespace Internal.Runtime
}
else
{
- sb.Append("x");
+ sb.Append('x');
}
if (i != (int)EETypeOptionalFieldTag.Count - 1)
{
- sb.Append("_");
+ sb.Append('_');
}
}
diff --git a/src/coreclr/tools/Common/Internal/Runtime/GCDescEncoder.cs b/src/coreclr/tools/Common/Internal/Runtime/GCDescEncoder.cs
index c842e61164c..207f67e1522 100644
--- a/src/coreclr/tools/Common/Internal/Runtime/GCDescEncoder.cs
+++ b/src/coreclr/tools/Common/Internal/Runtime/GCDescEncoder.cs
@@ -154,7 +154,7 @@ namespace Internal.Runtime
where T : struct, ITargetBinaryWriter
{
// Construct the gc info as if this array contains exactly one pointer
- // - the encoding trick where the size of the series is measured as a difference from
+ // - the encoding trick where the size of the series is measured as a difference from
// total object size will make this work for arbitrary array lengths
// Series size
diff --git a/src/coreclr/tools/Common/Internal/Runtime/InterfaceDispatchCellCachePointerFlags.cs b/src/coreclr/tools/Common/Internal/Runtime/InterfaceDispatchCellCachePointerFlags.cs
index a8fb3254fc2..bff58e834d2 100644
--- a/src/coreclr/tools/Common/Internal/Runtime/InterfaceDispatchCellCachePointerFlags.cs
+++ b/src/coreclr/tools/Common/Internal/Runtime/InterfaceDispatchCellCachePointerFlags.cs
@@ -1,8 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-
namespace Internal.Runtime
{
//
diff --git a/src/coreclr/tools/Common/Internal/Runtime/ModuleHeaders.cs b/src/coreclr/tools/Common/Internal/Runtime/ModuleHeaders.cs
index cc286f81b03..4c5799acf72 100644
--- a/src/coreclr/tools/Common/Internal/Runtime/ModuleHeaders.cs
+++ b/src/coreclr/tools/Common/Internal/Runtime/ModuleHeaders.cs
@@ -17,7 +17,7 @@ namespace Internal.Runtime
public const ushort CurrentMajorVersion = 8;
public const ushort CurrentMinorVersion = 0;
}
-
+#if READYTORUN
#pragma warning disable 0169
internal struct ReadyToRunHeader
{
@@ -34,6 +34,7 @@ namespace Internal.Runtime
// Array of sections follows.
};
#pragma warning restore 0169
+#endif
//
// ReadyToRunSectionType IDs are used by the runtime to look up specific global data sections
diff --git a/src/coreclr/tools/Common/Internal/Runtime/ReadyToRunConstants.cs b/src/coreclr/tools/Common/Internal/Runtime/ReadyToRunConstants.cs
index b0126289eb7..15c02b57113 100644
--- a/src/coreclr/tools/Common/Internal/Runtime/ReadyToRunConstants.cs
+++ b/src/coreclr/tools/Common/Internal/Runtime/ReadyToRunConstants.cs
@@ -80,7 +80,7 @@ namespace Internal.ReadyToRunConstants
}
[Flags]
- enum ReadyToRunCrossModuleInlineFlags : uint
+ internal enum ReadyToRunCrossModuleInlineFlags : uint
{
CrossModuleInlinee = 0x1,
HasCrossModuleInliners = 0x2,
diff --git a/src/coreclr/tools/Common/Internal/Runtime/UniversalGenericParameterLayout.cs b/src/coreclr/tools/Common/Internal/Runtime/UniversalGenericParameterLayout.cs
index d3d576972e6..47d9234f1fb 100644
--- a/src/coreclr/tools/Common/Internal/Runtime/UniversalGenericParameterLayout.cs
+++ b/src/coreclr/tools/Common/Internal/Runtime/UniversalGenericParameterLayout.cs
@@ -1,9 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-using System.Diagnostics;
-
using Internal.TypeSystem;
namespace Internal.Runtime
@@ -17,27 +14,27 @@ namespace Internal.Runtime
}
/// <summary>
- /// IF THESE SEMANTICS EVER CHANGE UPDATE THE LOGIC WHICH DEFINES THIS BEHAVIOR IN
- /// THE DYNAMIC TYPE LOADER AS WELL AS THE COMPILER.
+ /// IF THESE SEMANTICS EVER CHANGE UPDATE THE LOGIC WHICH DEFINES THIS BEHAVIOR IN
+ /// THE DYNAMIC TYPE LOADER AS WELL AS THE COMPILER.
/// (There is a version of this in TypeLoaderEnvironment.SignatureParsing.cs that must be kept in sync with this.)
///
/// Parameter's are considered to have type layout dependent on their generic instantiation
- /// if the type of the parameter in its signature is a type variable, or if the type is a generic
+ /// if the type of the parameter in its signature is a type variable, or if the type is a generic
/// structure which meets 2 characteristics:
/// 1. Structure size/layout is affected by the size/layout of one or more of its generic parameters
/// 2. One or more of the generic parameters is a type variable, or a generic structure which also recursively
/// would satisfy constraint 2. (Note, that in the recursion case, whether or not the structure is affected
/// by the size/layout of its generic parameters is not investigated.)
- ///
+ ///
/// Examples parameter types, and behavior.
- ///
+ ///
/// T = true
/// List[T] = false
/// StructNotDependentOnArgsForSize[T] = false
/// GenStructDependencyOnArgsForSize[T] = true
/// StructNotDependentOnArgsForSize[GenStructDependencyOnArgsForSize[T]] = true
/// StructNotDependentOnArgsForSize[GenStructDependencyOnArgsForSize[List[T]]]] = false
- ///
+ ///
/// Example non-parameter type behavior
/// T = true
/// List[T] = false
diff --git a/src/coreclr/tools/Common/Internal/Text/Utf8String.cs b/src/coreclr/tools/Common/Internal/Text/Utf8String.cs
index 9b44102c582..360aa3d27e9 100644
--- a/src/coreclr/tools/Common/Internal/Text/Utf8String.cs
+++ b/src/coreclr/tools/Common/Internal/Text/Utf8String.cs
@@ -3,7 +3,6 @@
using System;
using System.Numerics;
-using System.Runtime.CompilerServices;
using System.Text;
namespace Internal.Text
@@ -43,7 +42,7 @@ namespace Internal.Text
return (obj is Utf8String) && Equals((Utf8String)obj);
}
- public unsafe override int GetHashCode()
+ public override unsafe int GetHashCode()
{
int length = _value.Length;
uint hash = (uint)length;
diff --git a/src/coreclr/tools/Common/Internal/Text/Utf8StringBuilder.cs b/src/coreclr/tools/Common/Internal/Text/Utf8StringBuilder.cs
index a2144946a08..edf5b185b3c 100644
--- a/src/coreclr/tools/Common/Internal/Text/Utf8StringBuilder.cs
+++ b/src/coreclr/tools/Common/Internal/Text/Utf8StringBuilder.cs
@@ -10,7 +10,7 @@ namespace Internal.Text
public class Utf8StringBuilder
{
private byte[] _buffer = Array.Empty<byte>();
- private int _length = 0;
+ private int _length;
public Utf8StringBuilder()
{
@@ -103,7 +103,7 @@ namespace Internal.Text
_buffer = newBuffer;
}
- // Find the boundary of the last character prior to a position
+ // Find the boundary of the last character prior to a position
// If pos points to the last byte of a char, then return pos; Otherwise,
// return the position of the last byte of the preceding char.
public int LastCharBoundary(int pos)
diff --git a/src/coreclr/tools/Common/JitInterface/CorInfoBase.cs b/src/coreclr/tools/Common/JitInterface/CorInfoBase.cs
index 541c0dc424c..2aa2105765b 100644
--- a/src/coreclr/tools/Common/JitInterface/CorInfoBase.cs
+++ b/src/coreclr/tools/Common/JitInterface/CorInfoBase.cs
@@ -10,10 +10,10 @@ using System.Runtime.InteropServices;
namespace Internal.JitInterface
{
- unsafe partial class CorInfoImpl
+ internal unsafe partial class CorInfoImpl
{
[UnmanagedCallersOnly]
- static byte _isIntrinsic(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn)
+ private static byte _isIntrinsic(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn)
{
var _this = GetThis(thisHandle);
try
@@ -28,7 +28,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static uint _getMethodAttribs(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn)
+ private static uint _getMethodAttribs(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn)
{
var _this = GetThis(thisHandle);
try
@@ -43,7 +43,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static void _setMethodAttribs(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, CorInfoMethodRuntimeFlags attribs)
+ private static void _setMethodAttribs(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, CorInfoMethodRuntimeFlags attribs)
{
var _this = GetThis(thisHandle);
try
@@ -57,7 +57,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static void _getMethodSig(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, CORINFO_SIG_INFO* sig, CORINFO_CLASS_STRUCT_* memberParent)
+ private static void _getMethodSig(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, CORINFO_SIG_INFO* sig, CORINFO_CLASS_STRUCT_* memberParent)
{
var _this = GetThis(thisHandle);
try
@@ -71,7 +71,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static byte _getMethodInfo(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, CORINFO_METHOD_INFO* info)
+ private static byte _getMethodInfo(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, CORINFO_METHOD_INFO* info)
{
var _this = GetThis(thisHandle);
try
@@ -86,7 +86,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static CorInfoInline _canInline(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* callerHnd, CORINFO_METHOD_STRUCT_* calleeHnd)
+ private static CorInfoInline _canInline(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* callerHnd, CORINFO_METHOD_STRUCT_* calleeHnd)
{
var _this = GetThis(thisHandle);
try
@@ -101,7 +101,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static void _beginInlining(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* inlinerHnd, CORINFO_METHOD_STRUCT_* inlineeHnd)
+ private static void _beginInlining(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* inlinerHnd, CORINFO_METHOD_STRUCT_* inlineeHnd)
{
var _this = GetThis(thisHandle);
try
@@ -115,7 +115,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static void _reportInliningDecision(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* inlinerHnd, CORINFO_METHOD_STRUCT_* inlineeHnd, CorInfoInline inlineResult, byte* reason)
+ private static void _reportInliningDecision(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* inlinerHnd, CORINFO_METHOD_STRUCT_* inlineeHnd, CorInfoInline inlineResult, byte* reason)
{
var _this = GetThis(thisHandle);
try
@@ -129,7 +129,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static byte _canTailCall(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* callerHnd, CORINFO_METHOD_STRUCT_* declaredCalleeHnd, CORINFO_METHOD_STRUCT_* exactCalleeHnd, byte fIsTailPrefix)
+ private static byte _canTailCall(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* callerHnd, CORINFO_METHOD_STRUCT_* declaredCalleeHnd, CORINFO_METHOD_STRUCT_* exactCalleeHnd, byte fIsTailPrefix)
{
var _this = GetThis(thisHandle);
try
@@ -144,7 +144,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static void _reportTailCallDecision(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* callerHnd, CORINFO_METHOD_STRUCT_* calleeHnd, byte fIsTailPrefix, CorInfoTailCall tailCallResult, byte* reason)
+ private static void _reportTailCallDecision(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* callerHnd, CORINFO_METHOD_STRUCT_* calleeHnd, byte fIsTailPrefix, CorInfoTailCall tailCallResult, byte* reason)
{
var _this = GetThis(thisHandle);
try
@@ -158,7 +158,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static void _getEHinfo(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, uint EHnumber, CORINFO_EH_CLAUSE* clause)
+ private static void _getEHinfo(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, uint EHnumber, CORINFO_EH_CLAUSE* clause)
{
var _this = GetThis(thisHandle);
try
@@ -172,7 +172,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static CORINFO_CLASS_STRUCT_* _getMethodClass(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method)
+ private static CORINFO_CLASS_STRUCT_* _getMethodClass(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method)
{
var _this = GetThis(thisHandle);
try
@@ -187,7 +187,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static CORINFO_MODULE_STRUCT_* _getMethodModule(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method)
+ private static CORINFO_MODULE_STRUCT_* _getMethodModule(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method)
{
var _this = GetThis(thisHandle);
try
@@ -202,7 +202,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static void _getMethodVTableOffset(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method, uint* offsetOfIndirection, uint* offsetAfterIndirection, bool* isRelative)
+ private static void _getMethodVTableOffset(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method, uint* offsetOfIndirection, uint* offsetAfterIndirection, bool* isRelative)
{
var _this = GetThis(thisHandle);
try
@@ -216,7 +216,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static byte _resolveVirtualMethod(IntPtr thisHandle, IntPtr* ppException, CORINFO_DEVIRTUALIZATION_INFO* info)
+ private static byte _resolveVirtualMethod(IntPtr thisHandle, IntPtr* ppException, CORINFO_DEVIRTUALIZATION_INFO* info)
{
var _this = GetThis(thisHandle);
try
@@ -231,7 +231,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static CORINFO_METHOD_STRUCT_* _getUnboxedEntry(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, bool* requiresInstMethodTableArg)
+ private static CORINFO_METHOD_STRUCT_* _getUnboxedEntry(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, bool* requiresInstMethodTableArg)
{
var _this = GetThis(thisHandle);
try
@@ -246,7 +246,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static CORINFO_CLASS_STRUCT_* _getDefaultComparerClass(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* elemType)
+ private static CORINFO_CLASS_STRUCT_* _getDefaultComparerClass(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* elemType)
{
var _this = GetThis(thisHandle);
try
@@ -261,7 +261,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static CORINFO_CLASS_STRUCT_* _getDefaultEqualityComparerClass(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* elemType)
+ private static CORINFO_CLASS_STRUCT_* _getDefaultEqualityComparerClass(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* elemType)
{
var _this = GetThis(thisHandle);
try
@@ -276,7 +276,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static void _expandRawHandleIntrinsic(IntPtr thisHandle, IntPtr* ppException, CORINFO_RESOLVED_TOKEN* pResolvedToken, CORINFO_GENERICHANDLE_RESULT* pResult)
+ private static void _expandRawHandleIntrinsic(IntPtr thisHandle, IntPtr* ppException, CORINFO_RESOLVED_TOKEN* pResolvedToken, CORINFO_GENERICHANDLE_RESULT* pResult)
{
var _this = GetThis(thisHandle);
try
@@ -290,7 +290,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static byte _isIntrinsicType(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* classHnd)
+ private static byte _isIntrinsicType(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* classHnd)
{
var _this = GetThis(thisHandle);
try
@@ -305,7 +305,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static CorInfoCallConvExtension _getUnmanagedCallConv(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method, CORINFO_SIG_INFO* callSiteSig, bool* pSuppressGCTransition)
+ private static CorInfoCallConvExtension _getUnmanagedCallConv(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method, CORINFO_SIG_INFO* callSiteSig, bool* pSuppressGCTransition)
{
var _this = GetThis(thisHandle);
try
@@ -320,7 +320,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static byte _pInvokeMarshalingRequired(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method, CORINFO_SIG_INFO* callSiteSig)
+ private static byte _pInvokeMarshalingRequired(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method, CORINFO_SIG_INFO* callSiteSig)
{
var _this = GetThis(thisHandle);
try
@@ -335,7 +335,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static byte _satisfiesMethodConstraints(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* parent, CORINFO_METHOD_STRUCT_* method)
+ private static byte _satisfiesMethodConstraints(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* parent, CORINFO_METHOD_STRUCT_* method)
{
var _this = GetThis(thisHandle);
try
@@ -350,7 +350,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static byte _isCompatibleDelegate(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* objCls, CORINFO_CLASS_STRUCT_* methodParentCls, CORINFO_METHOD_STRUCT_* method, CORINFO_CLASS_STRUCT_* delegateCls, bool* pfIsOpenDelegate)
+ private static byte _isCompatibleDelegate(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* objCls, CORINFO_CLASS_STRUCT_* methodParentCls, CORINFO_METHOD_STRUCT_* method, CORINFO_CLASS_STRUCT_* delegateCls, bool* pfIsOpenDelegate)
{
var _this = GetThis(thisHandle);
try
@@ -365,7 +365,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static void _methodMustBeLoadedBeforeCodeIsRun(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method)
+ private static void _methodMustBeLoadedBeforeCodeIsRun(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method)
{
var _this = GetThis(thisHandle);
try
@@ -379,7 +379,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static CORINFO_METHOD_STRUCT_* _mapMethodDeclToMethodImpl(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method)
+ private static CORINFO_METHOD_STRUCT_* _mapMethodDeclToMethodImpl(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method)
{
var _this = GetThis(thisHandle);
try
@@ -394,7 +394,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static void _getGSCookie(IntPtr thisHandle, IntPtr* ppException, IntPtr* pCookieVal, IntPtr** ppCookieVal)
+ private static void _getGSCookie(IntPtr thisHandle, IntPtr* ppException, IntPtr* pCookieVal, IntPtr** ppCookieVal)
{
var _this = GetThis(thisHandle);
try
@@ -408,7 +408,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static void _setPatchpointInfo(IntPtr thisHandle, IntPtr* ppException, PatchpointInfo* patchpointInfo)
+ private static void _setPatchpointInfo(IntPtr thisHandle, IntPtr* ppException, PatchpointInfo* patchpointInfo)
{
var _this = GetThis(thisHandle);
try
@@ -422,7 +422,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static PatchpointInfo* _getOSRInfo(IntPtr thisHandle, IntPtr* ppException, uint* ilOffset)
+ private static PatchpointInfo* _getOSRInfo(IntPtr thisHandle, IntPtr* ppException, uint* ilOffset)
{
var _this = GetThis(thisHandle);
try
@@ -437,7 +437,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static void _resolveToken(IntPtr thisHandle, IntPtr* ppException, CORINFO_RESOLVED_TOKEN* pResolvedToken)
+ private static void _resolveToken(IntPtr thisHandle, IntPtr* ppException, CORINFO_RESOLVED_TOKEN* pResolvedToken)
{
var _this = GetThis(thisHandle);
try
@@ -451,7 +451,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static byte _tryResolveToken(IntPtr thisHandle, IntPtr* ppException, CORINFO_RESOLVED_TOKEN* pResolvedToken)
+ private static byte _tryResolveToken(IntPtr thisHandle, IntPtr* ppException, CORINFO_RESOLVED_TOKEN* pResolvedToken)
{
var _this = GetThis(thisHandle);
try
@@ -466,7 +466,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static void _findSig(IntPtr thisHandle, IntPtr* ppException, CORINFO_MODULE_STRUCT_* module, uint sigTOK, CORINFO_CONTEXT_STRUCT* context, CORINFO_SIG_INFO* sig)
+ private static void _findSig(IntPtr thisHandle, IntPtr* ppException, CORINFO_MODULE_STRUCT_* module, uint sigTOK, CORINFO_CONTEXT_STRUCT* context, CORINFO_SIG_INFO* sig)
{
var _this = GetThis(thisHandle);
try
@@ -480,7 +480,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static void _findCallSiteSig(IntPtr thisHandle, IntPtr* ppException, CORINFO_MODULE_STRUCT_* module, uint methTOK, CORINFO_CONTEXT_STRUCT* context, CORINFO_SIG_INFO* sig)
+ private static void _findCallSiteSig(IntPtr thisHandle, IntPtr* ppException, CORINFO_MODULE_STRUCT_* module, uint methTOK, CORINFO_CONTEXT_STRUCT* context, CORINFO_SIG_INFO* sig)
{
var _this = GetThis(thisHandle);
try
@@ -494,7 +494,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static CORINFO_CLASS_STRUCT_* _getTokenTypeAsHandle(IntPtr thisHandle, IntPtr* ppException, CORINFO_RESOLVED_TOKEN* pResolvedToken)
+ private static CORINFO_CLASS_STRUCT_* _getTokenTypeAsHandle(IntPtr thisHandle, IntPtr* ppException, CORINFO_RESOLVED_TOKEN* pResolvedToken)
{
var _this = GetThis(thisHandle);
try
@@ -509,7 +509,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static byte _isValidToken(IntPtr thisHandle, IntPtr* ppException, CORINFO_MODULE_STRUCT_* module, uint metaTOK)
+ private static byte _isValidToken(IntPtr thisHandle, IntPtr* ppException, CORINFO_MODULE_STRUCT_* module, uint metaTOK)
{
var _this = GetThis(thisHandle);
try
@@ -524,7 +524,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static byte _isValidStringRef(IntPtr thisHandle, IntPtr* ppException, CORINFO_MODULE_STRUCT_* module, uint metaTOK)
+ private static byte _isValidStringRef(IntPtr thisHandle, IntPtr* ppException, CORINFO_MODULE_STRUCT_* module, uint metaTOK)
{
var _this = GetThis(thisHandle);
try
@@ -539,7 +539,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static int _getStringLiteral(IntPtr thisHandle, IntPtr* ppException, CORINFO_MODULE_STRUCT_* module, uint metaTOK, char* buffer, int bufferSize)
+ private static int _getStringLiteral(IntPtr thisHandle, IntPtr* ppException, CORINFO_MODULE_STRUCT_* module, uint metaTOK, char* buffer, int bufferSize)
{
var _this = GetThis(thisHandle);
try
@@ -554,7 +554,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static CorInfoType _asCorInfoType(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls)
+ private static CorInfoType _asCorInfoType(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls)
{
var _this = GetThis(thisHandle);
try
@@ -569,7 +569,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static byte* _getClassName(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls)
+ private static byte* _getClassName(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls)
{
var _this = GetThis(thisHandle);
try
@@ -584,7 +584,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static byte* _getClassNameFromMetadata(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls, byte** namespaceName)
+ private static byte* _getClassNameFromMetadata(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls, byte** namespaceName)
{
var _this = GetThis(thisHandle);
try
@@ -599,7 +599,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static CORINFO_CLASS_STRUCT_* _getTypeInstantiationArgument(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls, uint index)
+ private static CORINFO_CLASS_STRUCT_* _getTypeInstantiationArgument(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls, uint index)
{
var _this = GetThis(thisHandle);
try
@@ -614,7 +614,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static int _appendClassName(IntPtr thisHandle, IntPtr* ppException, char** ppBuf, int* pnBufLen, CORINFO_CLASS_STRUCT_* cls, byte fNamespace, byte fFullInst, byte fAssembly)
+ private static int _appendClassName(IntPtr thisHandle, IntPtr* ppException, char** ppBuf, int* pnBufLen, CORINFO_CLASS_STRUCT_* cls, byte fNamespace, byte fFullInst, byte fAssembly)
{
var _this = GetThis(thisHandle);
try
@@ -629,7 +629,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static byte _isValueClass(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls)
+ private static byte _isValueClass(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls)
{
var _this = GetThis(thisHandle);
try
@@ -644,7 +644,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static CorInfoInlineTypeCheck _canInlineTypeCheck(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls, CorInfoInlineTypeCheckSource source)
+ private static CorInfoInlineTypeCheck _canInlineTypeCheck(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls, CorInfoInlineTypeCheckSource source)
{
var _this = GetThis(thisHandle);
try
@@ -659,7 +659,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static uint _getClassAttribs(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls)
+ private static uint _getClassAttribs(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls)
{
var _this = GetThis(thisHandle);
try
@@ -674,7 +674,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static CORINFO_MODULE_STRUCT_* _getClassModule(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls)
+ private static CORINFO_MODULE_STRUCT_* _getClassModule(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls)
{
var _this = GetThis(thisHandle);
try
@@ -689,7 +689,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static CORINFO_ASSEMBLY_STRUCT_* _getModuleAssembly(IntPtr thisHandle, IntPtr* ppException, CORINFO_MODULE_STRUCT_* mod)
+ private static CORINFO_ASSEMBLY_STRUCT_* _getModuleAssembly(IntPtr thisHandle, IntPtr* ppException, CORINFO_MODULE_STRUCT_* mod)
{
var _this = GetThis(thisHandle);
try
@@ -704,7 +704,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static byte* _getAssemblyName(IntPtr thisHandle, IntPtr* ppException, CORINFO_ASSEMBLY_STRUCT_* assem)
+ private static byte* _getAssemblyName(IntPtr thisHandle, IntPtr* ppException, CORINFO_ASSEMBLY_STRUCT_* assem)
{
var _this = GetThis(thisHandle);
try
@@ -719,7 +719,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static void* _LongLifetimeMalloc(IntPtr thisHandle, IntPtr* ppException, UIntPtr sz)
+ private static void* _LongLifetimeMalloc(IntPtr thisHandle, IntPtr* ppException, UIntPtr sz)
{
var _this = GetThis(thisHandle);
try
@@ -734,7 +734,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static void _LongLifetimeFree(IntPtr thisHandle, IntPtr* ppException, void* obj)
+ private static void _LongLifetimeFree(IntPtr thisHandle, IntPtr* ppException, void* obj)
{
var _this = GetThis(thisHandle);
try
@@ -748,7 +748,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static UIntPtr _getClassModuleIdForStatics(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls, CORINFO_MODULE_STRUCT_** pModule, void** ppIndirection)
+ private static UIntPtr _getClassModuleIdForStatics(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls, CORINFO_MODULE_STRUCT_** pModule, void** ppIndirection)
{
var _this = GetThis(thisHandle);
try
@@ -763,7 +763,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static uint _getClassSize(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls)
+ private static uint _getClassSize(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls)
{
var _this = GetThis(thisHandle);
try
@@ -778,7 +778,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static uint _getHeapClassSize(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls)
+ private static uint _getHeapClassSize(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls)
{
var _this = GetThis(thisHandle);
try
@@ -793,7 +793,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static byte _canAllocateOnStack(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls)
+ private static byte _canAllocateOnStack(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls)
{
var _this = GetThis(thisHandle);
try
@@ -808,7 +808,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static uint _getClassAlignmentRequirement(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls, byte fDoubleAlignHint)
+ private static uint _getClassAlignmentRequirement(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls, byte fDoubleAlignHint)
{
var _this = GetThis(thisHandle);
try
@@ -823,7 +823,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static uint _getClassGClayout(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls, byte* gcPtrs)
+ private static uint _getClassGClayout(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls, byte* gcPtrs)
{
var _this = GetThis(thisHandle);
try
@@ -838,7 +838,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static uint _getClassNumInstanceFields(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls)
+ private static uint _getClassNumInstanceFields(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls)
{
var _this = GetThis(thisHandle);
try
@@ -853,7 +853,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static CORINFO_FIELD_STRUCT_* _getFieldInClass(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* clsHnd, int num)
+ private static CORINFO_FIELD_STRUCT_* _getFieldInClass(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* clsHnd, int num)
{
var _this = GetThis(thisHandle);
try
@@ -868,7 +868,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static byte _checkMethodModifier(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* hMethod, byte* modifier, byte fOptional)
+ private static byte _checkMethodModifier(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* hMethod, byte* modifier, byte fOptional)
{
var _this = GetThis(thisHandle);
try
@@ -883,7 +883,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static CorInfoHelpFunc _getNewHelper(IntPtr thisHandle, IntPtr* ppException, CORINFO_RESOLVED_TOKEN* pResolvedToken, CORINFO_METHOD_STRUCT_* callerHandle, bool* pHasSideEffects)
+ private static CorInfoHelpFunc _getNewHelper(IntPtr thisHandle, IntPtr* ppException, CORINFO_RESOLVED_TOKEN* pResolvedToken, CORINFO_METHOD_STRUCT_* callerHandle, bool* pHasSideEffects)
{
var _this = GetThis(thisHandle);
try
@@ -898,7 +898,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static CorInfoHelpFunc _getNewArrHelper(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* arrayCls)
+ private static CorInfoHelpFunc _getNewArrHelper(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* arrayCls)
{
var _this = GetThis(thisHandle);
try
@@ -913,7 +913,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static CorInfoHelpFunc _getCastingHelper(IntPtr thisHandle, IntPtr* ppException, CORINFO_RESOLVED_TOKEN* pResolvedToken, byte fThrowing)
+ private static CorInfoHelpFunc _getCastingHelper(IntPtr thisHandle, IntPtr* ppException, CORINFO_RESOLVED_TOKEN* pResolvedToken, byte fThrowing)
{
var _this = GetThis(thisHandle);
try
@@ -928,7 +928,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static CorInfoHelpFunc _getSharedCCtorHelper(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* clsHnd)
+ private static CorInfoHelpFunc _getSharedCCtorHelper(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* clsHnd)
{
var _this = GetThis(thisHandle);
try
@@ -943,7 +943,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static CORINFO_CLASS_STRUCT_* _getTypeForBox(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls)
+ private static CORINFO_CLASS_STRUCT_* _getTypeForBox(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls)
{
var _this = GetThis(thisHandle);
try
@@ -958,7 +958,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static CorInfoHelpFunc _getBoxHelper(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls)
+ private static CorInfoHelpFunc _getBoxHelper(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls)
{
var _this = GetThis(thisHandle);
try
@@ -973,7 +973,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static CorInfoHelpFunc _getUnBoxHelper(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls)
+ private static CorInfoHelpFunc _getUnBoxHelper(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls)
{
var _this = GetThis(thisHandle);
try
@@ -988,7 +988,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static byte _getReadyToRunHelper(IntPtr thisHandle, IntPtr* ppException, CORINFO_RESOLVED_TOKEN* pResolvedToken, CORINFO_LOOKUP_KIND* pGenericLookupKind, CorInfoHelpFunc id, CORINFO_CONST_LOOKUP* pLookup)
+ private static byte _getReadyToRunHelper(IntPtr thisHandle, IntPtr* ppException, CORINFO_RESOLVED_TOKEN* pResolvedToken, CORINFO_LOOKUP_KIND* pGenericLookupKind, CorInfoHelpFunc id, CORINFO_CONST_LOOKUP* pLookup)
{
var _this = GetThis(thisHandle);
try
@@ -1003,7 +1003,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static void _getReadyToRunDelegateCtorHelper(IntPtr thisHandle, IntPtr* ppException, CORINFO_RESOLVED_TOKEN* pTargetMethod, mdToken targetConstraint, CORINFO_CLASS_STRUCT_* delegateType, CORINFO_LOOKUP* pLookup)
+ private static void _getReadyToRunDelegateCtorHelper(IntPtr thisHandle, IntPtr* ppException, CORINFO_RESOLVED_TOKEN* pTargetMethod, mdToken targetConstraint, CORINFO_CLASS_STRUCT_* delegateType, CORINFO_LOOKUP* pLookup)
{
var _this = GetThis(thisHandle);
try
@@ -1017,7 +1017,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static byte* _getHelperName(IntPtr thisHandle, IntPtr* ppException, CorInfoHelpFunc helpFunc)
+ private static byte* _getHelperName(IntPtr thisHandle, IntPtr* ppException, CorInfoHelpFunc helpFunc)
{
var _this = GetThis(thisHandle);
try
@@ -1032,7 +1032,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static CorInfoInitClassResult _initClass(IntPtr thisHandle, IntPtr* ppException, CORINFO_FIELD_STRUCT_* field, CORINFO_METHOD_STRUCT_* method, CORINFO_CONTEXT_STRUCT* context)
+ private static CorInfoInitClassResult _initClass(IntPtr thisHandle, IntPtr* ppException, CORINFO_FIELD_STRUCT_* field, CORINFO_METHOD_STRUCT_* method, CORINFO_CONTEXT_STRUCT* context)
{
var _this = GetThis(thisHandle);
try
@@ -1047,7 +1047,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static void _classMustBeLoadedBeforeCodeIsRun(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls)
+ private static void _classMustBeLoadedBeforeCodeIsRun(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls)
{
var _this = GetThis(thisHandle);
try
@@ -1061,7 +1061,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static CORINFO_CLASS_STRUCT_* _getBuiltinClass(IntPtr thisHandle, IntPtr* ppException, CorInfoClassId classId)
+ private static CORINFO_CLASS_STRUCT_* _getBuiltinClass(IntPtr thisHandle, IntPtr* ppException, CorInfoClassId classId)
{
var _this = GetThis(thisHandle);
try
@@ -1076,7 +1076,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static CorInfoType _getTypeForPrimitiveValueClass(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls)
+ private static CorInfoType _getTypeForPrimitiveValueClass(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls)
{
var _this = GetThis(thisHandle);
try
@@ -1091,7 +1091,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static CorInfoType _getTypeForPrimitiveNumericClass(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls)
+ private static CorInfoType _getTypeForPrimitiveNumericClass(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls)
{
var _this = GetThis(thisHandle);
try
@@ -1106,7 +1106,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static byte _canCast(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* child, CORINFO_CLASS_STRUCT_* parent)
+ private static byte _canCast(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* child, CORINFO_CLASS_STRUCT_* parent)
{
var _this = GetThis(thisHandle);
try
@@ -1121,7 +1121,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static byte _areTypesEquivalent(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls1, CORINFO_CLASS_STRUCT_* cls2)
+ private static byte _areTypesEquivalent(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls1, CORINFO_CLASS_STRUCT_* cls2)
{
var _this = GetThis(thisHandle);
try
@@ -1136,7 +1136,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static TypeCompareState _compareTypesForCast(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* fromClass, CORINFO_CLASS_STRUCT_* toClass)
+ private static TypeCompareState _compareTypesForCast(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* fromClass, CORINFO_CLASS_STRUCT_* toClass)
{
var _this = GetThis(thisHandle);
try
@@ -1151,7 +1151,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static TypeCompareState _compareTypesForEquality(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls1, CORINFO_CLASS_STRUCT_* cls2)
+ private static TypeCompareState _compareTypesForEquality(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls1, CORINFO_CLASS_STRUCT_* cls2)
{
var _this = GetThis(thisHandle);
try
@@ -1166,7 +1166,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static CORINFO_CLASS_STRUCT_* _mergeClasses(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls1, CORINFO_CLASS_STRUCT_* cls2)
+ private static CORINFO_CLASS_STRUCT_* _mergeClasses(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls1, CORINFO_CLASS_STRUCT_* cls2)
{
var _this = GetThis(thisHandle);
try
@@ -1181,7 +1181,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static byte _isMoreSpecificType(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls1, CORINFO_CLASS_STRUCT_* cls2)
+ private static byte _isMoreSpecificType(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls1, CORINFO_CLASS_STRUCT_* cls2)
{
var _this = GetThis(thisHandle);
try
@@ -1196,7 +1196,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static CORINFO_CLASS_STRUCT_* _getParentType(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls)
+ private static CORINFO_CLASS_STRUCT_* _getParentType(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls)
{
var _this = GetThis(thisHandle);
try
@@ -1211,7 +1211,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static CorInfoType _getChildType(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* clsHnd, CORINFO_CLASS_STRUCT_** clsRet)
+ private static CorInfoType _getChildType(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* clsHnd, CORINFO_CLASS_STRUCT_** clsRet)
{
var _this = GetThis(thisHandle);
try
@@ -1226,7 +1226,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static byte _satisfiesClassConstraints(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls)
+ private static byte _satisfiesClassConstraints(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls)
{
var _this = GetThis(thisHandle);
try
@@ -1241,7 +1241,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static byte _isSDArray(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls)
+ private static byte _isSDArray(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls)
{
var _this = GetThis(thisHandle);
try
@@ -1256,7 +1256,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static uint _getArrayRank(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls)
+ private static uint _getArrayRank(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls)
{
var _this = GetThis(thisHandle);
try
@@ -1271,7 +1271,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static CorInfoArrayIntrinsic _getArrayIntrinsicID(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn)
+ private static CorInfoArrayIntrinsic _getArrayIntrinsicID(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn)
{
var _this = GetThis(thisHandle);
try
@@ -1286,7 +1286,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static void* _getArrayInitializationData(IntPtr thisHandle, IntPtr* ppException, CORINFO_FIELD_STRUCT_* field, uint size)
+ private static void* _getArrayInitializationData(IntPtr thisHandle, IntPtr* ppException, CORINFO_FIELD_STRUCT_* field, uint size)
{
var _this = GetThis(thisHandle);
try
@@ -1301,7 +1301,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static CorInfoIsAccessAllowedResult _canAccessClass(IntPtr thisHandle, IntPtr* ppException, CORINFO_RESOLVED_TOKEN* pResolvedToken, CORINFO_METHOD_STRUCT_* callerHandle, CORINFO_HELPER_DESC* pAccessHelper)
+ private static CorInfoIsAccessAllowedResult _canAccessClass(IntPtr thisHandle, IntPtr* ppException, CORINFO_RESOLVED_TOKEN* pResolvedToken, CORINFO_METHOD_STRUCT_* callerHandle, CORINFO_HELPER_DESC* pAccessHelper)
{
var _this = GetThis(thisHandle);
try
@@ -1316,7 +1316,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static byte* _getFieldName(IntPtr thisHandle, IntPtr* ppException, CORINFO_FIELD_STRUCT_* ftn, byte** moduleName)
+ private static byte* _getFieldName(IntPtr thisHandle, IntPtr* ppException, CORINFO_FIELD_STRUCT_* ftn, byte** moduleName)
{
var _this = GetThis(thisHandle);
try
@@ -1331,7 +1331,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static CORINFO_CLASS_STRUCT_* _getFieldClass(IntPtr thisHandle, IntPtr* ppException, CORINFO_FIELD_STRUCT_* field)
+ private static CORINFO_CLASS_STRUCT_* _getFieldClass(IntPtr thisHandle, IntPtr* ppException, CORINFO_FIELD_STRUCT_* field)
{
var _this = GetThis(thisHandle);
try
@@ -1346,7 +1346,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static CorInfoType _getFieldType(IntPtr thisHandle, IntPtr* ppException, CORINFO_FIELD_STRUCT_* field, CORINFO_CLASS_STRUCT_** structType, CORINFO_CLASS_STRUCT_* memberParent)
+ private static CorInfoType _getFieldType(IntPtr thisHandle, IntPtr* ppException, CORINFO_FIELD_STRUCT_* field, CORINFO_CLASS_STRUCT_** structType, CORINFO_CLASS_STRUCT_* memberParent)
{
var _this = GetThis(thisHandle);
try
@@ -1361,7 +1361,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static uint _getFieldOffset(IntPtr thisHandle, IntPtr* ppException, CORINFO_FIELD_STRUCT_* field)
+ private static uint _getFieldOffset(IntPtr thisHandle, IntPtr* ppException, CORINFO_FIELD_STRUCT_* field)
{
var _this = GetThis(thisHandle);
try
@@ -1376,7 +1376,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static void _getFieldInfo(IntPtr thisHandle, IntPtr* ppException, CORINFO_RESOLVED_TOKEN* pResolvedToken, CORINFO_METHOD_STRUCT_* callerHandle, CORINFO_ACCESS_FLAGS flags, CORINFO_FIELD_INFO* pResult)
+ private static void _getFieldInfo(IntPtr thisHandle, IntPtr* ppException, CORINFO_RESOLVED_TOKEN* pResolvedToken, CORINFO_METHOD_STRUCT_* callerHandle, CORINFO_ACCESS_FLAGS flags, CORINFO_FIELD_INFO* pResult)
{
var _this = GetThis(thisHandle);
try
@@ -1390,7 +1390,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static byte _isFieldStatic(IntPtr thisHandle, IntPtr* ppException, CORINFO_FIELD_STRUCT_* fldHnd)
+ private static byte _isFieldStatic(IntPtr thisHandle, IntPtr* ppException, CORINFO_FIELD_STRUCT_* fldHnd)
{
var _this = GetThis(thisHandle);
try
@@ -1405,7 +1405,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static void _getBoundaries(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, uint* cILOffsets, uint** pILOffsets, BoundaryTypes* implicitBoundaries)
+ private static void _getBoundaries(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, uint* cILOffsets, uint** pILOffsets, BoundaryTypes* implicitBoundaries)
{
var _this = GetThis(thisHandle);
try
@@ -1419,7 +1419,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static void _setBoundaries(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, uint cMap, OffsetMapping* pMap)
+ private static void _setBoundaries(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, uint cMap, OffsetMapping* pMap)
{
var _this = GetThis(thisHandle);
try
@@ -1433,7 +1433,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static void _getVars(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, uint* cVars, ILVarInfo** vars, bool* extendOthers)
+ private static void _getVars(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, uint* cVars, ILVarInfo** vars, bool* extendOthers)
{
var _this = GetThis(thisHandle);
try
@@ -1447,7 +1447,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static void _setVars(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, uint cVars, NativeVarInfo* vars)
+ private static void _setVars(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, uint cVars, NativeVarInfo* vars)
{
var _this = GetThis(thisHandle);
try
@@ -1461,7 +1461,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static void _reportRichMappings(IntPtr thisHandle, IntPtr* ppException, InlineTreeNode* inlineTreeNodes, uint numInlineTreeNodes, RichOffsetMapping* mappings, uint numMappings)
+ private static void _reportRichMappings(IntPtr thisHandle, IntPtr* ppException, InlineTreeNode* inlineTreeNodes, uint numInlineTreeNodes, RichOffsetMapping* mappings, uint numMappings)
{
var _this = GetThis(thisHandle);
try
@@ -1475,7 +1475,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static void* _allocateArray(IntPtr thisHandle, IntPtr* ppException, UIntPtr cBytes)
+ private static void* _allocateArray(IntPtr thisHandle, IntPtr* ppException, UIntPtr cBytes)
{
var _this = GetThis(thisHandle);
try
@@ -1490,7 +1490,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static void _freeArray(IntPtr thisHandle, IntPtr* ppException, void* array)
+ private static void _freeArray(IntPtr thisHandle, IntPtr* ppException, void* array)
{
var _this = GetThis(thisHandle);
try
@@ -1504,7 +1504,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static CORINFO_ARG_LIST_STRUCT_* _getArgNext(IntPtr thisHandle, IntPtr* ppException, CORINFO_ARG_LIST_STRUCT_* args)
+ private static CORINFO_ARG_LIST_STRUCT_* _getArgNext(IntPtr thisHandle, IntPtr* ppException, CORINFO_ARG_LIST_STRUCT_* args)
{
var _this = GetThis(thisHandle);
try
@@ -1519,7 +1519,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static CorInfoTypeWithMod _getArgType(IntPtr thisHandle, IntPtr* ppException, CORINFO_SIG_INFO* sig, CORINFO_ARG_LIST_STRUCT_* args, CORINFO_CLASS_STRUCT_** vcTypeRet)
+ private static CorInfoTypeWithMod _getArgType(IntPtr thisHandle, IntPtr* ppException, CORINFO_SIG_INFO* sig, CORINFO_ARG_LIST_STRUCT_* args, CORINFO_CLASS_STRUCT_** vcTypeRet)
{
var _this = GetThis(thisHandle);
try
@@ -1534,7 +1534,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static int _getExactClasses(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* baseType, int maxExactClasses, CORINFO_CLASS_STRUCT_** exactClsRet)
+ private static int _getExactClasses(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* baseType, int maxExactClasses, CORINFO_CLASS_STRUCT_** exactClsRet)
{
var _this = GetThis(thisHandle);
try
@@ -1549,7 +1549,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static CORINFO_CLASS_STRUCT_* _getArgClass(IntPtr thisHandle, IntPtr* ppException, CORINFO_SIG_INFO* sig, CORINFO_ARG_LIST_STRUCT_* args)
+ private static CORINFO_CLASS_STRUCT_* _getArgClass(IntPtr thisHandle, IntPtr* ppException, CORINFO_SIG_INFO* sig, CORINFO_ARG_LIST_STRUCT_* args)
{
var _this = GetThis(thisHandle);
try
@@ -1564,7 +1564,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static CorInfoHFAElemType _getHFAType(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* hClass)
+ private static CorInfoHFAElemType _getHFAType(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* hClass)
{
var _this = GetThis(thisHandle);
try
@@ -1579,7 +1579,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static HRESULT _GetErrorHRESULT(IntPtr thisHandle, IntPtr* ppException, _EXCEPTION_POINTERS* pExceptionPointers)
+ private static HRESULT _GetErrorHRESULT(IntPtr thisHandle, IntPtr* ppException, _EXCEPTION_POINTERS* pExceptionPointers)
{
var _this = GetThis(thisHandle);
try
@@ -1594,7 +1594,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static uint _GetErrorMessage(IntPtr thisHandle, IntPtr* ppException, char* buffer, uint bufferLength)
+ private static uint _GetErrorMessage(IntPtr thisHandle, IntPtr* ppException, char* buffer, uint bufferLength)
{
var _this = GetThis(thisHandle);
try
@@ -1609,7 +1609,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static int _FilterException(IntPtr thisHandle, IntPtr* ppException, _EXCEPTION_POINTERS* pExceptionPointers)
+ private static int _FilterException(IntPtr thisHandle, IntPtr* ppException, _EXCEPTION_POINTERS* pExceptionPointers)
{
var _this = GetThis(thisHandle);
try
@@ -1624,7 +1624,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static void _ThrowExceptionForJitResult(IntPtr thisHandle, IntPtr* ppException, HRESULT result)
+ private static void _ThrowExceptionForJitResult(IntPtr thisHandle, IntPtr* ppException, HRESULT result)
{
var _this = GetThis(thisHandle);
try
@@ -1638,7 +1638,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static void _ThrowExceptionForHelper(IntPtr thisHandle, IntPtr* ppException, CORINFO_HELPER_DESC* throwHelper)
+ private static void _ThrowExceptionForHelper(IntPtr thisHandle, IntPtr* ppException, CORINFO_HELPER_DESC* throwHelper)
{
var _this = GetThis(thisHandle);
try
@@ -1652,7 +1652,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static byte _runWithErrorTrap(IntPtr thisHandle, IntPtr* ppException, void* function, void* parameter)
+ private static byte _runWithErrorTrap(IntPtr thisHandle, IntPtr* ppException, void* function, void* parameter)
{
var _this = GetThis(thisHandle);
try
@@ -1667,7 +1667,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static byte _runWithSPMIErrorTrap(IntPtr thisHandle, IntPtr* ppException, void* function, void* parameter)
+ private static byte _runWithSPMIErrorTrap(IntPtr thisHandle, IntPtr* ppException, void* function, void* parameter)
{
var _this = GetThis(thisHandle);
try
@@ -1682,7 +1682,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static void _getEEInfo(IntPtr thisHandle, IntPtr* ppException, CORINFO_EE_INFO* pEEInfoOut)
+ private static void _getEEInfo(IntPtr thisHandle, IntPtr* ppException, CORINFO_EE_INFO* pEEInfoOut)
{
var _this = GetThis(thisHandle);
try
@@ -1696,7 +1696,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static char* _getJitTimeLogFilename(IntPtr thisHandle, IntPtr* ppException)
+ private static char* _getJitTimeLogFilename(IntPtr thisHandle, IntPtr* ppException)
{
var _this = GetThis(thisHandle);
try
@@ -1711,7 +1711,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static mdToken _getMethodDefFromMethod(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* hMethod)
+ private static mdToken _getMethodDefFromMethod(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* hMethod)
{
var _this = GetThis(thisHandle);
try
@@ -1726,7 +1726,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static byte* _getMethodName(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, byte** moduleName)
+ private static byte* _getMethodName(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, byte** moduleName)
{
var _this = GetThis(thisHandle);
try
@@ -1741,7 +1741,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static byte* _getMethodNameFromMetadata(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, byte** className, byte** namespaceName, byte** enclosingClassName)
+ private static byte* _getMethodNameFromMetadata(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, byte** className, byte** namespaceName, byte** enclosingClassName)
{
var _this = GetThis(thisHandle);
try
@@ -1756,7 +1756,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static uint _getMethodHash(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn)
+ private static uint _getMethodHash(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn)
{
var _this = GetThis(thisHandle);
try
@@ -1771,7 +1771,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static UIntPtr _findNameOfToken(IntPtr thisHandle, IntPtr* ppException, CORINFO_MODULE_STRUCT_* moduleHandle, mdToken token, byte* szFQName, UIntPtr FQNameCapacity)
+ private static UIntPtr _findNameOfToken(IntPtr thisHandle, IntPtr* ppException, CORINFO_MODULE_STRUCT_* moduleHandle, mdToken token, byte* szFQName, UIntPtr FQNameCapacity)
{
var _this = GetThis(thisHandle);
try
@@ -1786,7 +1786,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static byte _getSystemVAmd64PassStructInRegisterDescriptor(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* structHnd, SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR* structPassInRegDescPtr)
+ private static byte _getSystemVAmd64PassStructInRegisterDescriptor(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* structHnd, SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR* structPassInRegDescPtr)
{
var _this = GetThis(thisHandle);
try
@@ -1801,7 +1801,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static uint _getLoongArch64PassStructInRegisterFlags(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* structHnd)
+ private static uint _getLoongArch64PassStructInRegisterFlags(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* structHnd)
{
var _this = GetThis(thisHandle);
try
@@ -1816,7 +1816,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static uint _getThreadTLSIndex(IntPtr thisHandle, IntPtr* ppException, void** ppIndirection)
+ private static uint _getThreadTLSIndex(IntPtr thisHandle, IntPtr* ppException, void** ppIndirection)
{
var _this = GetThis(thisHandle);
try
@@ -1831,7 +1831,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static void* _getInlinedCallFrameVptr(IntPtr thisHandle, IntPtr* ppException, void** ppIndirection)
+ private static void* _getInlinedCallFrameVptr(IntPtr thisHandle, IntPtr* ppException, void** ppIndirection)
{
var _this = GetThis(thisHandle);
try
@@ -1846,7 +1846,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static int* _getAddrOfCaptureThreadGlobal(IntPtr thisHandle, IntPtr* ppException, void** ppIndirection)
+ private static int* _getAddrOfCaptureThreadGlobal(IntPtr thisHandle, IntPtr* ppException, void** ppIndirection)
{
var _this = GetThis(thisHandle);
try
@@ -1861,7 +1861,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static void* _getHelperFtn(IntPtr thisHandle, IntPtr* ppException, CorInfoHelpFunc ftnNum, void** ppIndirection)
+ private static void* _getHelperFtn(IntPtr thisHandle, IntPtr* ppException, CorInfoHelpFunc ftnNum, void** ppIndirection)
{
var _this = GetThis(thisHandle);
try
@@ -1876,7 +1876,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static void _getFunctionEntryPoint(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, CORINFO_CONST_LOOKUP* pResult, CORINFO_ACCESS_FLAGS accessFlags)
+ private static void _getFunctionEntryPoint(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, CORINFO_CONST_LOOKUP* pResult, CORINFO_ACCESS_FLAGS accessFlags)
{
var _this = GetThis(thisHandle);
try
@@ -1890,7 +1890,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static void _getFunctionFixedEntryPoint(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, byte isUnsafeFunctionPointer, CORINFO_CONST_LOOKUP* pResult)
+ private static void _getFunctionFixedEntryPoint(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, byte isUnsafeFunctionPointer, CORINFO_CONST_LOOKUP* pResult)
{
var _this = GetThis(thisHandle);
try
@@ -1904,7 +1904,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static void* _getMethodSync(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, void** ppIndirection)
+ private static void* _getMethodSync(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, void** ppIndirection)
{
var _this = GetThis(thisHandle);
try
@@ -1919,7 +1919,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static CorInfoHelpFunc _getLazyStringLiteralHelper(IntPtr thisHandle, IntPtr* ppException, CORINFO_MODULE_STRUCT_* handle)
+ private static CorInfoHelpFunc _getLazyStringLiteralHelper(IntPtr thisHandle, IntPtr* ppException, CORINFO_MODULE_STRUCT_* handle)
{
var _this = GetThis(thisHandle);
try
@@ -1934,7 +1934,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static CORINFO_MODULE_STRUCT_* _embedModuleHandle(IntPtr thisHandle, IntPtr* ppException, CORINFO_MODULE_STRUCT_* handle, void** ppIndirection)
+ private static CORINFO_MODULE_STRUCT_* _embedModuleHandle(IntPtr thisHandle, IntPtr* ppException, CORINFO_MODULE_STRUCT_* handle, void** ppIndirection)
{
var _this = GetThis(thisHandle);
try
@@ -1949,7 +1949,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static CORINFO_CLASS_STRUCT_* _embedClassHandle(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* handle, void** ppIndirection)
+ private static CORINFO_CLASS_STRUCT_* _embedClassHandle(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* handle, void** ppIndirection)
{
var _this = GetThis(thisHandle);
try
@@ -1964,7 +1964,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static CORINFO_METHOD_STRUCT_* _embedMethodHandle(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* handle, void** ppIndirection)
+ private static CORINFO_METHOD_STRUCT_* _embedMethodHandle(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* handle, void** ppIndirection)
{
var _this = GetThis(thisHandle);
try
@@ -1979,7 +1979,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static CORINFO_FIELD_STRUCT_* _embedFieldHandle(IntPtr thisHandle, IntPtr* ppException, CORINFO_FIELD_STRUCT_* handle, void** ppIndirection)
+ private static CORINFO_FIELD_STRUCT_* _embedFieldHandle(IntPtr thisHandle, IntPtr* ppException, CORINFO_FIELD_STRUCT_* handle, void** ppIndirection)
{
var _this = GetThis(thisHandle);
try
@@ -1994,7 +1994,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static void _embedGenericHandle(IntPtr thisHandle, IntPtr* ppException, CORINFO_RESOLVED_TOKEN* pResolvedToken, byte fEmbedParent, CORINFO_GENERICHANDLE_RESULT* pResult)
+ private static void _embedGenericHandle(IntPtr thisHandle, IntPtr* ppException, CORINFO_RESOLVED_TOKEN* pResolvedToken, byte fEmbedParent, CORINFO_GENERICHANDLE_RESULT* pResult)
{
var _this = GetThis(thisHandle);
try
@@ -2008,7 +2008,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static void _getLocationOfThisType(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* context, CORINFO_LOOKUP_KIND* pLookupKind)
+ private static void _getLocationOfThisType(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* context, CORINFO_LOOKUP_KIND* pLookupKind)
{
var _this = GetThis(thisHandle);
try
@@ -2022,7 +2022,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static void _getAddressOfPInvokeTarget(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method, CORINFO_CONST_LOOKUP* pLookup)
+ private static void _getAddressOfPInvokeTarget(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method, CORINFO_CONST_LOOKUP* pLookup)
{
var _this = GetThis(thisHandle);
try
@@ -2036,7 +2036,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static void* _GetCookieForPInvokeCalliSig(IntPtr thisHandle, IntPtr* ppException, CORINFO_SIG_INFO* szMetaSig, void** ppIndirection)
+ private static void* _GetCookieForPInvokeCalliSig(IntPtr thisHandle, IntPtr* ppException, CORINFO_SIG_INFO* szMetaSig, void** ppIndirection)
{
var _this = GetThis(thisHandle);
try
@@ -2051,7 +2051,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static byte _canGetCookieForPInvokeCalliSig(IntPtr thisHandle, IntPtr* ppException, CORINFO_SIG_INFO* szMetaSig)
+ private static byte _canGetCookieForPInvokeCalliSig(IntPtr thisHandle, IntPtr* ppException, CORINFO_SIG_INFO* szMetaSig)
{
var _this = GetThis(thisHandle);
try
@@ -2066,7 +2066,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static CORINFO_JUST_MY_CODE_HANDLE_* _getJustMyCodeHandle(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method, CORINFO_JUST_MY_CODE_HANDLE_** ppIndirection)
+ private static CORINFO_JUST_MY_CODE_HANDLE_* _getJustMyCodeHandle(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method, CORINFO_JUST_MY_CODE_HANDLE_** ppIndirection)
{
var _this = GetThis(thisHandle);
try
@@ -2081,7 +2081,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static void _GetProfilingHandle(IntPtr thisHandle, IntPtr* ppException, bool* pbHookFunction, void** pProfilerHandle, bool* pbIndirectedHandles)
+ private static void _GetProfilingHandle(IntPtr thisHandle, IntPtr* ppException, bool* pbHookFunction, void** pProfilerHandle, bool* pbIndirectedHandles)
{
var _this = GetThis(thisHandle);
try
@@ -2095,7 +2095,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static void _getCallInfo(IntPtr thisHandle, IntPtr* ppException, CORINFO_RESOLVED_TOKEN* pResolvedToken, CORINFO_RESOLVED_TOKEN* pConstrainedResolvedToken, CORINFO_METHOD_STRUCT_* callerHandle, CORINFO_CALLINFO_FLAGS flags, CORINFO_CALL_INFO* pResult)
+ private static void _getCallInfo(IntPtr thisHandle, IntPtr* ppException, CORINFO_RESOLVED_TOKEN* pResolvedToken, CORINFO_RESOLVED_TOKEN* pConstrainedResolvedToken, CORINFO_METHOD_STRUCT_* callerHandle, CORINFO_CALLINFO_FLAGS flags, CORINFO_CALL_INFO* pResult)
{
var _this = GetThis(thisHandle);
try
@@ -2109,7 +2109,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static byte _canAccessFamily(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* hCaller, CORINFO_CLASS_STRUCT_* hInstanceType)
+ private static byte _canAccessFamily(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* hCaller, CORINFO_CLASS_STRUCT_* hInstanceType)
{
var _this = GetThis(thisHandle);
try
@@ -2124,7 +2124,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static byte _isRIDClassDomainID(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls)
+ private static byte _isRIDClassDomainID(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls)
{
var _this = GetThis(thisHandle);
try
@@ -2139,7 +2139,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static uint _getClassDomainID(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls, void** ppIndirection)
+ private static uint _getClassDomainID(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls, void** ppIndirection)
{
var _this = GetThis(thisHandle);
try
@@ -2154,7 +2154,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static void* _getFieldAddress(IntPtr thisHandle, IntPtr* ppException, CORINFO_FIELD_STRUCT_* field, void** ppIndirection)
+ private static void* _getFieldAddress(IntPtr thisHandle, IntPtr* ppException, CORINFO_FIELD_STRUCT_* field, void** ppIndirection)
{
var _this = GetThis(thisHandle);
try
@@ -2169,7 +2169,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static CORINFO_CLASS_STRUCT_* _getStaticFieldCurrentClass(IntPtr thisHandle, IntPtr* ppException, CORINFO_FIELD_STRUCT_* field, byte* pIsSpeculative)
+ private static CORINFO_CLASS_STRUCT_* _getStaticFieldCurrentClass(IntPtr thisHandle, IntPtr* ppException, CORINFO_FIELD_STRUCT_* field, byte* pIsSpeculative)
{
var _this = GetThis(thisHandle);
try
@@ -2184,7 +2184,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static IntPtr _getVarArgsHandle(IntPtr thisHandle, IntPtr* ppException, CORINFO_SIG_INFO* pSig, void** ppIndirection)
+ private static IntPtr _getVarArgsHandle(IntPtr thisHandle, IntPtr* ppException, CORINFO_SIG_INFO* pSig, void** ppIndirection)
{
var _this = GetThis(thisHandle);
try
@@ -2199,7 +2199,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static byte _canGetVarArgsHandle(IntPtr thisHandle, IntPtr* ppException, CORINFO_SIG_INFO* pSig)
+ private static byte _canGetVarArgsHandle(IntPtr thisHandle, IntPtr* ppException, CORINFO_SIG_INFO* pSig)
{
var _this = GetThis(thisHandle);
try
@@ -2214,7 +2214,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static InfoAccessType _constructStringLiteral(IntPtr thisHandle, IntPtr* ppException, CORINFO_MODULE_STRUCT_* module, mdToken metaTok, void** ppValue)
+ private static InfoAccessType _constructStringLiteral(IntPtr thisHandle, IntPtr* ppException, CORINFO_MODULE_STRUCT_* module, mdToken metaTok, void** ppValue)
{
var _this = GetThis(thisHandle);
try
@@ -2229,7 +2229,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static InfoAccessType _emptyStringLiteral(IntPtr thisHandle, IntPtr* ppException, void** ppValue)
+ private static InfoAccessType _emptyStringLiteral(IntPtr thisHandle, IntPtr* ppException, void** ppValue)
{
var _this = GetThis(thisHandle);
try
@@ -2244,7 +2244,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static uint _getFieldThreadLocalStoreID(IntPtr thisHandle, IntPtr* ppException, CORINFO_FIELD_STRUCT_* field, void** ppIndirection)
+ private static uint _getFieldThreadLocalStoreID(IntPtr thisHandle, IntPtr* ppException, CORINFO_FIELD_STRUCT_* field, void** ppIndirection)
{
var _this = GetThis(thisHandle);
try
@@ -2259,7 +2259,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static void _addActiveDependency(IntPtr thisHandle, IntPtr* ppException, CORINFO_MODULE_STRUCT_* moduleFrom, CORINFO_MODULE_STRUCT_* moduleTo)
+ private static void _addActiveDependency(IntPtr thisHandle, IntPtr* ppException, CORINFO_MODULE_STRUCT_* moduleFrom, CORINFO_MODULE_STRUCT_* moduleTo)
{
var _this = GetThis(thisHandle);
try
@@ -2273,7 +2273,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static CORINFO_METHOD_STRUCT_* _GetDelegateCtor(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* methHnd, CORINFO_CLASS_STRUCT_* clsHnd, CORINFO_METHOD_STRUCT_* targetMethodHnd, DelegateCtorArgs* pCtorData)
+ private static CORINFO_METHOD_STRUCT_* _GetDelegateCtor(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* methHnd, CORINFO_CLASS_STRUCT_* clsHnd, CORINFO_METHOD_STRUCT_* targetMethodHnd, DelegateCtorArgs* pCtorData)
{
var _this = GetThis(thisHandle);
try
@@ -2288,7 +2288,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static void _MethodCompileComplete(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* methHnd)
+ private static void _MethodCompileComplete(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* methHnd)
{
var _this = GetThis(thisHandle);
try
@@ -2302,7 +2302,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static byte _getTailCallHelpers(IntPtr thisHandle, IntPtr* ppException, CORINFO_RESOLVED_TOKEN* callToken, CORINFO_SIG_INFO* sig, CORINFO_GET_TAILCALL_HELPERS_FLAGS flags, CORINFO_TAILCALL_HELPERS* pResult)
+ private static byte _getTailCallHelpers(IntPtr thisHandle, IntPtr* ppException, CORINFO_RESOLVED_TOKEN* callToken, CORINFO_SIG_INFO* sig, CORINFO_GET_TAILCALL_HELPERS_FLAGS flags, CORINFO_TAILCALL_HELPERS* pResult)
{
var _this = GetThis(thisHandle);
try
@@ -2317,7 +2317,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static byte _convertPInvokeCalliToCall(IntPtr thisHandle, IntPtr* ppException, CORINFO_RESOLVED_TOKEN* pResolvedToken, byte mustConvert)
+ private static byte _convertPInvokeCalliToCall(IntPtr thisHandle, IntPtr* ppException, CORINFO_RESOLVED_TOKEN* pResolvedToken, byte mustConvert)
{
var _this = GetThis(thisHandle);
try
@@ -2332,7 +2332,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static byte _notifyInstructionSetUsage(IntPtr thisHandle, IntPtr* ppException, InstructionSet instructionSet, byte supportEnabled)
+ private static byte _notifyInstructionSetUsage(IntPtr thisHandle, IntPtr* ppException, InstructionSet instructionSet, byte supportEnabled)
{
var _this = GetThis(thisHandle);
try
@@ -2347,7 +2347,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static void _updateEntryPointForTailCall(IntPtr thisHandle, IntPtr* ppException, CORINFO_CONST_LOOKUP* entryPoint)
+ private static void _updateEntryPointForTailCall(IntPtr thisHandle, IntPtr* ppException, CORINFO_CONST_LOOKUP* entryPoint)
{
var _this = GetThis(thisHandle);
try
@@ -2361,7 +2361,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static void _allocMem(IntPtr thisHandle, IntPtr* ppException, AllocMemArgs* pArgs)
+ private static void _allocMem(IntPtr thisHandle, IntPtr* ppException, AllocMemArgs* pArgs)
{
var _this = GetThis(thisHandle);
try
@@ -2375,7 +2375,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static void _reserveUnwindInfo(IntPtr thisHandle, IntPtr* ppException, byte isFunclet, byte isColdCode, uint unwindSize)
+ private static void _reserveUnwindInfo(IntPtr thisHandle, IntPtr* ppException, byte isFunclet, byte isColdCode, uint unwindSize)
{
var _this = GetThis(thisHandle);
try
@@ -2389,7 +2389,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static void _allocUnwindInfo(IntPtr thisHandle, IntPtr* ppException, byte* pHotCode, byte* pColdCode, uint startOffset, uint endOffset, uint unwindSize, byte* pUnwindBlock, CorJitFuncKind funcKind)
+ private static void _allocUnwindInfo(IntPtr thisHandle, IntPtr* ppException, byte* pHotCode, byte* pColdCode, uint startOffset, uint endOffset, uint unwindSize, byte* pUnwindBlock, CorJitFuncKind funcKind)
{
var _this = GetThis(thisHandle);
try
@@ -2403,7 +2403,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static void* _allocGCInfo(IntPtr thisHandle, IntPtr* ppException, UIntPtr size)
+ private static void* _allocGCInfo(IntPtr thisHandle, IntPtr* ppException, UIntPtr size)
{
var _this = GetThis(thisHandle);
try
@@ -2418,7 +2418,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static void _setEHcount(IntPtr thisHandle, IntPtr* ppException, uint cEH)
+ private static void _setEHcount(IntPtr thisHandle, IntPtr* ppException, uint cEH)
{
var _this = GetThis(thisHandle);
try
@@ -2432,7 +2432,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static void _setEHinfo(IntPtr thisHandle, IntPtr* ppException, uint EHnumber, CORINFO_EH_CLAUSE* clause)
+ private static void _setEHinfo(IntPtr thisHandle, IntPtr* ppException, uint EHnumber, CORINFO_EH_CLAUSE* clause)
{
var _this = GetThis(thisHandle);
try
@@ -2446,7 +2446,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static byte _logMsg(IntPtr thisHandle, IntPtr* ppException, uint level, byte* fmt, IntPtr args)
+ private static byte _logMsg(IntPtr thisHandle, IntPtr* ppException, uint level, byte* fmt, IntPtr args)
{
var _this = GetThis(thisHandle);
try
@@ -2461,7 +2461,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static int _doAssert(IntPtr thisHandle, IntPtr* ppException, byte* szFile, int iLine, byte* szExpr)
+ private static int _doAssert(IntPtr thisHandle, IntPtr* ppException, byte* szFile, int iLine, byte* szExpr)
{
var _this = GetThis(thisHandle);
try
@@ -2476,7 +2476,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static void _reportFatalError(IntPtr thisHandle, IntPtr* ppException, CorJitResult result)
+ private static void _reportFatalError(IntPtr thisHandle, IntPtr* ppException, CorJitResult result)
{
var _this = GetThis(thisHandle);
try
@@ -2490,7 +2490,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static HRESULT _getPgoInstrumentationResults(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftnHnd, PgoInstrumentationSchema** pSchema, uint* pCountSchemaItems, byte** pInstrumentationData, PgoSource* pgoSource)
+ private static HRESULT _getPgoInstrumentationResults(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftnHnd, PgoInstrumentationSchema** pSchema, uint* pCountSchemaItems, byte** pInstrumentationData, PgoSource* pgoSource)
{
var _this = GetThis(thisHandle);
try
@@ -2505,7 +2505,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static HRESULT _allocPgoInstrumentationBySchema(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftnHnd, PgoInstrumentationSchema* pSchema, uint countSchemaItems, byte** pInstrumentationData)
+ private static HRESULT _allocPgoInstrumentationBySchema(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftnHnd, PgoInstrumentationSchema* pSchema, uint countSchemaItems, byte** pInstrumentationData)
{
var _this = GetThis(thisHandle);
try
@@ -2520,7 +2520,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static void _recordCallSite(IntPtr thisHandle, IntPtr* ppException, uint instrOffset, CORINFO_SIG_INFO* callSig, CORINFO_METHOD_STRUCT_* methodHandle)
+ private static void _recordCallSite(IntPtr thisHandle, IntPtr* ppException, uint instrOffset, CORINFO_SIG_INFO* callSig, CORINFO_METHOD_STRUCT_* methodHandle)
{
var _this = GetThis(thisHandle);
try
@@ -2534,7 +2534,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static void _recordRelocation(IntPtr thisHandle, IntPtr* ppException, void* location, void* locationRW, void* target, ushort fRelocType, ushort slotNum, int addlDelta)
+ private static void _recordRelocation(IntPtr thisHandle, IntPtr* ppException, void* location, void* locationRW, void* target, ushort fRelocType, ushort slotNum, int addlDelta)
{
var _this = GetThis(thisHandle);
try
@@ -2548,7 +2548,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static ushort _getRelocTypeHint(IntPtr thisHandle, IntPtr* ppException, void* target)
+ private static ushort _getRelocTypeHint(IntPtr thisHandle, IntPtr* ppException, void* target)
{
var _this = GetThis(thisHandle);
try
@@ -2563,7 +2563,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static uint _getExpectedTargetArchitecture(IntPtr thisHandle, IntPtr* ppException)
+ private static uint _getExpectedTargetArchitecture(IntPtr thisHandle, IntPtr* ppException)
{
var _this = GetThis(thisHandle);
try
@@ -2578,7 +2578,7 @@ namespace Internal.JitInterface
}
[UnmanagedCallersOnly]
- static uint _getJitFlags(IntPtr thisHandle, IntPtr* ppException, CORJIT_FLAGS* flags, uint sizeInBytes)
+ private static uint _getJitFlags(IntPtr thisHandle, IntPtr* ppException, CORJIT_FLAGS* flags, uint sizeInBytes)
{
var _this = GetThis(thisHandle);
try
@@ -2592,8 +2592,7 @@ namespace Internal.JitInterface
}
}
-
- static IntPtr GetUnmanagedCallbacks()
+ private static IntPtr GetUnmanagedCallbacks()
{
void** callbacks = (void**)Marshal.AllocCoTaskMem(sizeof(IntPtr) * 175);
@@ -2777,4 +2776,3 @@ namespace Internal.JitInterface
}
}
}
-
diff --git a/src/coreclr/tools/Common/JitInterface/CorInfoHelpFunc.cs b/src/coreclr/tools/Common/JitInterface/CorInfoHelpFunc.cs
index b0a53c8232e..c6774127307 100644
--- a/src/coreclr/tools/Common/JitInterface/CorInfoHelpFunc.cs
+++ b/src/coreclr/tools/Common/JitInterface/CorInfoHelpFunc.cs
@@ -1,10 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-using System.Collections.Generic;
-using System.Text;
-
namespace Internal.JitInterface
{
// CorInfoHelpFunc defines the set of helpers (accessed via the ICorDynamicInfo::getHelperFtn())
@@ -54,9 +50,9 @@ namespace Internal.JitInterface
CORINFO_HELP_NEWSFAST, // allocator for small, non-finalizer, non-array object
CORINFO_HELP_NEWSFAST_FINALIZE, // allocator for small, finalizable, non-array object
CORINFO_HELP_NEWSFAST_ALIGN8, // allocator for small, non-finalizer, non-array object, 8 byte aligned
- CORINFO_HELP_NEWSFAST_ALIGN8_VC,// allocator for small, value class, 8 byte aligned
+ CORINFO_HELP_NEWSFAST_ALIGN8_VC, // allocator for small, value class, 8 byte aligned
CORINFO_HELP_NEWSFAST_ALIGN8_FINALIZE, // allocator for small, finalizable, non-array object, 8 byte aligned
- CORINFO_HELP_NEW_MDARR,// multi-dim array helper (with or without lower bounds - dimensions passed in as unmanaged array)
+ CORINFO_HELP_NEW_MDARR, // multi-dim array helper (with or without lower bounds - dimensions passed in as unmanaged array)
CORINFO_HELP_NEWARR_1_DIRECT, // helper for any one dimensional array creation
CORINFO_HELP_NEWARR_1_OBJ, // optimized 1-D object arrays
CORINFO_HELP_NEWARR_1_VC, // optimized 1-D value class arrays
@@ -108,7 +104,7 @@ namespace Internal.JitInterface
CORINFO_HELP_VERIFICATION, // Throw a VerificationException
CORINFO_HELP_FAIL_FAST, // Kill the process avoiding any exceptions or stack and data dependencies (use for GuardStack unsafe buffer checks)
- CORINFO_HELP_METHOD_ACCESS_EXCEPTION,//Throw an access exception due to a failed member/class access check.
+ CORINFO_HELP_METHOD_ACCESS_EXCEPTION, //Throw an access exception due to a failed member/class access check.
CORINFO_HELP_FIELD_ACCESS_EXCEPTION,
CORINFO_HELP_CLASS_ACCESS_EXCEPTION,
@@ -217,9 +213,9 @@ namespace Internal.JitInterface
CORINFO_HELP_MEMCPY, // Copy block of memory
CORINFO_HELP_RUNTIMEHANDLE_METHOD, // determine a type/field/method handle at run-time
- CORINFO_HELP_RUNTIMEHANDLE_METHOD_LOG,// determine a type/field/method handle at run-time, with IBC logging
+ CORINFO_HELP_RUNTIMEHANDLE_METHOD_LOG, // determine a type/field/method handle at run-time, with IBC logging
CORINFO_HELP_RUNTIMEHANDLE_CLASS, // determine a type/field/method handle at run-time
- CORINFO_HELP_RUNTIMEHANDLE_CLASS_LOG,// determine a type/field/method handle at run-time, with IBC logging
+ CORINFO_HELP_RUNTIMEHANDLE_CLASS_LOG, // determine a type/field/method handle at run-time, with IBC logging
CORINFO_HELP_TYPEHANDLE_TO_RUNTIMETYPE, // Convert from a TypeHandle (native structure pointer) to RuntimeType at run-time
CORINFO_HELP_TYPEHANDLE_TO_RUNTIMETYPE_MAYBENULL, // Convert from a TypeHandle (native structure pointer) to RuntimeType at run-time, the type may be null
@@ -243,8 +239,8 @@ namespace Internal.JitInterface
CORINFO_HELP_READYTORUN_DELEGATE_CTOR,
CORINFO_HELP_READYTORUN_GENERIC_STATIC_BASE,
- CORINFO_HELP_EE_PERSONALITY_ROUTINE,// Not real JIT helper. Used in native images.
- CORINFO_HELP_EE_PERSONALITY_ROUTINE_FILTER_FUNCLET,// Not real JIT helper. Used in native images to detect filter funclets.
+ CORINFO_HELP_EE_PERSONALITY_ROUTINE, // Not real JIT helper. Used in native images.
+ CORINFO_HELP_EE_PERSONALITY_ROUTINE_FILTER_FUNCLET, // Not real JIT helper. Used in native images to detect filter funclets.
// ASSIGN_REF_EAX - CHECKED_ASSIGN_REF_EBP: NOGC_WRITE_BARRIERS JIT helper calls
//
diff --git a/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs b/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs
index c1f59c124b6..c5f6ba41139 100644
--- a/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs
+++ b/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs
@@ -3,11 +3,9 @@
using System;
using System.Collections.Generic;
-using System.Collections.Immutable;
using System.Diagnostics;
using System.IO;
using System.Text;
-using System.Reflection.Metadata;
using System.Runtime.CompilerServices;
using System.Runtime.ExceptionServices;
using System.Runtime.InteropServices;
@@ -25,7 +23,6 @@ using Internal.Pgo;
using ILCompiler;
using ILCompiler.DependencyAnalysis;
-using Internal.IL.Stubs;
#if READYTORUN
using System.Reflection.Metadata.Ecma335;
@@ -34,7 +31,7 @@ using ILCompiler.DependencyAnalysis.ReadyToRun;
namespace Internal.JitInterface
{
- enum CompilationResult
+ internal enum CompilationResult
{
CompilationComplete,
CompilationRetryRequested
@@ -76,18 +73,19 @@ namespace Internal.JitInterface
public byte* pInstrumentationData;
public HRESULT hr;
}
- Dictionary<MethodDesc, PgoInstrumentationResults> _pgoResults = new Dictionary<MethodDesc, PgoInstrumentationResults>();
+
+ private Dictionary<MethodDesc, PgoInstrumentationResults> _pgoResults = new Dictionary<MethodDesc, PgoInstrumentationResults>();
[DllImport(JitLibrary)]
- private extern static IntPtr jitStartup(IntPtr host);
+ private static extern IntPtr jitStartup(IntPtr host);
private static class JitPointerAccessor
{
[DllImport(JitLibrary)]
- private extern static IntPtr getJit();
+ private static extern IntPtr getJit();
[DllImport(JitSupportLibrary)]
- private extern static CorJitResult JitProcessShutdownWork(IntPtr jit);
+ private static extern CorJitResult JitProcessShutdownWork(IntPtr jit);
static JitPointerAccessor()
{
@@ -121,13 +119,13 @@ namespace Internal.JitInterface
}
[DllImport(JitLibrary)]
- private extern static uint getLikelyClasses(LikelyClassMethodRecord* pLikelyClasses, uint maxLikelyClasses, PgoInstrumentationSchema* schema, uint countSchemaItems, byte*pInstrumentationData, int ilOffset);
+ private static extern uint getLikelyClasses(LikelyClassMethodRecord* pLikelyClasses, uint maxLikelyClasses, PgoInstrumentationSchema* schema, uint countSchemaItems, byte*pInstrumentationData, int ilOffset);
[DllImport(JitLibrary)]
- private extern static uint getLikelyMethods(LikelyClassMethodRecord* pLikelyMethods, uint maxLikelyMethods, PgoInstrumentationSchema* schema, uint countSchemaItems, byte*pInstrumentationData, int ilOffset);
+ private static extern uint getLikelyMethods(LikelyClassMethodRecord* pLikelyMethods, uint maxLikelyMethods, PgoInstrumentationSchema* schema, uint countSchemaItems, byte*pInstrumentationData, int ilOffset);
[DllImport(JitSupportLibrary)]
- private extern static IntPtr GetJitHost(IntPtr configProvider);
+ private static extern IntPtr GetJitHost(IntPtr configProvider);
//
// Per-method initialization and state
@@ -140,18 +138,18 @@ namespace Internal.JitInterface
}
[DllImport(JitSupportLibrary)]
- private extern static CorJitResult JitCompileMethod(out IntPtr exception,
+ private static extern CorJitResult JitCompileMethod(out IntPtr exception,
IntPtr jit, IntPtr thisHandle, IntPtr callbacks,
ref CORINFO_METHOD_INFO info, uint flags, out IntPtr nativeEntry, out uint codeSize);
[DllImport(JitSupportLibrary)]
- private extern static uint GetMaxIntrinsicSIMDVectorLength(IntPtr jit, CORJIT_FLAGS* flags);
+ private static extern uint GetMaxIntrinsicSIMDVectorLength(IntPtr jit, CORJIT_FLAGS* flags);
[DllImport(JitSupportLibrary)]
- private extern static IntPtr AllocException([MarshalAs(UnmanagedType.LPWStr)]string message, int messageLength);
+ private static extern IntPtr AllocException([MarshalAs(UnmanagedType.LPWStr)]string message, int messageLength);
[DllImport(JitSupportLibrary)]
- private extern static void JitSetOs(IntPtr jit, CORINFO_OS os);
+ private static extern void JitSetOs(IntPtr jit, CORINFO_OS os);
private IntPtr AllocException(Exception ex)
{
@@ -159,19 +157,16 @@ namespace Internal.JitInterface
string exString = ex.ToString();
IntPtr nativeException = AllocException(exString, exString.Length);
- if (_nativeExceptions == null)
- {
- _nativeExceptions = new List<IntPtr>();
- }
+ _nativeExceptions ??= new List<IntPtr>();
_nativeExceptions.Add(nativeException);
return nativeException;
}
[DllImport(JitSupportLibrary)]
- private extern static void FreeException(IntPtr obj);
+ private static extern void FreeException(IntPtr obj);
[DllImport(JitSupportLibrary)]
- private extern static char* GetExceptionMessage(IntPtr obj);
+ private static extern char* GetExceptionMessage(IntPtr obj);
public static void Startup(CORINFO_OS os)
{
@@ -312,7 +307,7 @@ namespace Internal.JitInterface
if (newData != null)
{
- PgoSchemaElem likelyClassElem = new PgoSchemaElem();
+ PgoSchemaElem likelyClassElem = default(PgoSchemaElem);
likelyClassElem.InstrumentationKind = isType ? PgoInstrumentationKind.GetLikelyClass : PgoInstrumentationKind.GetLikelyMethod;
likelyClassElem.ILOffset = nativeSchema[index].ILOffset;
likelyClassElem.Count = 1;
@@ -469,11 +464,13 @@ namespace Internal.JitInterface
}
}
+#pragma warning disable SA1001, SA1113, SA1115 // Comma should be on the same line as previous parameter
_methodCodeNode.SetCode(objectData
#if !SUPPORT_JIT && !READYTORUN
, isFoldable: (_compilation._compilationOptions & RyuJitCompilationOptions.MethodBodyFolding) != 0
#endif
);
+#pragma warning restore SA1001, SA1113, SA1115 // Comma should be on the same line as previous parameter
_methodCodeNode.InitializeFrameInfos(_frameInfos);
_methodCodeNode.InitializeDebugEHClauseInfos(debugEHClauseInfos);
@@ -586,9 +583,9 @@ namespace Internal.JitInterface
}
}
- private Dictionary<Object, GCHandle> _pins = new Dictionary<object, GCHandle>();
+ private Dictionary<object, GCHandle> _pins = new Dictionary<object, GCHandle>();
- private IntPtr GetPin(Object obj)
+ private IntPtr GetPin(object obj)
{
GCHandle handle;
if (!_pins.TryGetValue(obj, out handle))
@@ -622,8 +619,8 @@ namespace Internal.JitInterface
_roData = null;
_roDataBlob = null;
- _codeRelocs = new ArrayBuilder<Relocation>();
- _roDataRelocs = new ArrayBuilder<Relocation>();
+ _codeRelocs = default(ArrayBuilder<Relocation>);
+ _roDataRelocs = default(ArrayBuilder<Relocation>);
_numFrameInfos = 0;
_usedFrameInfos = 0;
@@ -656,8 +653,8 @@ namespace Internal.JitInterface
_pgoResults.Clear();
}
- private Dictionary<Object, IntPtr> _objectToHandle = new Dictionary<Object, IntPtr>();
- private List<Object> _handleToObject = new List<Object>();
+ private Dictionary<object, IntPtr> _objectToHandle = new Dictionary<object, IntPtr>();
+ private List<object> _handleToObject = new List<object>();
private const int handleMultiplier = 8;
private const int handleBase = 0x420000;
@@ -666,7 +663,7 @@ namespace Internal.JitInterface
private static readonly IntPtr s_handleHighBitSet = (sizeof(IntPtr) == 4) ? new IntPtr(0x40000000) : new IntPtr(0x4000000000000000);
#endif
- private IntPtr ObjectToHandle(Object obj)
+ private IntPtr ObjectToHandle(object obj)
{
// SuperPMI relies on the handle returned from this function being stable for the lifetime of the crossgen2 process
// If handle deletion is implemented, please update SuperPMI
@@ -683,7 +680,7 @@ namespace Internal.JitInterface
return handle;
}
- private Object HandleToObject(IntPtr handle)
+ private object HandleToObject(IntPtr handle)
{
#if DEBUG
handle = new IntPtr(~(long)s_handleHighBitSet & (long) handle);
@@ -693,9 +690,9 @@ namespace Internal.JitInterface
}
private MethodDesc HandleToObject(CORINFO_METHOD_STRUCT_* method) => (MethodDesc)HandleToObject((IntPtr)method);
- private CORINFO_METHOD_STRUCT_* ObjectToHandle(MethodDesc method) => (CORINFO_METHOD_STRUCT_*)ObjectToHandle((Object)method);
+ private CORINFO_METHOD_STRUCT_* ObjectToHandle(MethodDesc method) => (CORINFO_METHOD_STRUCT_*)ObjectToHandle((object)method);
private TypeDesc HandleToObject(CORINFO_CLASS_STRUCT_* type) => (TypeDesc)HandleToObject((IntPtr)type);
- private CORINFO_CLASS_STRUCT_* ObjectToHandle(TypeDesc type) => (CORINFO_CLASS_STRUCT_*)ObjectToHandle((Object)type);
+ private CORINFO_CLASS_STRUCT_* ObjectToHandle(TypeDesc type) => (CORINFO_CLASS_STRUCT_*)ObjectToHandle((object)type);
private FieldDesc HandleToObject(CORINFO_FIELD_STRUCT_* field) => (FieldDesc)HandleToObject((IntPtr)field);
private CORINFO_FIELD_STRUCT_* ObjectToHandle(FieldDesc field) => (CORINFO_FIELD_STRUCT_*)ObjectToHandle((object)field);
private MethodILScope HandleToObject(CORINFO_MODULE_STRUCT_* module) => (MethodIL)HandleToObject((IntPtr)module);
@@ -740,14 +737,11 @@ namespace Internal.JitInterface
return true;
}
- private Dictionary<Instantiation, IntPtr[]> _instantiationToJitVisibleInstantiation = null;
+ private Dictionary<Instantiation, IntPtr[]> _instantiationToJitVisibleInstantiation;
private CORINFO_CLASS_STRUCT_** GetJitInstantiation(Instantiation inst)
{
IntPtr [] jitVisibleInstantiation;
- if (_instantiationToJitVisibleInstantiation == null)
- {
- _instantiationToJitVisibleInstantiation = new Dictionary<Instantiation, IntPtr[]>();
- }
+ _instantiationToJitVisibleInstantiation ??= new Dictionary<Instantiation, IntPtr[]>();
if (!_instantiationToJitVisibleInstantiation.TryGetValue(inst, out jitVisibleInstantiation))
{
@@ -1084,7 +1078,9 @@ namespace Internal.JitInterface
return (uint)result;
}
+#pragma warning disable CA1822 // Mark members as static
private void setMethodAttribs(CORINFO_METHOD_STRUCT_* ftn, CorInfoMethodRuntimeFlags attribs)
+#pragma warning restore CA1822 // Mark members as static
{
// TODO: Inlining
}
@@ -1146,7 +1142,9 @@ namespace Internal.JitInterface
}
}
+#pragma warning disable CA1822 // Mark members as static
private void reportTailCallDecision(CORINFO_METHOD_STRUCT_* callerHnd, CORINFO_METHOD_STRUCT_* calleeHnd, bool fIsTailPrefix, CorInfoTailCall tailCallResult, byte* reason)
+#pragma warning restore CA1822 // Mark members as static
{
}
@@ -1355,10 +1353,7 @@ namespace Internal.JitInterface
CORINFO_RESOLVED_TOKEN result = default(CORINFO_RESOLVED_TOKEN);
MethodILScope scope = jitInterface._compilation.GetMethodIL(methodWithToken.Method);
- if (scope == null)
- {
- scope = Internal.IL.EcmaMethodILScope.Create((EcmaMethod)methodWithToken.Method.GetTypicalMethodDefinition());
- }
+ scope ??= EcmaMethodILScope.Create((EcmaMethod)methodWithToken.Method.GetTypicalMethodDefinition());
result.tokenScope = jitInterface.ObjectToHandle(scope);
result.tokenContext = jitInterface.contextFromMethod(method);
#if READYTORUN
@@ -1432,7 +1427,7 @@ namespace Internal.JitInterface
return callConv;
}
}
- private CorInfoCallConvExtension GetUnmanagedCallConv(MethodDesc methodDesc, out bool suppressGCTransition)
+ private static CorInfoCallConvExtension GetUnmanagedCallConv(MethodDesc methodDesc, out bool suppressGCTransition)
{
UnmanagedCallingConventions callingConventions;
@@ -1456,12 +1451,12 @@ namespace Internal.JitInterface
return ToCorInfoCallConvExtension(callingConventions, out suppressGCTransition);
}
- private CorInfoCallConvExtension GetUnmanagedCallConv(MethodSignature signature, out bool suppressGCTransition)
+ private static CorInfoCallConvExtension GetUnmanagedCallConv(MethodSignature signature, out bool suppressGCTransition)
{
return ToCorInfoCallConvExtension(signature.GetStandaloneMethodSignatureCallingConventions(), out suppressGCTransition);
}
- private CorInfoCallConvExtension ToCorInfoCallConvExtension(UnmanagedCallingConventions callConvs, out bool suppressGCTransition)
+ private static CorInfoCallConvExtension ToCorInfoCallConvExtension(UnmanagedCallingConventions callConvs, out bool suppressGCTransition)
{
CorInfoCallConvExtension result;
switch (callConvs & UnmanagedCallingConventions.CallingConventionMask)
@@ -1509,7 +1504,9 @@ namespace Internal.JitInterface
private PatchpointInfo* getOSRInfo(ref uint ilOffset)
{ throw new NotImplementedException("getOSRInfo"); }
+#pragma warning disable CA1822 // Mark members as static
private void methodMustBeLoadedBeforeCodeIsRun(CORINFO_METHOD_STRUCT_* method)
+#pragma warning restore CA1822 // Mark members as static
{
}
@@ -1551,9 +1548,9 @@ namespace Internal.JitInterface
if (owningMethod != typeOrMethodContext &&
owningMethod.IsCanonicalMethod(CanonicalFormKind.Any))
{
- Instantiation typeInst = default;
Instantiation methodInst = default;
+ Instantiation typeInst;
if (typeOrMethodContext is TypeDesc typeContext)
{
Debug.Assert(typeContext.HasSameTypeDefinition(owningMethod.OwningType) || typeContext.IsArray);
@@ -1606,7 +1603,7 @@ namespace Internal.JitInterface
return result;
}
- private object GetRuntimeDeterminedObjectForToken(MethodILScope methodIL, object typeOrMethodContext, mdToken token)
+ private static object GetRuntimeDeterminedObjectForToken(MethodILScope methodIL, object typeOrMethodContext, mdToken token)
{
object result = ResolveTokenInScope(methodIL, typeOrMethodContext, token);
@@ -1795,7 +1792,7 @@ namespace Internal.JitInterface
return ObjectToHandle(_compilation.TypeSystemContext.GetWellKnownType(result));
}
- private CorInfoCanSkipVerificationResult canSkipVerification(CORINFO_MODULE_STRUCT_* module)
+ private static CorInfoCanSkipVerificationResult canSkipVerification(CORINFO_MODULE_STRUCT_* module)
{
return CorInfoCanSkipVerificationResult.CORINFO_VERIFICATION_CAN_SKIP;
}
@@ -1896,7 +1893,9 @@ namespace Internal.JitInterface
return HandleToObject(cls).IsValueType;
}
+#pragma warning disable CA1822 // Mark members as static
private CorInfoInlineTypeCheck canInlineTypeCheck(CORINFO_CLASS_STRUCT_* cls, CorInfoInlineTypeCheckSource source)
+#pragma warning restore CA1822 // Mark members as static
{
// TODO: when we support multiple modules at runtime, this will need to do more work
// NOTE: cls can be null
@@ -1993,12 +1992,16 @@ namespace Internal.JitInterface
private byte* getAssemblyName(CORINFO_ASSEMBLY_STRUCT_* assem)
{ throw new NotImplementedException("getAssemblyName"); }
+#pragma warning disable CA1822 // Mark members as static
private void* LongLifetimeMalloc(UIntPtr sz)
+#pragma warning restore CA1822 // Mark members as static
{
return (void*)Marshal.AllocCoTaskMem((int)sz);
}
+#pragma warning disable CA1822 // Mark members as static
private void LongLifetimeFree(void* obj)
+#pragma warning restore CA1822 // Mark members as static
{
Marshal.FreeCoTaskMem((IntPtr)obj);
}
@@ -2093,12 +2096,12 @@ namespace Internal.JitInterface
//
// Heuristic to determine if we should have instances of this class 8 byte aligned
//
- static bool ShouldAlign8(int dwR8Fields, int dwTotalFields)
+ private static bool ShouldAlign8(int dwR8Fields, int dwTotalFields)
{
return dwR8Fields*2>dwTotalFields && dwR8Fields>=2;
}
- static bool ShouldAlign8(DefType type)
+ private static bool ShouldAlign8(DefType type)
{
int instanceFields = 0;
int doubleFields = 0;
@@ -2691,7 +2694,9 @@ namespace Internal.JitInterface
result = asCorInfoType(returnType, clsRet);
}
else
+#pragma warning disable IDE0059 // Unnecessary assignment of a value
clsRet = null;
+#pragma warning restore IDE0059 // Unnecessary assignment of a value
return result;
}
@@ -2746,7 +2751,9 @@ namespace Internal.JitInterface
return (void*)ObjectToHandle(_compilation.GetFieldRvaData(fd));
}
+#pragma warning disable CA1822 // Mark members as static
private CorInfoIsAccessAllowedResult canAccessClass(ref CORINFO_RESOLVED_TOKEN pResolvedToken, CORINFO_METHOD_STRUCT_* callerHandle, ref CORINFO_HELPER_DESC pAccessHelper)
+#pragma warning restore CA1822 // Mark members as static
{
// TODO: Access check
return CorInfoIsAccessAllowedResult.CORINFO_ACCESS_ALLOWED;
@@ -2800,7 +2807,7 @@ namespace Internal.JitInterface
return (uint)fieldDesc.Offset.AsInt;
}
- private CORINFO_FIELD_ACCESSOR getFieldIntrinsic(FieldDesc field)
+ private static CORINFO_FIELD_ACCESSOR getFieldIntrinsic(FieldDesc field)
{
Debug.Assert(field.IsIntrinsic);
@@ -2848,23 +2855,31 @@ namespace Internal.JitInterface
extendOthers = true;
}
+#pragma warning disable CA1822 // Mark members as static
private void reportRichMappings(InlineTreeNode* inlineTree, uint numInlineTree, RichOffsetMapping* mappings, uint numMappings)
+#pragma warning restore CA1822 // Mark members as static
{
Marshal.FreeHGlobal((IntPtr)inlineTree);
Marshal.FreeHGlobal((IntPtr)mappings);
}
+#pragma warning disable CA1822 // Mark members as static
private void* allocateArray(UIntPtr cBytes)
+#pragma warning restore CA1822 // Mark members as static
{
return (void*)Marshal.AllocHGlobal((IntPtr)(void*)cBytes);
}
+#pragma warning disable CA1822 // Mark members as static
private void freeArray(void* array)
+#pragma warning restore CA1822 // Mark members as static
{
Marshal.FreeHGlobal((IntPtr)array);
}
+#pragma warning disable CA1822 // Mark members as static
private CORINFO_ARG_LIST_STRUCT_* getArgNext(CORINFO_ARG_LIST_STRUCT_* args)
+#pragma warning restore CA1822 // Mark members as static
{
return (CORINFO_ARG_LIST_STRUCT_*)((int)args + 1);
}
@@ -2872,7 +2887,7 @@ namespace Internal.JitInterface
private CorInfoTypeWithMod getArgType(CORINFO_SIG_INFO* sig, CORINFO_ARG_LIST_STRUCT_* args, CORINFO_CLASS_STRUCT_** vcTypeRet)
{
int index = (int)args;
- Object sigObj = HandleToObject((IntPtr)sig->methodSignature);
+ object sigObj = HandleToObject((IntPtr)sig->methodSignature);
MethodSignature methodSig = sigObj as MethodSignature;
@@ -2897,7 +2912,7 @@ namespace Internal.JitInterface
private CORINFO_CLASS_STRUCT_* getArgClass(CORINFO_SIG_INFO* sig, CORINFO_ARG_LIST_STRUCT_* args)
{
int index = (int)args;
- Object sigObj = HandleToObject((IntPtr)sig->methodSignature);
+ object sigObj = HandleToObject((IntPtr)sig->methodSignature);
MethodSignature methodSig = sigObj as MethodSignature;
if (methodSig != null)
@@ -2933,7 +2948,9 @@ namespace Internal.JitInterface
private uint GetErrorMessage(char* buffer, uint bufferLength)
{ throw new NotImplementedException("GetErrorMessage"); }
+#pragma warning disable CA1822 // Mark members as static
private int FilterException(_EXCEPTION_POINTERS* pExceptionPointers)
+#pragma warning restore CA1822 // Mark members as static
{
// This method is completely handled by the C++ wrapper to the JIT-EE interface,
// and should never reach the managed implementation.
@@ -2941,7 +2958,9 @@ namespace Internal.JitInterface
throw new NotSupportedException("FilterException");
}
+#pragma warning disable CA1822 // Mark members as static
private bool runWithErrorTrap(void* function, void* parameter)
+#pragma warning restore CA1822 // Mark members as static
{
// This method is completely handled by the C++ wrapper to the JIT-EE interface,
// and should never reach the managed implementation.
@@ -2949,7 +2968,9 @@ namespace Internal.JitInterface
throw new NotSupportedException("runWithErrorTrap");
}
+#pragma warning disable CA1822 // Mark members as static
private bool runWithSPMIErrorTrap(void* function, void* parameter)
+#pragma warning restore CA1822 // Mark members as static
{
// This method is completely handled by the C++ wrapper to the JIT-EE interface,
// and should never reach the managed implementation.
@@ -2970,7 +2991,7 @@ namespace Internal.JitInterface
private void getEEInfo(ref CORINFO_EE_INFO pEEInfoOut)
{
- pEEInfoOut = new CORINFO_EE_INFO();
+ pEEInfoOut = default(CORINFO_EE_INFO);
#if DEBUG
// In debug, write some bogus data to the struct to ensure we have filled everything
@@ -2997,7 +3018,9 @@ namespace Internal.JitInterface
pEEInfoOut.osType = TargetToOs(_compilation.NodeFactory.Target);
}
+#pragma warning disable CA1822 // Mark members as static
private char* getJitTimeLogFilename()
+#pragma warning restore CA1822 // Mark members as static
{
return null;
}
@@ -3048,14 +3071,13 @@ namespace Internal.JitInterface
return (byte*)GetPin(StringToUTF8(method.Name));
}
- private String getMethodNameFromMetadataImpl(MethodDesc method, out string className, out string namespaceName, out string enclosingClassName)
+ private static string getMethodNameFromMetadataImpl(MethodDesc method, out string className, out string namespaceName, out string enclosingClassName)
{
- string result = null;
className = null;
namespaceName = null;
enclosingClassName = null;
- result = method.Name;
+ string result = method.Name;
MetadataType owningType = method.OwningType as MetadataType;
if (owningType != null)
@@ -3148,7 +3170,9 @@ namespace Internal.JitInterface
private void getFunctionFixedEntryPoint(CORINFO_METHOD_STRUCT_* ftn, bool isUnsafeFunctionPointer, ref CORINFO_CONST_LOOKUP pResult)
{ throw new NotImplementedException("getFunctionFixedEntryPoint"); }
+#pragma warning disable CA1822 // Mark members as static
private CorInfoHelpFunc getLazyStringLiteralHelper(CORINFO_MODULE_STRUCT_* handle)
+#pragma warning restore CA1822 // Mark members as static
{
// TODO: Lazy string literal helper
return CorInfoHelpFunc.CORINFO_HELP_UNDEF;
@@ -3160,7 +3184,7 @@ namespace Internal.JitInterface
private CORINFO_FIELD_STRUCT_* embedFieldHandle(CORINFO_FIELD_STRUCT_* handle, ref void* ppIndirection)
{ throw new NotImplementedException("embedFieldHandle"); }
- private CORINFO_RUNTIME_LOOKUP_KIND GetGenericRuntimeLookupKind(MethodDesc method)
+ private static CORINFO_RUNTIME_LOOKUP_KIND GetGenericRuntimeLookupKind(MethodDesc method)
{
if (method.RequiresInstMethodDescArg())
return CORINFO_RUNTIME_LOOKUP_KIND.CORINFO_LOOKUP_METHODPARAM;
@@ -3191,7 +3215,9 @@ namespace Internal.JitInterface
private void* GetCookieForPInvokeCalliSig(CORINFO_SIG_INFO* szMetaSig, ref void* ppIndirection)
{ throw new NotImplementedException("GetCookieForPInvokeCalliSig"); }
+#pragma warning disable CA1822 // Mark members as static
private CORINFO_JUST_MY_CODE_HANDLE_* getJustMyCodeHandle(CORINFO_METHOD_STRUCT_* method, ref CORINFO_JUST_MY_CODE_HANDLE_* ppIndirection)
+#pragma warning restore CA1822 // Mark members as static
{
ppIndirection = null;
return null;
@@ -3204,7 +3230,7 @@ namespace Internal.JitInterface
/// </summary>
private CORINFO_CONST_LOOKUP CreateConstLookupToSymbol(ISymbolNode symbol)
{
- CORINFO_CONST_LOOKUP constLookup = new CORINFO_CONST_LOOKUP();
+ CORINFO_CONST_LOOKUP constLookup = default(CORINFO_CONST_LOOKUP);
constLookup.addr = (void*)ObjectToHandle(symbol);
constLookup.accessType = symbol.RepresentsIndirectionCell ? InfoAccessType.IAT_PVALUE : InfoAccessType.IAT_VALUE;
return constLookup;
@@ -3263,7 +3289,9 @@ namespace Internal.JitInterface
private void MethodCompileComplete(CORINFO_METHOD_STRUCT_* methHnd)
{ throw new NotImplementedException("MethodCompileComplete"); }
+#pragma warning disable CA1822 // Mark members as static
private bool getTailCallHelpers(ref CORINFO_RESOLVED_TOKEN callToken, CORINFO_SIG_INFO* sig, CORINFO_GET_TAILCALL_HELPERS_FLAGS flags, ref CORINFO_TAILCALL_HELPERS pResult)
+#pragma warning restore CA1822 // Mark members as static
{
// Slow tailcalls are not supported yet
// https://github.com/dotnet/runtime/issues/35423
@@ -3385,7 +3413,9 @@ namespace Internal.JitInterface
return (void*)GetPin(_gcInfo);
}
+#pragma warning disable CA1822 // Mark members as static
private bool logMsg(uint level, byte* fmt, IntPtr args)
+#pragma warning restore CA1822 // Mark members as static
{
// Console.WriteLine(Marshal.PtrToStringUTF8((IntPtr)fmt));
return false;
@@ -3399,13 +3429,17 @@ namespace Internal.JitInterface
return 1;
}
+#pragma warning disable CA1822 // Mark members as static
private void reportFatalError(CorJitResult result)
+#pragma warning restore CA1822 // Mark members as static
{
// We could add some logging here, but for now it's unnecessary.
// CompileMethod is going to fail with this CorJitResult anyway.
}
+#pragma warning disable CA1822 // Mark members as static
private void recordCallSite(uint instrOffset, CORINFO_SIG_INFO* callSig, CORINFO_METHOD_STRUCT_* methodHandle)
+#pragma warning restore CA1822 // Mark members as static
{
}
@@ -3607,13 +3641,13 @@ namespace Internal.JitInterface
switch (_compilation.TypeSystemContext.Target.Architecture)
{
case TargetArchitecture.X64:
- return (ushort)ILCompiler.DependencyAnalysis.RelocType.IMAGE_REL_BASED_REL32;
+ return (ushort)RelocType.IMAGE_REL_BASED_REL32;
case TargetArchitecture.ARM:
- return (ushort)ILCompiler.DependencyAnalysis.RelocType.IMAGE_REL_BASED_THUMB_BRANCH24;
+ return (ushort)RelocType.IMAGE_REL_BASED_THUMB_BRANCH24;
default:
- return UInt16.MaxValue;
+ return ushort.MaxValue;
}
}
@@ -3851,11 +3885,13 @@ namespace Internal.JitInterface
}
else
{
+#pragma warning disable SA1001, SA1113, SA1115 // Commas should be spaced correctly
ComputeJitPgoInstrumentationSchema(ObjectToHandle, pgoResultsSchemas, out var nativeSchemas, out var instrumentationData
#if !READYTORUN
, _compilation.CanConstructType
#endif
);
+#pragma warning restore SA1001, SA1113, SA1115 // Commas should be spaced correctly
pgoResults.pInstrumentationData = (byte*)GetPin(instrumentationData);
pgoResults.countSchemaItems = (uint)nativeSchemas.Length;
diff --git a/src/coreclr/tools/Common/JitInterface/CorInfoInstructionSet.cs b/src/coreclr/tools/Common/JitInterface/CorInfoInstructionSet.cs
index d903e7d6faf..78eec3e1297 100644
--- a/src/coreclr/tools/Common/JitInterface/CorInfoInstructionSet.cs
+++ b/src/coreclr/tools/Common/JitInterface/CorInfoInstructionSet.cs
@@ -5,11 +5,9 @@
// FROM /src/coreclr/tools/Common/JitInterface/ThunkGenerator/InstructionSetDesc.txt
// using /src/coreclr/tools/Common/JitInterface/ThunkGenerator/gen.bat
-using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
-using System.Runtime.InteropServices;
using Internal.TypeSystem;
namespace Internal.JitInterface
@@ -338,7 +336,7 @@ namespace Internal.JitInterface
public IEnumerator<InstructionSet> GetEnumerator()
{
- for (int i = 1; i < (int)InstructionSet.NONE; i ++)
+ for (int i = 1; i < (int)InstructionSet.NONE; i++)
{
InstructionSet instructionSet = (InstructionSet)i;
if (HasInstructionSet(instructionSet))
@@ -384,12 +382,12 @@ namespace Internal.JitInterface
public static InstructionSetFlags ExpandInstructionSetByImplicationHelper(TargetArchitecture architecture, InstructionSetFlags input)
{
- InstructionSetFlags oldflags = input;
+ InstructionSetFlags oldflags;
InstructionSetFlags resultflags = input;
do
{
oldflags = resultflags;
- switch(architecture)
+ switch (architecture)
{
case TargetArchitecture.ARM64:
@@ -619,7 +617,7 @@ namespace Internal.JitInterface
private static InstructionSetFlags ExpandInstructionSetByReverseImplicationHelper(TargetArchitecture architecture, InstructionSetFlags input)
{
- InstructionSetFlags oldflags = input;
+ InstructionSetFlags oldflags;
InstructionSetFlags resultflags = input;
do
{
diff --git a/src/coreclr/tools/Common/JitInterface/CorInfoTypes.VarInfo.cs b/src/coreclr/tools/Common/JitInterface/CorInfoTypes.VarInfo.cs
index ff85f537803..cd6d82f8f51 100644
--- a/src/coreclr/tools/Common/JitInterface/CorInfoTypes.VarInfo.cs
+++ b/src/coreclr/tools/Common/JitInterface/CorInfoTypes.VarInfo.cs
@@ -2,7 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
using System;
-using System.Diagnostics;
using System.Runtime.InteropServices;
//
diff --git a/src/coreclr/tools/Common/JitInterface/CorInfoTypes.cs b/src/coreclr/tools/Common/JitInterface/CorInfoTypes.cs
index 4d054a10744..66fac586cb3 100644
--- a/src/coreclr/tools/Common/JitInterface/CorInfoTypes.cs
+++ b/src/coreclr/tools/Common/JitInterface/CorInfoTypes.cs
@@ -5,7 +5,6 @@ using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using Internal.Pgo;
-using Internal.TypeSystem;
namespace Internal.JitInterface
{
@@ -889,10 +888,10 @@ namespace Internal.JitInterface
[StructLayout(LayoutKind.Sequential)]
public unsafe struct CORINFO_TAILCALL_HELPERS
{
- CORINFO_TAILCALL_HELPERS_FLAGS flags;
- CORINFO_METHOD_STRUCT_* hStoreArgs;
- CORINFO_METHOD_STRUCT_* hCallTarget;
- CORINFO_METHOD_STRUCT_* hDispatcher;
+ private CORINFO_TAILCALL_HELPERS_FLAGS flags;
+ private CORINFO_METHOD_STRUCT_* hStoreArgs;
+ private CORINFO_METHOD_STRUCT_* hCallTarget;
+ private CORINFO_METHOD_STRUCT_* hDispatcher;
};
public enum CORINFO_THIS_TRANSFORM
@@ -1432,7 +1431,7 @@ namespace Internal.JitInterface
public struct CORJIT_FLAGS
{
- private UInt64 _corJitFlags;
+ private ulong _corJitFlags;
public InstructionSetFlags InstructionSetFlags;
public void Reset()
diff --git a/src/coreclr/tools/Common/JitInterface/JitConfigProvider.cs b/src/coreclr/tools/Common/JitInterface/JitConfigProvider.cs
index 898ec59e5a5..2605d5489de 100644
--- a/src/coreclr/tools/Common/JitInterface/JitConfigProvider.cs
+++ b/src/coreclr/tools/Common/JitInterface/JitConfigProvider.cs
@@ -6,7 +6,6 @@ using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Threading;
-using ILCompiler;
using Internal.TypeSystem;
using NumberStyles = System.Globalization.NumberStyles;
@@ -79,7 +78,7 @@ namespace Internal.JitInterface
/// <param name="parameters">A collection of parameter name/value pairs.</param>
public JitConfigProvider(IEnumerable<CorJitFlag> jitFlags, IEnumerable<KeyValuePair<string, string>> parameters)
{
- ArrayBuilder<CorJitFlag> jitFlagBuilder = new ArrayBuilder<CorJitFlag>();
+ ArrayBuilder<CorJitFlag> jitFlagBuilder = default(ArrayBuilder<CorJitFlag>);
foreach (CorJitFlag jitFlag in jitFlags)
{
jitFlagBuilder.Add(jitFlag);
@@ -110,7 +109,7 @@ namespace Internal.JitInterface
string stringValue;
int intValue;
if (_config.TryGetValue(name, out stringValue) &&
- Int32.TryParse(stringValue, NumberStyles.AllowHexSpecifier, null, out intValue))
+ int.TryParse(stringValue, NumberStyles.AllowHexSpecifier, null, out intValue))
{
return intValue;
}
@@ -126,7 +125,7 @@ namespace Internal.JitInterface
return stringValue;
}
- return String.Empty;
+ return string.Empty;
}
private static string GetTargetSpec(TargetDetails target)
diff --git a/src/coreclr/tools/Common/JitInterface/LoongArch64PassStructInRegister.cs b/src/coreclr/tools/Common/JitInterface/LoongArch64PassStructInRegister.cs
index 0a164d23ebe..88125fe5bad 100644
--- a/src/coreclr/tools/Common/JitInterface/LoongArch64PassStructInRegister.cs
+++ b/src/coreclr/tools/Common/JitInterface/LoongArch64PassStructInRegister.cs
@@ -1,9 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
-using System.Collections.Generic;
using System.Diagnostics;
-using ILCompiler;
using Internal.TypeSystem;
namespace Internal.JitInterface
@@ -20,10 +18,7 @@ namespace Internal.JitInterface
{
if (!field.IsStatic)
{
- if (firstField == null)
- {
- firstField = field;
- }
+ firstField ??= field;
numIntroducedFields++;
}
}
@@ -95,7 +90,7 @@ namespace Internal.JitInterface
}
else if ((floatFieldFlags & (uint)StructFloatFieldInfoFlags.STRUCT_FLOAT_FIELD_FIRST) != 0)
{
- floatFieldFlags = floatFieldFlags ^ (uint)StructFloatFieldInfoFlags.STRUCT_MERGE_FIRST_SECOND_8;
+ floatFieldFlags ^= (uint)StructFloatFieldInfoFlags.STRUCT_MERGE_FIRST_SECOND_8;
}
else
{
diff --git a/src/coreclr/tools/Common/JitInterface/MemoryHelper.cs b/src/coreclr/tools/Common/JitInterface/MemoryHelper.cs
index ce7edb1e56b..ac009bcd17d 100644
--- a/src/coreclr/tools/Common/JitInterface/MemoryHelper.cs
+++ b/src/coreclr/tools/Common/JitInterface/MemoryHelper.cs
@@ -1,8 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-
namespace Internal.JitInterface
{
internal static unsafe class MemoryHelper
diff --git a/src/coreclr/tools/Common/JitInterface/SystemVStructClassificator.cs b/src/coreclr/tools/Common/JitInterface/SystemVStructClassificator.cs
index 1237cdb3dd3..e8c1a01f860 100644
--- a/src/coreclr/tools/Common/JitInterface/SystemVStructClassificator.cs
+++ b/src/coreclr/tools/Common/JitInterface/SystemVStructClassificator.cs
@@ -5,12 +5,11 @@ using System.Collections.Generic;
using System.Diagnostics;
using ILCompiler;
using Internal.TypeSystem;
+using static Internal.JitInterface.SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR;
+using static Internal.JitInterface.SystemVClassificationType;
namespace Internal.JitInterface
{
- using static SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR;
- using static SystemVClassificationType;
-
internal static class SystemVStructClassificator
{
private struct SystemVStructRegisterPassingHelper
@@ -65,7 +64,7 @@ namespace Internal.JitInterface
public int[] FieldOffsets;
};
- private class FieldEnumerator
+ private static class FieldEnumerator
{
internal static IEnumerable<FieldDesc> GetInstanceFields(TypeDesc typeDesc, bool isFixedBuffer, int numIntroducedFields)
{
@@ -167,7 +166,7 @@ namespace Internal.JitInterface
// If we have a field classification already, but there is a union, we must merge the classification type of the field. Returns the
// new, merged classification type.
- static SystemVClassificationType ReClassifyField(SystemVClassificationType originalClassification, SystemVClassificationType newFieldClassification)
+ private static SystemVClassificationType ReClassifyField(SystemVClassificationType originalClassification, SystemVClassificationType newFieldClassification)
{
Debug.Assert((newFieldClassification == SystemVClassificationTypeInteger) ||
(newFieldClassification == SystemVClassificationTypeIntegerReference) ||
@@ -226,10 +225,7 @@ namespace Internal.JitInterface
{
if (!field.IsStatic)
{
- if (firstField == null)
- {
- firstField = field;
- }
+ firstField ??= field;
numIntroducedFields++;
}
}
diff --git a/src/coreclr/tools/Common/JitInterface/ThunkGenerator/InstructionSetGenerator.cs b/src/coreclr/tools/Common/JitInterface/ThunkGenerator/InstructionSetGenerator.cs
index fb97127666e..97c4feb5cfb 100644
--- a/src/coreclr/tools/Common/JitInterface/ThunkGenerator/InstructionSetGenerator.cs
+++ b/src/coreclr/tools/Common/JitInterface/ThunkGenerator/InstructionSetGenerator.cs
@@ -375,11 +375,9 @@ namespace Internal.ReadyToRunConstants
// FROM /src/coreclr/tools/Common/JitInterface/ThunkGenerator/InstructionSetDesc.txt
// using /src/coreclr/tools/Common/JitInterface/ThunkGenerator/gen.bat
-using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
-using System.Runtime.InteropServices;
using Internal.TypeSystem;
namespace Internal.JitInterface
@@ -522,7 +520,7 @@ namespace Internal.JitInterface
public IEnumerator<InstructionSet> GetEnumerator()
{
- for (int i = 1; i < (int)InstructionSet.NONE; i ++)
+ for (int i = 1; i < (int)InstructionSet.NONE; i++)
{
InstructionSet instructionSet = (InstructionSet)i;
if (HasInstructionSet(instructionSet))
@@ -581,12 +579,12 @@ namespace Internal.JitInterface
public static InstructionSetFlags ExpandInstructionSetByImplicationHelper(TargetArchitecture architecture, InstructionSetFlags input)
{
- InstructionSetFlags oldflags = input;
+ InstructionSetFlags oldflags;
InstructionSetFlags resultflags = input;
do
{
oldflags = resultflags;
- switch(architecture)
+ switch (architecture)
{
");
foreach (string architecture in _architectures)
@@ -624,7 +622,7 @@ namespace Internal.JitInterface
private static InstructionSetFlags ExpandInstructionSetByReverseImplicationHelper(TargetArchitecture architecture, InstructionSetFlags input)
{
- InstructionSetFlags oldflags = input;
+ InstructionSetFlags oldflags;
InstructionSetFlags resultflags = input;
do
{
diff --git a/src/coreclr/tools/Common/JitInterface/ThunkGenerator/Program.cs b/src/coreclr/tools/Common/JitInterface/ThunkGenerator/Program.cs
index 5cd8cb6e66c..b0d12f06cdc 100644
--- a/src/coreclr/tools/Common/JitInterface/ThunkGenerator/Program.cs
+++ b/src/coreclr/tools/Common/JitInterface/ThunkGenerator/Program.cs
@@ -279,14 +279,14 @@ using System.Runtime.InteropServices;
namespace Internal.JitInterface
{
- unsafe partial class CorInfoImpl
+ internal unsafe partial class CorInfoImpl
{
");
foreach (FunctionDecl decl in functionData)
{
tw.WriteLine(" [UnmanagedCallersOnly]");
- tw.Write($" static {decl.ReturnType.UnmanagedTypeName} _{decl.FunctionName}(IntPtr thisHandle, IntPtr* ppException");
+ tw.Write($" private static {decl.ReturnType.UnmanagedTypeName} _{decl.FunctionName}(IntPtr thisHandle, IntPtr* ppException");
foreach (Parameter param in decl.Parameters)
{
tw.Write($", {param.Type.UnmanagedTypeName} {param.Name}");
@@ -344,7 +344,7 @@ namespace Internal.JitInterface
int total = functionData.Count();
tw.WriteLine(@"
- static IntPtr GetUnmanagedCallbacks()
+ private static IntPtr GetUnmanagedCallbacks()
{
void** callbacks = (void**)Marshal.AllocCoTaskMem(sizeof(IntPtr) * " + total + @");
");
diff --git a/src/coreclr/tools/Common/JitInterface/TypeString.cs b/src/coreclr/tools/Common/JitInterface/TypeString.cs
index db600843151..7bdb02e0810 100644
--- a/src/coreclr/tools/Common/JitInterface/TypeString.cs
+++ b/src/coreclr/tools/Common/JitInterface/TypeString.cs
@@ -10,7 +10,7 @@ namespace Internal.JitInterface
// This is a very rough equivalent of typestring.cpp in the CLR.
// There's way more rules to capture. Hopefully, we'll only ever need this in the code to recognize SIMD intrisics
// and we won't need to replicate all the details around escaping and such.
- internal class TypeString : TypeNameFormatter
+ internal sealed class TypeString : TypeNameFormatter
{
public static TypeString Instance { get; } = new TypeString();
@@ -29,7 +29,7 @@ namespace Internal.JitInterface
public override void AppendName(StringBuilder sb, SignatureTypeVariable type)
{
- sb.Append("!");
+ sb.Append('!');
sb.Append(type.Index);
}
@@ -59,7 +59,7 @@ namespace Internal.JitInterface
public override void AppendName(StringBuilder sb, ByRefType type)
{
AppendName(sb, type.ParameterType);
- sb.Append("&");
+ sb.Append('&');
}
public override void AppendName(StringBuilder sb, ArrayType type)
diff --git a/src/coreclr/tools/Common/JitInterface/UnboxingMethodDesc.cs b/src/coreclr/tools/Common/JitInterface/UnboxingMethodDesc.cs
index 0db82ff37eb..e21794718c8 100644
--- a/src/coreclr/tools/Common/JitInterface/UnboxingMethodDesc.cs
+++ b/src/coreclr/tools/Common/JitInterface/UnboxingMethodDesc.cs
@@ -2,7 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
using System;
-using System.Collections.Generic;
using System.Diagnostics;
using Internal.TypeSystem;
@@ -13,7 +12,7 @@ namespace Internal.JitInterface
/// This class is for internal purposes within the JitInterface. It's not expected
/// for it to escape the JitInterface.
/// </summary>
- internal class UnboxingMethodDesc : MethodDelegator
+ internal sealed class UnboxingMethodDesc : MethodDelegator
{
private readonly UnboxingMethodDescFactory _factory;
diff --git a/src/coreclr/tools/Common/JitInterface/UnboxingMethodDescFactory.cs b/src/coreclr/tools/Common/JitInterface/UnboxingMethodDescFactory.cs
index 4f38998f5cb..457f2fa8725 100644
--- a/src/coreclr/tools/Common/JitInterface/UnboxingMethodDescFactory.cs
+++ b/src/coreclr/tools/Common/JitInterface/UnboxingMethodDescFactory.cs
@@ -1,14 +1,12 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
using System.Collections.Generic;
-using System.Diagnostics;
using Internal.TypeSystem;
namespace Internal.JitInterface
{
- internal class UnboxingMethodDescFactory : Dictionary<MethodDesc, UnboxingMethodDesc>
+ internal sealed class UnboxingMethodDescFactory : Dictionary<MethodDesc, UnboxingMethodDesc>
{
public UnboxingMethodDesc GetUnboxingMethod(MethodDesc method)
{
diff --git a/src/coreclr/tools/Common/Pgo/PgoFormat.cs b/src/coreclr/tools/Common/Pgo/PgoFormat.cs
index 5dc847b3481..fa4fe3c1a31 100644
--- a/src/coreclr/tools/Common/Pgo/PgoFormat.cs
+++ b/src/coreclr/tools/Common/Pgo/PgoFormat.cs
@@ -5,8 +5,6 @@ using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
-using System.Text.RegularExpressions;
-using ILCompiler;
namespace Internal.Pgo
{
@@ -113,8 +111,8 @@ namespace Internal.Pgo
public class PgoEncodedCompressedIntParser : IEnumerable<long>, IEnumerator<long>
{
- long _current;
- byte[] _bytes;
+ private long _current;
+ private byte[] _bytes;
public PgoEncodedCompressedIntParser(byte[] bytes, int startOffset)
{
@@ -319,7 +317,7 @@ namespace Internal.Pgo
else
curSchema.ILOffset = checked((int)value);
- processingState = processingState & ~InstrumentationDataProcessingState.ILOffset;
+ processingState &= ~InstrumentationDataProcessingState.ILOffset;
}
else if ((processingState & InstrumentationDataProcessingState.Type) == InstrumentationDataProcessingState.Type)
{
@@ -328,7 +326,7 @@ namespace Internal.Pgo
else
curSchema.InstrumentationKind = (PgoInstrumentationKind)value;
- processingState = processingState & ~InstrumentationDataProcessingState.Type;
+ processingState &= ~InstrumentationDataProcessingState.Type;
}
else if ((processingState & InstrumentationDataProcessingState.Count) == InstrumentationDataProcessingState.Count)
{
@@ -336,7 +334,7 @@ namespace Internal.Pgo
curSchema.Count = checked((int)(value + (long)curSchema.Count));
else
curSchema.Count = checked((int)value);
- processingState = processingState & ~InstrumentationDataProcessingState.Count;
+ processingState &= ~InstrumentationDataProcessingState.Count;
}
else if ((processingState & InstrumentationDataProcessingState.Other) == InstrumentationDataProcessingState.Other)
{
@@ -344,7 +342,7 @@ namespace Internal.Pgo
curSchema.Other = checked((int)(value + (long)curSchema.Other));
else
curSchema.Other = checked((int)value);
- processingState = processingState & ~InstrumentationDataProcessingState.Other;
+ processingState &= ~InstrumentationDataProcessingState.Other;
}
if (processingState == InstrumentationDataProcessingState.Done)
@@ -412,13 +410,13 @@ namespace Internal.Pgo
if (!emitAllElementsUnconditionally)
{
if (ilOffsetDiff != 0)
- modifyMask = modifyMask | InstrumentationDataProcessingState.ILOffset;
+ modifyMask |= InstrumentationDataProcessingState.ILOffset;
if (TypeDiff != 0)
- modifyMask = modifyMask | InstrumentationDataProcessingState.Type;
+ modifyMask |= InstrumentationDataProcessingState.Type;
if (CountDiff != 0)
- modifyMask = modifyMask | InstrumentationDataProcessingState.Count;
+ modifyMask |= InstrumentationDataProcessingState.Count;
if (OtherDiff != 0)
- modifyMask = modifyMask | InstrumentationDataProcessingState.Other;
+ modifyMask |= InstrumentationDataProcessingState.Other;
}
else
{
@@ -511,7 +509,7 @@ namespace Internal.Pgo
}
- private class PgoSchemaMergeComparer : IComparer<PgoSchemaElem>, IEqualityComparer<PgoSchemaElem>
+ private sealed class PgoSchemaMergeComparer : IComparer<PgoSchemaElem>, IEqualityComparer<PgoSchemaElem>
{
public static PgoSchemaMergeComparer Singleton = new PgoSchemaMergeComparer();
@@ -563,7 +561,7 @@ namespace Internal.Pgo
if (!foundNumRuns)
{
- PgoSchemaElem oneRunSchema = new PgoSchemaElem();
+ PgoSchemaElem oneRunSchema = default(PgoSchemaElem);
oneRunSchema.InstrumentationKind = PgoInstrumentationKind.NumRuns;
oneRunSchema.ILOffset = 0;
oneRunSchema.Other = 1;
@@ -578,7 +576,7 @@ namespace Internal.Pgo
return result;
}
- void MergeInSchemaElem(Dictionary<PgoSchemaElem, PgoSchemaElem> dataMerger, PgoSchemaElem schema)
+ static void MergeInSchemaElem(Dictionary<PgoSchemaElem, PgoSchemaElem> dataMerger, PgoSchemaElem schema)
{
if (dataMerger.TryGetValue(schema, out var existingSchemaItem))
{
@@ -648,7 +646,7 @@ namespace Internal.Pgo
}
Debug.Assert(PgoSchemaMergeComparer.Singleton.Compare(schema, mergedElem) == 0);
- Debug.Assert(PgoSchemaMergeComparer.Singleton.Equals(schema, mergedElem) == true);
+ Debug.Assert(PgoSchemaMergeComparer.Singleton.Equals(schema, mergedElem));
dataMerger[mergedElem] = mergedElem;
}
else
diff --git a/src/coreclr/tools/Common/Pgo/TypeSystemEntityOrUnknown.cs b/src/coreclr/tools/Common/Pgo/TypeSystemEntityOrUnknown.cs
index 6eabe55cf7c..2a064ebf032 100644
--- a/src/coreclr/tools/Common/Pgo/TypeSystemEntityOrUnknown.cs
+++ b/src/coreclr/tools/Common/Pgo/TypeSystemEntityOrUnknown.cs
@@ -23,7 +23,7 @@ namespace Internal.Pgo
_data = method;
}
- readonly object _data;
+ private readonly object _data;
public TypeDesc AsType => _data as TypeDesc;
public MethodDesc AsMethod => _data as MethodDesc;
public FieldDesc AsField => _data as FieldDesc;
@@ -39,7 +39,7 @@ namespace Internal.Pgo
}
else
{
- return object.ReferenceEquals(_data, other._data);
+ return ReferenceEquals(_data, other._data);
}
}
diff --git a/src/coreclr/tools/Common/Sorting/ISortableDataStructureAccessor.cs b/src/coreclr/tools/Common/Sorting/ISortableDataStructureAccessor.cs
index e6699d4d0fe..c2ec9f24b84 100644
--- a/src/coreclr/tools/Common/Sorting/ISortableDataStructureAccessor.cs
+++ b/src/coreclr/tools/Common/Sorting/ISortableDataStructureAccessor.cs
@@ -1,10 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-using System.Collections.Generic;
-using System.Threading.Tasks;
-
namespace ILCompiler
{
internal interface ISortableDataStructureAccessor<T, TDataStructure>
diff --git a/src/coreclr/tools/Common/Sorting/ListAccessor.cs b/src/coreclr/tools/Common/Sorting/ListAccessor.cs
index 962bd3f38a0..f26f1ff5aca 100644
--- a/src/coreclr/tools/Common/Sorting/ListAccessor.cs
+++ b/src/coreclr/tools/Common/Sorting/ListAccessor.cs
@@ -1,7 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
using System.Collections.Generic;
namespace ILCompiler.Sorting.Implementation
diff --git a/src/coreclr/tools/Common/Sorting/MergeSort.cs b/src/coreclr/tools/Common/Sorting/MergeSort.cs
index cbf5d1da814..7faf01aeafb 100644
--- a/src/coreclr/tools/Common/Sorting/MergeSort.cs
+++ b/src/coreclr/tools/Common/Sorting/MergeSort.cs
@@ -61,7 +61,7 @@ namespace ILCompiler
// Internal helper struct used to enable use of Comparison<T> delegates instead of IComparer<T> instances
private struct ComparisonWrapper<T> : IComparer<T>
{
- Comparison<T> _comparison;
+ private Comparison<T> _comparison;
public ComparisonWrapper(Comparison<T> comparison)
{
_comparison = comparison;
diff --git a/src/coreclr/tools/Common/Sorting/MergeSortCore.cs b/src/coreclr/tools/Common/Sorting/MergeSortCore.cs
index 6998c997379..b69e733d3aa 100644
--- a/src/coreclr/tools/Common/Sorting/MergeSortCore.cs
+++ b/src/coreclr/tools/Common/Sorting/MergeSortCore.cs
@@ -1,7 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
using System.Collections.Generic;
using System.Threading.Tasks;
@@ -44,8 +43,8 @@ namespace ILCompiler.Sorting.Implementation
T[] localCopyOfHalfOfArray = new T[halfLen];
accessor.Copy(arrayToSort, index, localCopyOfHalfOfArray, 0, halfLen);
- await MergeSortCore<T, T[], ArrayAccessor<T>, TComparer, TCompareAsEqualAction>.ParallelSort(localCopyOfHalfOfArray, 0, halfLen, comparer);
- await rightSortTask;
+ await MergeSortCore<T, T[], ArrayAccessor<T>, TComparer, TCompareAsEqualAction>.ParallelSort(localCopyOfHalfOfArray, 0, halfLen, comparer).ConfigureAwait(true);
+ await rightSortTask.ConfigureAwait(true);
Merge(localCopyOfHalfOfArray, arrayToSort, index, halfLen, length, comparer);
}
}
diff --git a/src/coreclr/tools/Common/TypeSystem/Canon/ArrayType.Canon.cs b/src/coreclr/tools/Common/TypeSystem/Canon/ArrayType.Canon.cs
index 7deba06d193..5689f610185 100644
--- a/src/coreclr/tools/Common/TypeSystem/Canon/ArrayType.Canon.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Canon/ArrayType.Canon.cs
@@ -4,7 +4,7 @@
namespace Internal.TypeSystem
{
// Implements canonicalization for arrays
- partial class ArrayType
+ public partial class ArrayType
{
protected override TypeDesc ConvertToCanonFormImpl(CanonicalFormKind kind)
{
@@ -21,7 +21,7 @@ namespace Internal.TypeSystem
}
// Implements canonicalization for array methods
- partial class ArrayMethod
+ public partial class ArrayMethod
{
public override bool IsCanonicalMethod(CanonicalFormKind policy)
{
diff --git a/src/coreclr/tools/Common/TypeSystem/Canon/ByRefType.Canon.cs b/src/coreclr/tools/Common/TypeSystem/Canon/ByRefType.Canon.cs
index 97513cb08e4..53c01d00bbe 100644
--- a/src/coreclr/tools/Common/TypeSystem/Canon/ByRefType.Canon.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Canon/ByRefType.Canon.cs
@@ -4,7 +4,7 @@
namespace Internal.TypeSystem
{
// Implements canonicalizing ByRefs
- partial class ByRefType
+ public partial class ByRefType
{
protected override TypeDesc ConvertToCanonFormImpl(CanonicalFormKind kind)
{
diff --git a/src/coreclr/tools/Common/TypeSystem/Canon/CanonTypes.Diagnostic.cs b/src/coreclr/tools/Common/TypeSystem/Canon/CanonTypes.Diagnostic.cs
index d8906a8a7df..2a6843397b6 100644
--- a/src/coreclr/tools/Common/TypeSystem/Canon/CanonTypes.Diagnostic.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Canon/CanonTypes.Diagnostic.cs
@@ -1,13 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-using System.Collections.Generic;
-
-using Internal.NativeFormat;
-
-using Debug = System.Diagnostics.Debug;
-
namespace Internal.TypeSystem
{
internal sealed partial class CanonType
diff --git a/src/coreclr/tools/Common/TypeSystem/Canon/CanonTypes.Interop.cs b/src/coreclr/tools/Common/TypeSystem/Canon/CanonTypes.Interop.cs
index c5e1e39bc97..6897279ac03 100644
--- a/src/coreclr/tools/Common/TypeSystem/Canon/CanonTypes.Interop.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Canon/CanonTypes.Interop.cs
@@ -3,7 +3,7 @@
namespace Internal.TypeSystem
{
- partial class CanonBaseType
+ public partial class CanonBaseType
{
public override PInvokeStringFormat PInvokeStringFormat => default(PInvokeStringFormat);
}
diff --git a/src/coreclr/tools/Common/TypeSystem/Canon/CanonTypes.Sorting.cs b/src/coreclr/tools/Common/TypeSystem/Canon/CanonTypes.Sorting.cs
index 8646ad432b4..32e4db3bab9 100644
--- a/src/coreclr/tools/Common/TypeSystem/Canon/CanonTypes.Sorting.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Canon/CanonTypes.Sorting.cs
@@ -6,7 +6,7 @@ using Debug = System.Diagnostics.Debug;
namespace Internal.TypeSystem
{
// Functionality related to deterministic ordering of types
- partial class CanonBaseType
+ public partial class CanonBaseType
{
protected internal sealed override int CompareToImpl(TypeDesc other, TypeSystemComparer comparer)
{
@@ -16,12 +16,12 @@ namespace Internal.TypeSystem
}
}
- partial class CanonType
+ internal partial class CanonType
{
protected internal override int ClassCode => 46114331;
}
- partial class UniversalCanonType
+ internal partial class UniversalCanonType
{
protected internal override int ClassCode => 1687626054;
}
diff --git a/src/coreclr/tools/Common/TypeSystem/Canon/DefType.Canon.cs b/src/coreclr/tools/Common/TypeSystem/Canon/DefType.Canon.cs
index 3d783352c18..7c959d1c3a6 100644
--- a/src/coreclr/tools/Common/TypeSystem/Canon/DefType.Canon.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Canon/DefType.Canon.cs
@@ -4,7 +4,7 @@
namespace Internal.TypeSystem
{
// Implements canonicalization handling for TypeDefs
- partial class DefType
+ public partial class DefType
{
protected override TypeDesc ConvertToCanonFormImpl(CanonicalFormKind kind)
{
diff --git a/src/coreclr/tools/Common/TypeSystem/Canon/FunctionPointerType.Canon.cs b/src/coreclr/tools/Common/TypeSystem/Canon/FunctionPointerType.Canon.cs
index 8ff4c2ee544..ce0f96f7990 100644
--- a/src/coreclr/tools/Common/TypeSystem/Canon/FunctionPointerType.Canon.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Canon/FunctionPointerType.Canon.cs
@@ -1,12 +1,10 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-
namespace Internal.TypeSystem
{
// Holds code for canonicalizing a function pointer type
- partial class FunctionPointerType
+ public partial class FunctionPointerType
{
public override bool IsCanonicalSubtype(CanonicalFormKind policy)
{
diff --git a/src/coreclr/tools/Common/TypeSystem/Canon/InstantiatedMethod.Canon.cs b/src/coreclr/tools/Common/TypeSystem/Canon/InstantiatedMethod.Canon.cs
index 263615253fa..a5cb3efa1cb 100644
--- a/src/coreclr/tools/Common/TypeSystem/Canon/InstantiatedMethod.Canon.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Canon/InstantiatedMethod.Canon.cs
@@ -6,14 +6,14 @@ using Debug = System.Diagnostics.Debug;
namespace Internal.TypeSystem
{
// Implements generic method canonicalization
- partial class InstantiatedMethod
+ public partial class InstantiatedMethod
{
/// <summary>
/// Stores a cached version of the canonicalized form of this method since
/// calculating it is a recursive operation
/// </summary>
- InstantiatedMethod _specificCanonCache;
- InstantiatedMethod _universalCanonCache;
+ private InstantiatedMethod _specificCanonCache;
+ private InstantiatedMethod _universalCanonCache;
/// <summary>
/// Returns the result of canonicalizing this method over the given kind of Canon
@@ -52,7 +52,7 @@ namespace Internal.TypeSystem
return canonicalMethodResult;
}
- InstantiatedMethod GetCachedCanonValue(CanonicalFormKind kind)
+ private InstantiatedMethod GetCachedCanonValue(CanonicalFormKind kind)
{
switch (kind)
{
@@ -68,7 +68,7 @@ namespace Internal.TypeSystem
}
}
- void SetCachedCanonValue(CanonicalFormKind kind, InstantiatedMethod value)
+ private void SetCachedCanonValue(CanonicalFormKind kind, InstantiatedMethod value)
{
switch (kind)
{
diff --git a/src/coreclr/tools/Common/TypeSystem/Canon/InstantiatedType.Canon.cs b/src/coreclr/tools/Common/TypeSystem/Canon/InstantiatedType.Canon.cs
index 5bbbffc42f9..d57b2e19f9b 100644
--- a/src/coreclr/tools/Common/TypeSystem/Canon/InstantiatedType.Canon.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Canon/InstantiatedType.Canon.cs
@@ -4,7 +4,7 @@
namespace Internal.TypeSystem
{
// Implements canonicalization for generic instantiations
- partial class InstantiatedType
+ public partial class InstantiatedType
{
public override bool IsCanonicalSubtype(CanonicalFormKind policy)
{
diff --git a/src/coreclr/tools/Common/TypeSystem/Canon/MetadataType.Canon.cs b/src/coreclr/tools/Common/TypeSystem/Canon/MetadataType.Canon.cs
index 2d9d4d45e10..77637916470 100644
--- a/src/coreclr/tools/Common/TypeSystem/Canon/MetadataType.Canon.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Canon/MetadataType.Canon.cs
@@ -4,7 +4,7 @@
namespace Internal.TypeSystem
{
// Holds code for canonicalization of metadata types
- partial class MetadataType
+ public partial class MetadataType
{
public override bool IsCanonicalSubtype(CanonicalFormKind policy)
{
diff --git a/src/coreclr/tools/Common/TypeSystem/Canon/MethodDelegator.Canon.cs b/src/coreclr/tools/Common/TypeSystem/Canon/MethodDelegator.Canon.cs
index 9b89c40353e..e4e5211d08a 100644
--- a/src/coreclr/tools/Common/TypeSystem/Canon/MethodDelegator.Canon.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Canon/MethodDelegator.Canon.cs
@@ -3,7 +3,7 @@
namespace Internal.TypeSystem
{
- partial class MethodDelegator
+ public partial class MethodDelegator
{
public override bool IsCanonicalMethod(CanonicalFormKind policy)
{
diff --git a/src/coreclr/tools/Common/TypeSystem/Canon/MethodDesc.Canon.cs b/src/coreclr/tools/Common/TypeSystem/Canon/MethodDesc.Canon.cs
index 0189311657e..00e0d6859ff 100644
--- a/src/coreclr/tools/Common/TypeSystem/Canon/MethodDesc.Canon.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Canon/MethodDesc.Canon.cs
@@ -4,7 +4,7 @@
namespace Internal.TypeSystem
{
// Implements method canonicalization
- partial class MethodDesc
+ public partial class MethodDesc
{
public virtual bool IsCanonicalMethod(CanonicalFormKind policy)
{
diff --git a/src/coreclr/tools/Common/TypeSystem/Canon/MethodForInstantiatedType.Canon.cs b/src/coreclr/tools/Common/TypeSystem/Canon/MethodForInstantiatedType.Canon.cs
index ec81730a0a8..2125dd63c19 100644
--- a/src/coreclr/tools/Common/TypeSystem/Canon/MethodForInstantiatedType.Canon.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Canon/MethodForInstantiatedType.Canon.cs
@@ -4,7 +4,7 @@
namespace Internal.TypeSystem
{
// Implements canonicalization for methods on instantiated types
- partial class MethodForInstantiatedType
+ public partial class MethodForInstantiatedType
{
public override bool IsCanonicalMethod(CanonicalFormKind policy)
{
diff --git a/src/coreclr/tools/Common/TypeSystem/Canon/ParameterizedType.Canon.cs b/src/coreclr/tools/Common/TypeSystem/Canon/ParameterizedType.Canon.cs
index a66eeb39d88..774c1ce60f2 100644
--- a/src/coreclr/tools/Common/TypeSystem/Canon/ParameterizedType.Canon.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Canon/ParameterizedType.Canon.cs
@@ -4,7 +4,7 @@
namespace Internal.TypeSystem
{
// Holds code for canonicalizing a parameterized type
- partial class ParameterizedType
+ public partial class ParameterizedType
{
public sealed override bool IsCanonicalSubtype(CanonicalFormKind policy)
{
diff --git a/src/coreclr/tools/Common/TypeSystem/Canon/PointerType.Canon.cs b/src/coreclr/tools/Common/TypeSystem/Canon/PointerType.Canon.cs
index 28e35a96a2c..f3dee20511c 100644
--- a/src/coreclr/tools/Common/TypeSystem/Canon/PointerType.Canon.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Canon/PointerType.Canon.cs
@@ -4,7 +4,7 @@
namespace Internal.TypeSystem
{
// Holds code for canonicalizing pointers
- partial class PointerType
+ public partial class PointerType
{
protected override TypeDesc ConvertToCanonFormImpl(CanonicalFormKind kind)
{
diff --git a/src/coreclr/tools/Common/TypeSystem/Canon/SignatureVariable.Canon.cs b/src/coreclr/tools/Common/TypeSystem/Canon/SignatureVariable.Canon.cs
index 2e76e9eed06..d6675b5d4f7 100644
--- a/src/coreclr/tools/Common/TypeSystem/Canon/SignatureVariable.Canon.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Canon/SignatureVariable.Canon.cs
@@ -6,7 +6,7 @@ using Debug = System.Diagnostics.Debug;
namespace Internal.TypeSystem
{
// Implements canonicalization of generic type parameters
- partial class SignatureTypeVariable
+ public partial class SignatureTypeVariable
{
public override bool IsCanonicalSubtype(CanonicalFormKind policy)
{
@@ -22,7 +22,7 @@ namespace Internal.TypeSystem
}
// Implements canonicalization of generic method parameters
- partial class SignatureMethodVariable
+ public partial class SignatureMethodVariable
{
public override bool IsCanonicalSubtype(CanonicalFormKind policy)
{
diff --git a/src/coreclr/tools/Common/TypeSystem/Canon/TypeDesc.Canon.cs b/src/coreclr/tools/Common/TypeSystem/Canon/TypeDesc.Canon.cs
index c0ce80263aa..0fbd5ecbbbb 100644
--- a/src/coreclr/tools/Common/TypeSystem/Canon/TypeDesc.Canon.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Canon/TypeDesc.Canon.cs
@@ -6,15 +6,16 @@ using Debug = System.Diagnostics.Debug;
namespace Internal.TypeSystem
{
// Implements canonicalization for types
- partial class TypeDesc
+ public partial class TypeDesc
{
/// <summary>
/// Stores a cached version of the canonicalized form of this type since
/// calculating it is a recursive operation
/// </summary>
- TypeDesc _specificCanonCache;
- TypeDesc _universalCanonCache;
- TypeDesc GetCachedCanonValue(CanonicalFormKind kind)
+ private TypeDesc _specificCanonCache;
+ private TypeDesc _universalCanonCache;
+
+ private TypeDesc GetCachedCanonValue(CanonicalFormKind kind)
{
switch (kind)
{
@@ -30,7 +31,7 @@ namespace Internal.TypeSystem
}
}
- void SetCachedCanonValue(CanonicalFormKind kind, TypeDesc value)
+ private void SetCachedCanonValue(CanonicalFormKind kind, TypeDesc value)
{
switch (kind)
{
diff --git a/src/coreclr/tools/Common/TypeSystem/CodeGen/FieldDesc.CodeGen.cs b/src/coreclr/tools/Common/TypeSystem/CodeGen/FieldDesc.CodeGen.cs
index 43f05e4d85f..fa4f3bf017c 100644
--- a/src/coreclr/tools/Common/TypeSystem/CodeGen/FieldDesc.CodeGen.cs
+++ b/src/coreclr/tools/Common/TypeSystem/CodeGen/FieldDesc.CodeGen.cs
@@ -4,7 +4,7 @@
namespace Internal.TypeSystem
{
// Additional members of FieldDesc related to code generation.
- partial class FieldDesc
+ public partial class FieldDesc
{
/// <summary>
/// Gets a value indicating whether this is a field that needs to be treated
@@ -19,7 +19,7 @@ namespace Internal.TypeSystem
}
}
- partial class FieldForInstantiatedType
+ public partial class FieldForInstantiatedType
{
public override bool IsIntrinsic
{
diff --git a/src/coreclr/tools/Common/TypeSystem/CodeGen/MethodDelegator.CodeGen.cs b/src/coreclr/tools/Common/TypeSystem/CodeGen/MethodDelegator.CodeGen.cs
index 41425033e5b..0e1734043dd 100644
--- a/src/coreclr/tools/Common/TypeSystem/CodeGen/MethodDelegator.CodeGen.cs
+++ b/src/coreclr/tools/Common/TypeSystem/CodeGen/MethodDelegator.CodeGen.cs
@@ -3,7 +3,7 @@
namespace Internal.TypeSystem
{
- partial class MethodDelegator
+ public partial class MethodDelegator
{
public override bool IsIntrinsic
{
diff --git a/src/coreclr/tools/Common/TypeSystem/CodeGen/NativeStructType.CodeGen.cs b/src/coreclr/tools/Common/TypeSystem/CodeGen/NativeStructType.CodeGen.cs
index 320b8de11b0..0e4d9286735 100644
--- a/src/coreclr/tools/Common/TypeSystem/CodeGen/NativeStructType.CodeGen.cs
+++ b/src/coreclr/tools/Common/TypeSystem/CodeGen/NativeStructType.CodeGen.cs
@@ -4,7 +4,7 @@
namespace Internal.TypeSystem.Interop
{
// Implements INonEmittableType
- partial class NativeStructType : INonEmittableType
+ public partial class NativeStructType : INonEmittableType
{
}
}
diff --git a/src/coreclr/tools/Common/TypeSystem/CodeGen/TargetDetails.CodeGen.cs b/src/coreclr/tools/Common/TypeSystem/CodeGen/TargetDetails.CodeGen.cs
index f24974c811b..353399eb78b 100644
--- a/src/coreclr/tools/Common/TypeSystem/CodeGen/TargetDetails.CodeGen.cs
+++ b/src/coreclr/tools/Common/TypeSystem/CodeGen/TargetDetails.CodeGen.cs
@@ -4,7 +4,7 @@
namespace Internal.TypeSystem
{
// Extension to TargetDetails related to code generation
- partial class TargetDetails
+ public partial class TargetDetails
{
public TargetDetails(TargetArchitecture architecture, TargetOS targetOS, TargetAbi abi, SimdVectorLength simdVectorLength)
: this(architecture, targetOS, abi)
diff --git a/src/coreclr/tools/Common/TypeSystem/CodeGen/TypeDesc.CodeGen.cs b/src/coreclr/tools/Common/TypeSystem/CodeGen/TypeDesc.CodeGen.cs
index eb15a3681d5..860285c10f2 100644
--- a/src/coreclr/tools/Common/TypeSystem/CodeGen/TypeDesc.CodeGen.cs
+++ b/src/coreclr/tools/Common/TypeSystem/CodeGen/TypeDesc.CodeGen.cs
@@ -3,7 +3,7 @@
namespace Internal.TypeSystem
{
- partial class TypeDesc
+ public partial class TypeDesc
{
/// <summary>
/// Gets a value indicating whether this is a type that needs to be treated
@@ -18,7 +18,7 @@ namespace Internal.TypeSystem
}
}
- partial class InstantiatedType
+ public partial class InstantiatedType
{
partial void AddComputedIntrinsicFlag(ref TypeFlags flags)
{
diff --git a/src/coreclr/tools/Common/TypeSystem/Common/ArrayOfTRuntimeInterfacesAlgorithm.cs b/src/coreclr/tools/Common/TypeSystem/Common/ArrayOfTRuntimeInterfacesAlgorithm.cs
index 0e6328904c7..26aca253451 100644
--- a/src/coreclr/tools/Common/TypeSystem/Common/ArrayOfTRuntimeInterfacesAlgorithm.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Common/ArrayOfTRuntimeInterfacesAlgorithm.cs
@@ -1,7 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
using Debug = System.Diagnostics.Debug;
namespace Internal.TypeSystem
diff --git a/src/coreclr/tools/Common/TypeSystem/Common/ArrayType.cs b/src/coreclr/tools/Common/TypeSystem/Common/ArrayType.cs
index c21ba9342e1..dc1fc9667fa 100644
--- a/src/coreclr/tools/Common/TypeSystem/Common/ArrayType.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Common/ArrayType.cs
@@ -1,7 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
using System.Collections.Generic;
using System.Threading;
diff --git a/src/coreclr/tools/Common/TypeSystem/Common/BaseTypeRuntimeInterfacesAlgorithm.cs b/src/coreclr/tools/Common/TypeSystem/Common/BaseTypeRuntimeInterfacesAlgorithm.cs
index 41ff1102a8e..0835048af5f 100644
--- a/src/coreclr/tools/Common/TypeSystem/Common/BaseTypeRuntimeInterfacesAlgorithm.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Common/BaseTypeRuntimeInterfacesAlgorithm.cs
@@ -1,9 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-using Debug = System.Diagnostics.Debug;
-
namespace Internal.TypeSystem
{
/// <summary>
diff --git a/src/coreclr/tools/Common/TypeSystem/Common/CastingHelper.cs b/src/coreclr/tools/Common/TypeSystem/Common/CastingHelper.cs
index 51ed0327c34..d0f32078e97 100644
--- a/src/coreclr/tools/Common/TypeSystem/Common/CastingHelper.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Common/CastingHelper.cs
@@ -1,8 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-
using Debug = System.Diagnostics.Debug;
namespace Internal.TypeSystem
@@ -535,7 +533,7 @@ namespace Internal.TypeSystem
return false;
}
- private class StackOverflowProtect
+ private sealed class StackOverflowProtect
{
private CastingPair _value;
private StackOverflowProtect _previous;
diff --git a/src/coreclr/tools/Common/TypeSystem/Common/ConstructedTypeRewritingHelpers.cs b/src/coreclr/tools/Common/TypeSystem/Common/ConstructedTypeRewritingHelpers.cs
index 42011765c37..41e119bae68 100644
--- a/src/coreclr/tools/Common/TypeSystem/Common/ConstructedTypeRewritingHelpers.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Common/ConstructedTypeRewritingHelpers.cs
@@ -2,7 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
using System;
-using System.Collections.Generic;
using System.Diagnostics;
namespace Internal.TypeSystem
diff --git a/src/coreclr/tools/Common/TypeSystem/Common/DefType.Diagnostic.cs b/src/coreclr/tools/Common/TypeSystem/Common/DefType.Diagnostic.cs
index 26685ff43b2..d1dc3c659ee 100644
--- a/src/coreclr/tools/Common/TypeSystem/Common/DefType.Diagnostic.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Common/DefType.Diagnostic.cs
@@ -1,15 +1,13 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System.Collections.Generic;
-
namespace Internal.TypeSystem
{
/// <summary>
/// Type with metadata available that is equivalent to a TypeDef record in an ECMA 335 metadata stream.
/// A class, an interface, or a value type.
/// </summary>
- abstract partial class DefType
+ public abstract partial class DefType
{
/// <summary>
/// Gets the Name of a type. This must not throw
diff --git a/src/coreclr/tools/Common/TypeSystem/Common/DefType.FieldLayout.cs b/src/coreclr/tools/Common/TypeSystem/Common/DefType.FieldLayout.cs
index 4c3555c198a..99305804f53 100644
--- a/src/coreclr/tools/Common/TypeSystem/Common/DefType.FieldLayout.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Common/DefType.FieldLayout.cs
@@ -75,7 +75,7 @@ namespace Internal.TypeSystem
public const int IsInt128OrHasInt128Fields = 0x800;
}
- private class StaticBlockInfo
+ private sealed class StaticBlockInfo
{
public StaticsBlock NonGcStatics;
public StaticsBlock GcStatics;
@@ -83,17 +83,15 @@ namespace Internal.TypeSystem
public StaticsBlock ThreadGcStatics;
}
- ThreadSafeFlags _fieldLayoutFlags;
-
- LayoutInt _instanceFieldSize;
- LayoutInt _instanceFieldAlignment;
- LayoutInt _instanceByteCountUnaligned;
- LayoutInt _instanceByteAlignment;
+ private ThreadSafeFlags _fieldLayoutFlags;
+ private LayoutInt _instanceFieldSize;
+ private LayoutInt _instanceFieldAlignment;
+ private LayoutInt _instanceByteCountUnaligned;
+ private LayoutInt _instanceByteAlignment;
// Information about various static blocks is rare, so we keep it out of line.
- StaticBlockInfo _staticBlockInfo;
-
- ValueTypeShapeCharacteristics _valueTypeShapeCharacteristics;
+ private StaticBlockInfo _staticBlockInfo;
+ private ValueTypeShapeCharacteristics _valueTypeShapeCharacteristics;
/// <summary>
/// Does a type transitively have any fields which are GC object pointers
diff --git a/src/coreclr/tools/Common/TypeSystem/Common/FieldDesc.FieldLayout.cs b/src/coreclr/tools/Common/TypeSystem/Common/FieldDesc.FieldLayout.cs
index 2d8daed2caf..e7b5e6d2147 100644
--- a/src/coreclr/tools/Common/TypeSystem/Common/FieldDesc.FieldLayout.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Common/FieldDesc.FieldLayout.cs
@@ -1,7 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
using System.Diagnostics;
namespace Internal.TypeSystem
diff --git a/src/coreclr/tools/Common/TypeSystem/Common/FieldDesc.ToString.cs b/src/coreclr/tools/Common/TypeSystem/Common/FieldDesc.ToString.cs
index cde79093f28..6d52f349f24 100644
--- a/src/coreclr/tools/Common/TypeSystem/Common/FieldDesc.ToString.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Common/FieldDesc.ToString.cs
@@ -3,7 +3,7 @@
namespace Internal.TypeSystem
{
- partial class FieldDesc
+ public partial class FieldDesc
{
public override string ToString()
{
diff --git a/src/coreclr/tools/Common/TypeSystem/Common/FieldDesc.cs b/src/coreclr/tools/Common/TypeSystem/Common/FieldDesc.cs
index 23bd5ba923a..a1822176142 100644
--- a/src/coreclr/tools/Common/TypeSystem/Common/FieldDesc.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Common/FieldDesc.cs
@@ -1,7 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
using System.Runtime.CompilerServices;
using Debug = System.Diagnostics.Debug;
@@ -23,8 +22,8 @@ namespace Internal.TypeSystem
public override bool Equals(object o)
{
// Its only valid to compare two FieldDescs in the same context
- Debug.Assert(o is not FieldDesc || object.ReferenceEquals(((FieldDesc)o).Context, this.Context));
- return object.ReferenceEquals(this, o);
+ Debug.Assert(o is not FieldDesc || ReferenceEquals(((FieldDesc)o).Context, this.Context));
+ return ReferenceEquals(this, o);
}
public virtual string Name
diff --git a/src/coreclr/tools/Common/TypeSystem/Common/FieldForInstantiatedType.cs b/src/coreclr/tools/Common/TypeSystem/Common/FieldForInstantiatedType.cs
index fbc456a8306..692e4db2a0a 100644
--- a/src/coreclr/tools/Common/TypeSystem/Common/FieldForInstantiatedType.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Common/FieldForInstantiatedType.cs
@@ -1,8 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-
using Debug = System.Diagnostics.Debug;
namespace Internal.TypeSystem
@@ -47,7 +45,7 @@ namespace Internal.TypeSystem
{
get
{
- return _fieldDef.FieldType.InstantiateSignature(_instantiatedType.Instantiation, new Instantiation());
+ return _fieldDef.FieldType.InstantiateSignature(_instantiatedType.Instantiation, default(Instantiation));
}
}
diff --git a/src/coreclr/tools/Common/TypeSystem/Common/FunctionPointerType.cs b/src/coreclr/tools/Common/TypeSystem/Common/FunctionPointerType.cs
index 1328e3c040d..1a0c881ca37 100644
--- a/src/coreclr/tools/Common/TypeSystem/Common/FunctionPointerType.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Common/FunctionPointerType.cs
@@ -1,8 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System.Text;
-
namespace Internal.TypeSystem
{
/// <summary>
diff --git a/src/coreclr/tools/Common/TypeSystem/Common/GenericParameterDesc.Diagnostic.cs b/src/coreclr/tools/Common/TypeSystem/Common/GenericParameterDesc.Diagnostic.cs
index 7e8df4304df..00f6772b608 100644
--- a/src/coreclr/tools/Common/TypeSystem/Common/GenericParameterDesc.Diagnostic.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Common/GenericParameterDesc.Diagnostic.cs
@@ -2,7 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
using System;
-using System.Collections.Generic;
namespace Internal.TypeSystem
{
diff --git a/src/coreclr/tools/Common/TypeSystem/Common/GenericParameterDesc.cs b/src/coreclr/tools/Common/TypeSystem/Common/GenericParameterDesc.cs
index a6ca019dcab..85f438e7364 100644
--- a/src/coreclr/tools/Common/TypeSystem/Common/GenericParameterDesc.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Common/GenericParameterDesc.cs
@@ -116,7 +116,7 @@ namespace Internal.TypeSystem
{
get
{
- return TypeDesc.EmptyTypes;
+ return EmptyTypes;
}
}
diff --git a/src/coreclr/tools/Common/TypeSystem/Common/InstantiatedMethod.cs b/src/coreclr/tools/Common/TypeSystem/Common/InstantiatedMethod.cs
index 9105c566534..dce30dadc53 100644
--- a/src/coreclr/tools/Common/TypeSystem/Common/InstantiatedMethod.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Common/InstantiatedMethod.cs
@@ -1,9 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
using System.Diagnostics;
-using System.Text;
using Internal.NativeFormat;
namespace Internal.TypeSystem
@@ -56,7 +54,7 @@ namespace Internal.TypeSystem
private TypeDesc Instantiate(TypeDesc type)
{
- return type.InstantiateSignature(new Instantiation(), _instantiation);
+ return type.InstantiateSignature(default(Instantiation), _instantiation);
}
public override MethodSignature Signature
diff --git a/src/coreclr/tools/Common/TypeSystem/Common/InstantiatedType.Interfaces.cs b/src/coreclr/tools/Common/TypeSystem/Common/InstantiatedType.Interfaces.cs
index 9e4cae52234..265aef7029d 100644
--- a/src/coreclr/tools/Common/TypeSystem/Common/InstantiatedType.Interfaces.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Common/InstantiatedType.Interfaces.cs
@@ -1,9 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-using Debug = System.Diagnostics.Debug;
-
namespace Internal.TypeSystem
{
// Implementation for Instantiated type specific interface logic
@@ -15,7 +12,7 @@ namespace Internal.TypeSystem
private DefType[] InitializeImplementedInterfaces()
{
// TODO Add duplicate detection
- return (_implementedInterfaces = InstantiateTypeArray(_typeDef.ExplicitlyImplementedInterfaces, _instantiation, new Instantiation()));
+ return (_implementedInterfaces = InstantiateTypeArray(_typeDef.ExplicitlyImplementedInterfaces, _instantiation, default(Instantiation)));
}
/// <summary>
diff --git a/src/coreclr/tools/Common/TypeSystem/Common/InstantiatedType.MethodImpls.cs b/src/coreclr/tools/Common/TypeSystem/Common/InstantiatedType.MethodImpls.cs
index 6002edbdb23..c8d4f91ad5d 100644
--- a/src/coreclr/tools/Common/TypeSystem/Common/InstantiatedType.MethodImpls.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Common/InstantiatedType.MethodImpls.cs
@@ -1,8 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-
namespace Internal.TypeSystem
{
// Implementation of MethodImpl api surface implemented without metadata access.
@@ -24,7 +22,7 @@ namespace Internal.TypeSystem
{
MethodDesc decl;
- var implTypeInstantiated = uninstMethodImpls[i].Decl.OwningType.InstantiateSignature(this.Instantiation, new Instantiation());
+ var implTypeInstantiated = uninstMethodImpls[i].Decl.OwningType.InstantiateSignature(this.Instantiation, default(Instantiation));
if (implTypeInstantiated is InstantiatedType)
{
decl = _typeDef.Context.GetMethodForInstantiatedType(uninstMethodImpls[i].Decl.GetTypicalMethodDefinition(), (InstantiatedType)implTypeInstantiated);
diff --git a/src/coreclr/tools/Common/TypeSystem/Common/InstantiatedType.cs b/src/coreclr/tools/Common/TypeSystem/Common/InstantiatedType.cs
index bed4e2388e9..2b9e2774324 100644
--- a/src/coreclr/tools/Common/TypeSystem/Common/InstantiatedType.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Common/InstantiatedType.cs
@@ -1,9 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
using System.Collections.Generic;
-using System.Text;
using System.Diagnostics;
namespace Internal.TypeSystem
@@ -55,7 +53,7 @@ namespace Internal.TypeSystem
{
var uninst = _typeDef.MetadataBaseType;
- return (_baseType = (uninst != null) ? (MetadataType)uninst.InstantiateSignature(_instantiation, new Instantiation()) : null);
+ return (_baseType = (uninst != null) ? (MetadataType)uninst.InstantiateSignature(_instantiation, default(Instantiation)) : null);
}
public override DefType BaseType
diff --git a/src/coreclr/tools/Common/TypeSystem/Common/LayoutInt.cs b/src/coreclr/tools/Common/TypeSystem/Common/LayoutInt.cs
index c794377bf19..a2067d04225 100644
--- a/src/coreclr/tools/Common/TypeSystem/Common/LayoutInt.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Common/LayoutInt.cs
@@ -26,7 +26,7 @@ namespace Internal.TypeSystem
{
if (input < 0)
{
- throw new ArgumentException();
+ throw new ArgumentOutOfRangeException(nameof(input));
}
else
{
diff --git a/src/coreclr/tools/Common/TypeSystem/Common/LinqPoison.cs b/src/coreclr/tools/Common/TypeSystem/Common/LinqPoison.cs
index ce2675fa2b1..2473b14397c 100644
--- a/src/coreclr/tools/Common/TypeSystem/Common/LinqPoison.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Common/LinqPoison.cs
@@ -16,5 +16,5 @@ namespace System
// "using System.Linq" from your file. Do not modify this file or
// remove it from the project.
//
- internal class Linq { }
+ internal sealed class Linq { }
}
diff --git a/src/coreclr/tools/Common/TypeSystem/Common/MetadataFieldLayoutAlgorithm.cs b/src/coreclr/tools/Common/TypeSystem/Common/MetadataFieldLayoutAlgorithm.cs
index 5ff6417e52e..62d40846951 100644
--- a/src/coreclr/tools/Common/TypeSystem/Common/MetadataFieldLayoutAlgorithm.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Common/MetadataFieldLayoutAlgorithm.cs
@@ -53,7 +53,7 @@ namespace Internal.TypeSystem
}
// Global types do not do the rest of instance field layout.
- ComputedInstanceFieldLayout result = new ComputedInstanceFieldLayout();
+ ComputedInstanceFieldLayout result = default(ComputedInstanceFieldLayout);
result.Offsets = Array.Empty<FieldAndOffset>();
return result;
}
@@ -180,10 +180,10 @@ namespace Internal.TypeSystem
}
ComputedStaticFieldLayout result;
- result.GcStatics = new StaticsBlock();
- result.NonGcStatics = new StaticsBlock();
- result.ThreadGcStatics = new StaticsBlock();
- result.ThreadNonGcStatics = new StaticsBlock();
+ result.GcStatics = default(StaticsBlock);
+ result.NonGcStatics = default(StaticsBlock);
+ result.ThreadGcStatics = default(StaticsBlock);
+ result.ThreadNonGcStatics = default(StaticsBlock);
if (numStaticFields == 0)
{
@@ -216,7 +216,7 @@ namespace Internal.TypeSystem
block.Size = LayoutInt.AlignUp(block.Size, sizeAndAlignment.Alignment, context.Target);
result.Offsets[index] = new FieldAndOffset(field, block.Size);
- block.Size = block.Size + sizeAndAlignment.Size;
+ block.Size += sizeAndAlignment.Size;
block.LargestAlignment = LayoutInt.Max(block.LargestAlignment, sizeAndAlignment.Alignment);
@@ -228,7 +228,7 @@ namespace Internal.TypeSystem
return result;
}
- private ref StaticsBlock GetStaticsBlockForField(ref ComputedStaticFieldLayout layout, FieldDesc field)
+ private static ref StaticsBlock GetStaticsBlockForField(ref ComputedStaticFieldLayout layout, FieldDesc field)
{
if (field.IsThreadStatic)
{
@@ -453,7 +453,6 @@ namespace Internal.TypeSystem
TypeSystemContext context = type.Context;
bool hasLayout = type.HasLayout();
- var layoutMetadata = type.GetClassLayout();
// Auto-layout in CoreCLR does not respect packing size.
int packingSize = type.Context.Target.MaximumAlignment;
@@ -793,7 +792,7 @@ namespace Internal.TypeSystem
int log2size;
for (log2size = 0; size > 1; log2size++)
{
- size = size >> 1;
+ size >>= 1;
}
return log2size;
@@ -945,7 +944,7 @@ namespace Internal.TypeSystem
return ComputeHomogeneousAggregateCharacteristic(type);
}
- private ValueTypeShapeCharacteristics ComputeHomogeneousAggregateCharacteristic(DefType type)
+ private static ValueTypeShapeCharacteristics ComputeHomogeneousAggregateCharacteristic(DefType type)
{
// Use this constant to make the code below more laconic
const ValueTypeShapeCharacteristics NotHA = ValueTypeShapeCharacteristics.None;
diff --git a/src/coreclr/tools/Common/TypeSystem/Common/MetadataRuntimeInterfacesAlgorithm.cs b/src/coreclr/tools/Common/TypeSystem/Common/MetadataRuntimeInterfacesAlgorithm.cs
index 02b94121e52..fa3f1250198 100644
--- a/src/coreclr/tools/Common/TypeSystem/Common/MetadataRuntimeInterfacesAlgorithm.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Common/MetadataRuntimeInterfacesAlgorithm.cs
@@ -3,7 +3,6 @@
using System;
using System.Collections.Generic;
-using Debug = System.Diagnostics.Debug;
namespace Internal.TypeSystem
{
@@ -37,13 +36,11 @@ namespace Internal.TypeSystem
/// so the algorithm works by computing the uninstantiated form, and then
/// specializing each interface as needed.
/// </summary>
- private DefType[] ComputeRuntimeInterfacesForInstantiatedType(InstantiatedType instantiatedType)
+ private static DefType[] ComputeRuntimeInterfacesForInstantiatedType(InstantiatedType instantiatedType)
{
MetadataType uninstantiatedType = (MetadataType)instantiatedType.GetTypeDefinition();
- DefType[] genericTypeDefinitionInterfaces = uninstantiatedType.RuntimeInterfaces;
-
- return InstantiatedType.InstantiateTypeArray(uninstantiatedType.RuntimeInterfaces, instantiatedType.Instantiation, new Instantiation());
+ return InstantiatedType.InstantiateTypeArray(uninstantiatedType.RuntimeInterfaces, instantiatedType.Instantiation, default(Instantiation));
}
/// <summary>
@@ -58,7 +55,7 @@ namespace Internal.TypeSystem
if (explicitInterfaces.Length == 0)
return baseTypeInterfaces;
- ArrayBuilder<DefType> interfacesArray = new ArrayBuilder<DefType>();
+ ArrayBuilder<DefType> interfacesArray = default(ArrayBuilder<DefType>);
interfacesArray.Append(baseTypeInterfaces);
foreach (DefType iface in explicitInterfaces)
diff --git a/src/coreclr/tools/Common/TypeSystem/Common/MetadataType.Interfaces.cs b/src/coreclr/tools/Common/TypeSystem/Common/MetadataType.Interfaces.cs
index 011a16b301a..3744352723f 100644
--- a/src/coreclr/tools/Common/TypeSystem/Common/MetadataType.Interfaces.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Common/MetadataType.Interfaces.cs
@@ -1,9 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-using Debug = System.Diagnostics.Debug;
-
namespace Internal.TypeSystem
{
// Api surface definition for interfaces that all MetadataTypes must implement
diff --git a/src/coreclr/tools/Common/TypeSystem/Common/MetadataType.MethodImpls.cs b/src/coreclr/tools/Common/TypeSystem/Common/MetadataType.MethodImpls.cs
index faea42eea60..17871fee717 100644
--- a/src/coreclr/tools/Common/TypeSystem/Common/MetadataType.MethodImpls.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Common/MetadataType.MethodImpls.cs
@@ -1,8 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-
namespace Internal.TypeSystem
{
public struct MethodImplRecord
diff --git a/src/coreclr/tools/Common/TypeSystem/Common/MetadataTypeSystemContext.cs b/src/coreclr/tools/Common/TypeSystem/Common/MetadataTypeSystemContext.cs
index 97b6e62acb5..2e04cfb85c8 100644
--- a/src/coreclr/tools/Common/TypeSystem/Common/MetadataTypeSystemContext.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Common/MetadataTypeSystemContext.cs
@@ -1,7 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
using System.Collections.Generic;
using Debug = System.Diagnostics.Debug;
diff --git a/src/coreclr/tools/Common/TypeSystem/Common/MetadataVirtualMethodAlgorithm.cs b/src/coreclr/tools/Common/TypeSystem/Common/MetadataVirtualMethodAlgorithm.cs
index b3ef2048747..8b0112184f9 100644
--- a/src/coreclr/tools/Common/TypeSystem/Common/MetadataVirtualMethodAlgorithm.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Common/MetadataVirtualMethodAlgorithm.cs
@@ -9,7 +9,7 @@ namespace Internal.TypeSystem
{
public class MetadataVirtualMethodAlgorithm : VirtualMethodAlgorithm
{
- private class MethodDescHashtable : LockFreeReaderHashtable<MethodDesc, MethodDesc>
+ private sealed class MethodDescHashtable : LockFreeReaderHashtable<MethodDesc, MethodDesc>
{
protected override int GetKeyHashCode(MethodDesc key)
{
@@ -24,13 +24,13 @@ namespace Internal.TypeSystem
protected override bool CompareKeyToValue(MethodDesc key, MethodDesc value)
{
Debug.Assert(key.Context == value.Context);
- return object.ReferenceEquals(key, value);
+ return ReferenceEquals(key, value);
}
protected override bool CompareValueToValue(MethodDesc value1, MethodDesc value2)
{
Debug.Assert(value1.Context == value2.Context);
- return object.ReferenceEquals(value1, value2);
+ return ReferenceEquals(value1, value2);
}
protected override MethodDesc CreateValueFromKey(MethodDesc key)
@@ -39,7 +39,7 @@ namespace Internal.TypeSystem
}
}
- private class UnificationGroup
+ private sealed class UnificationGroup
{
private MethodDesc[] _members = MethodDesc.EmptyMethods;
private int _memberCount;
@@ -467,8 +467,7 @@ namespace Internal.TypeSystem
MethodDesc nameSigMatchMemberMethod = FindMatchingVirtualMethodOnTypeByNameAndSigWithSlotCheck(memberMethod, currentType, reverseMethodSearch: true);
if (nameSigMatchMemberMethod != null && nameSigMatchMemberMethod != memberMethod)
{
- if (separatedMethods == null)
- separatedMethods = new MethodDescHashtable();
+ separatedMethods ??= new MethodDescHashtable();
separatedMethods.AddOrGetExisting(memberMethod);
}
}
@@ -491,8 +490,7 @@ namespace Internal.TypeSystem
{
unificationGroup.RemoveFromGroup(declSlot);
- if (separatedMethods == null)
- separatedMethods = new MethodDescHashtable();
+ separatedMethods ??= new MethodDescHashtable();
separatedMethods.AddOrGetExisting(declSlot);
if (unificationGroup.RequiresSlotUnification(declSlot) || implSlot.RequiresSlotUnification())
@@ -907,8 +905,6 @@ namespace Internal.TypeSystem
/// <returns>MethodDesc of the resolved virtual static method, null when not found (runtime lookup must be used)</returns>
public static MethodDesc ResolveInterfaceMethodToStaticVirtualMethodOnType(MethodDesc interfaceMethod, MetadataType currentType)
{
- TypeDesc interfaceType = interfaceMethod.OwningType;
-
// Search for match on a per-level in the type hierarchy
for (MetadataType typeToCheck = currentType; typeToCheck != null; typeToCheck = typeToCheck.MetadataBaseType)
{
diff --git a/src/coreclr/tools/Common/TypeSystem/Common/MethodDelegator.Diagnostic.cs b/src/coreclr/tools/Common/TypeSystem/Common/MethodDelegator.Diagnostic.cs
index 4290daf4736..dd1f7c6442f 100644
--- a/src/coreclr/tools/Common/TypeSystem/Common/MethodDelegator.Diagnostic.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Common/MethodDelegator.Diagnostic.cs
@@ -3,7 +3,7 @@
namespace Internal.TypeSystem
{
- partial class MethodDelegator
+ public partial class MethodDelegator
{
public override string DiagnosticName => _wrappedMethod.DiagnosticName;
}
diff --git a/src/coreclr/tools/Common/TypeSystem/Common/MethodDesc.Diagnostic.cs b/src/coreclr/tools/Common/TypeSystem/Common/MethodDesc.Diagnostic.cs
index 99784da0a34..f86297f1a2a 100644
--- a/src/coreclr/tools/Common/TypeSystem/Common/MethodDesc.Diagnostic.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Common/MethodDesc.Diagnostic.cs
@@ -1,11 +1,9 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System.Text;
-
namespace Internal.TypeSystem
{
- partial class MethodDesc
+ public partial class MethodDesc
{
public abstract string DiagnosticName { get; }
}
diff --git a/src/coreclr/tools/Common/TypeSystem/Common/MethodDesc.ToString.cs b/src/coreclr/tools/Common/TypeSystem/Common/MethodDesc.ToString.cs
index 485f28c809f..e53daaab2d1 100644
--- a/src/coreclr/tools/Common/TypeSystem/Common/MethodDesc.ToString.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Common/MethodDesc.ToString.cs
@@ -5,7 +5,7 @@ using System.Text;
namespace Internal.TypeSystem
{
- partial class MethodSignature
+ public partial class MethodSignature
{
public override string ToString()
{
@@ -39,7 +39,7 @@ namespace Internal.TypeSystem
}
}
- partial class MethodDesc
+ public partial class MethodDesc
{
public override string ToString()
{
diff --git a/src/coreclr/tools/Common/TypeSystem/Common/MethodDesc.cs b/src/coreclr/tools/Common/TypeSystem/Common/MethodDesc.cs
index f2abb6fedfa..33af7a32f68 100644
--- a/src/coreclr/tools/Common/TypeSystem/Common/MethodDesc.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Common/MethodDesc.cs
@@ -60,7 +60,7 @@ namespace Internal.TypeSystem
}
// Provide a means to create a MethodSignature which ignores EmbeddedSignature data in the MethodSignatures it is compared to
- public static EmbeddedSignatureData[] EmbeddedSignatureMismatchPermittedFlag = new EmbeddedSignatureData[0];
+ public static EmbeddedSignatureData[] EmbeddedSignatureMismatchPermittedFlag = Array.Empty<EmbeddedSignatureData>();
public MethodSignature(MethodSignatureFlags flags, int genericParameterCount, TypeDesc returnType, TypeDesc[] parameters, EmbeddedSignatureData[] embeddedSignatureData = null)
{
@@ -445,8 +445,8 @@ namespace Internal.TypeSystem
public override bool Equals(object o)
{
// Its only valid to compare two MethodDescs in the same context
- Debug.Assert(o is not MethodDesc || object.ReferenceEquals(((MethodDesc)o).Context, this.Context));
- return object.ReferenceEquals(this, o);
+ Debug.Assert(o is not MethodDesc || ReferenceEquals(((MethodDesc)o).Context, this.Context));
+ return ReferenceEquals(this, o);
}
/// <summary>
diff --git a/src/coreclr/tools/Common/TypeSystem/Common/MethodForInstantiatedType.cs b/src/coreclr/tools/Common/TypeSystem/Common/MethodForInstantiatedType.cs
index 1691d5624ae..30c3fe8a1e1 100644
--- a/src/coreclr/tools/Common/TypeSystem/Common/MethodForInstantiatedType.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Common/MethodForInstantiatedType.cs
@@ -1,8 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-
using Debug = System.Diagnostics.Debug;
namespace Internal.TypeSystem
@@ -48,7 +46,7 @@ namespace Internal.TypeSystem
private TypeDesc Instantiate(TypeDesc type)
{
- return type.InstantiateSignature(_instantiatedType.Instantiation, new Instantiation());
+ return type.InstantiateSignature(_instantiatedType.Instantiation, default(Instantiation));
}
public override MethodSignature Signature
diff --git a/src/coreclr/tools/Common/TypeSystem/Common/ModuleDesc.cs b/src/coreclr/tools/Common/TypeSystem/Common/ModuleDesc.cs
index 9a7ac0a97c8..87fa16a5819 100644
--- a/src/coreclr/tools/Common/TypeSystem/Common/ModuleDesc.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Common/ModuleDesc.cs
@@ -1,7 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
using System.Collections.Generic;
namespace Internal.TypeSystem
diff --git a/src/coreclr/tools/Common/TypeSystem/Common/ParameterizedType.cs b/src/coreclr/tools/Common/TypeSystem/Common/ParameterizedType.cs
index 6ec0fbd352b..ba0f5720c03 100644
--- a/src/coreclr/tools/Common/TypeSystem/Common/ParameterizedType.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Common/ParameterizedType.cs
@@ -1,8 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-
namespace Internal.TypeSystem
{
public abstract partial class ParameterizedType : TypeDesc
diff --git a/src/coreclr/tools/Common/TypeSystem/Common/SignatureVariable.cs b/src/coreclr/tools/Common/TypeSystem/Common/SignatureVariable.cs
index 0bfcf24dc7c..4a26cb619d5 100644
--- a/src/coreclr/tools/Common/TypeSystem/Common/SignatureVariable.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Common/SignatureVariable.cs
@@ -1,12 +1,8 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-
using Internal.NativeFormat;
-using Debug = System.Diagnostics.Debug;
-
namespace Internal.TypeSystem
{
public abstract partial class SignatureVariable : TypeDesc
diff --git a/src/coreclr/tools/Common/TypeSystem/Common/TargetArchitecture.cs b/src/coreclr/tools/Common/TypeSystem/Common/TargetArchitecture.cs
index 160ff674f8d..928e3018b06 100644
--- a/src/coreclr/tools/Common/TypeSystem/Common/TargetArchitecture.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Common/TargetArchitecture.cs
@@ -1,9 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-using Debug = System.Diagnostics.Debug;
-
namespace Internal.TypeSystem
{
/// <summary>
diff --git a/src/coreclr/tools/Common/TypeSystem/Common/TargetDetails.ToString.cs b/src/coreclr/tools/Common/TypeSystem/Common/TargetDetails.ToString.cs
index 413f789853e..37a065260d0 100644
--- a/src/coreclr/tools/Common/TypeSystem/Common/TargetDetails.ToString.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Common/TargetDetails.ToString.cs
@@ -1,12 +1,9 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-using Debug = System.Diagnostics.Debug;
-
namespace Internal.TypeSystem
{
- partial class TargetDetails
+ public partial class TargetDetails
{
public override string ToString()
{
diff --git a/src/coreclr/tools/Common/TypeSystem/Common/ThrowHelper.Common.cs b/src/coreclr/tools/Common/TypeSystem/Common/ThrowHelper.Common.cs
index cf644ad14d4..58114db36df 100644
--- a/src/coreclr/tools/Common/TypeSystem/Common/ThrowHelper.Common.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Common/ThrowHelper.Common.cs
@@ -1,7 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
using System.Text;
using Debug = System.Diagnostics.Debug;
diff --git a/src/coreclr/tools/Common/TypeSystem/Common/TypeDesc.Interfaces.cs b/src/coreclr/tools/Common/TypeSystem/Common/TypeDesc.Interfaces.cs
index ce778fa590e..5d4349ec6c1 100644
--- a/src/coreclr/tools/Common/TypeSystem/Common/TypeDesc.Interfaces.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Common/TypeDesc.Interfaces.cs
@@ -3,7 +3,6 @@
using System;
using System.Threading;
-using Debug = System.Diagnostics.Debug;
namespace Internal.TypeSystem
{
diff --git a/src/coreclr/tools/Common/TypeSystem/Common/TypeDesc.ToString.cs b/src/coreclr/tools/Common/TypeSystem/Common/TypeDesc.ToString.cs
index 4b63e28d430..4995be92c54 100644
--- a/src/coreclr/tools/Common/TypeSystem/Common/TypeDesc.ToString.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Common/TypeDesc.ToString.cs
@@ -3,7 +3,7 @@
namespace Internal.TypeSystem
{
- partial class TypeDesc
+ public partial class TypeDesc
{
public override string ToString()
{
diff --git a/src/coreclr/tools/Common/TypeSystem/Common/TypeDesc.cs b/src/coreclr/tools/Common/TypeSystem/Common/TypeDesc.cs
index 905a9bbca5b..b85c803cec0 100644
--- a/src/coreclr/tools/Common/TypeSystem/Common/TypeDesc.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Common/TypeDesc.cs
@@ -24,23 +24,23 @@ namespace Internal.TypeSystem
public override bool Equals(object o)
{
// Its only valid to compare two TypeDescs in the same context
- Debug.Assert(o is not TypeDesc || object.ReferenceEquals(((TypeDesc)o).Context, this.Context));
- return object.ReferenceEquals(this, o);
+ Debug.Assert(o is not TypeDesc || ReferenceEquals(((TypeDesc)o).Context, this.Context));
+ return ReferenceEquals(this, o);
}
#if DEBUG
public static bool operator ==(TypeDesc left, TypeDesc right)
{
// Its only valid to compare two TypeDescs in the same context
- Debug.Assert(left is null || right is null || object.ReferenceEquals(left.Context, right.Context));
- return object.ReferenceEquals(left, right);
+ Debug.Assert(left is null || right is null || ReferenceEquals(left.Context, right.Context));
+ return ReferenceEquals(left, right);
}
public static bool operator !=(TypeDesc left, TypeDesc right)
{
// Its only valid to compare two TypeDescs in the same context
- Debug.Assert(left is null || right is null || object.ReferenceEquals(left.Context, right.Context));
- return !object.ReferenceEquals(left, right);
+ Debug.Assert(left is null || right is null || ReferenceEquals(left.Context, right.Context));
+ return !ReferenceEquals(left, right);
}
#endif
diff --git a/src/coreclr/tools/Common/TypeSystem/Common/TypeHashingAlgorithms.cs b/src/coreclr/tools/Common/TypeSystem/Common/TypeHashingAlgorithms.cs
index 5904397c4a0..1b9692037fe 100644
--- a/src/coreclr/tools/Common/TypeSystem/Common/TypeHashingAlgorithms.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Common/TypeHashingAlgorithms.cs
@@ -5,7 +5,6 @@
// Generic functions to compute the hashcode value of types
// ---------------------------------------------------------------------------
-using System;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Text;
diff --git a/src/coreclr/tools/Common/TypeSystem/Common/TypeSystemConstraintsHelpers.cs b/src/coreclr/tools/Common/TypeSystem/Common/TypeSystemConstraintsHelpers.cs
index d749946a72a..acd8e291ceb 100644
--- a/src/coreclr/tools/Common/TypeSystem/Common/TypeSystemConstraintsHelpers.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Common/TypeSystemConstraintsHelpers.cs
@@ -53,7 +53,7 @@ namespace Internal.TypeSystem
if (instantiationParam.IsByRefLike && (constraints & GenericConstraints.AcceptByRefLike) == 0)
return false;
- var instantiatedConstraints = new ArrayBuilder<TypeDesc>();
+ var instantiatedConstraints = default(ArrayBuilder<TypeDesc>);
GetInstantiatedConstraintsRecursive(instantiationParamContext, instantiationParam, ref instantiatedConstraints);
foreach (var constraintType in genericParam.TypeConstraints)
diff --git a/src/coreclr/tools/Common/TypeSystem/Common/TypeSystemContext.cs b/src/coreclr/tools/Common/TypeSystem/Common/TypeSystemContext.cs
index fcb47f42d3c..af5beb8a738 100644
--- a/src/coreclr/tools/Common/TypeSystem/Common/TypeSystemContext.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Common/TypeSystemContext.cs
@@ -117,7 +117,7 @@ namespace Internal.TypeSystem
}
}
- public class ArrayTypeKeyHashtable : LockFreeReaderHashtable<ArrayTypeKey, ArrayType>
+ public sealed class ArrayTypeKeyHashtable : LockFreeReaderHashtable<ArrayTypeKey, ArrayType>
{
protected override int GetKeyHashCode(ArrayTypeKey key)
{
@@ -304,7 +304,7 @@ namespace Internal.TypeSystem
}
}
- public class InstantiatedTypeKeyHashtable : LockFreeReaderHashtable<InstantiatedTypeKey, InstantiatedType>
+ public sealed class InstantiatedTypeKeyHashtable : LockFreeReaderHashtable<InstantiatedTypeKey, InstantiatedType>
{
protected override int GetKeyHashCode(InstantiatedTypeKey key)
{
@@ -403,7 +403,7 @@ namespace Internal.TypeSystem
}
}
- public class InstantiatedMethodKeyHashtable : LockFreeReaderHashtable<InstantiatedMethodKey, InstantiatedMethod>
+ public sealed class InstantiatedMethodKeyHashtable : LockFreeReaderHashtable<InstantiatedMethodKey, InstantiatedMethod>
{
protected override int GetKeyHashCode(InstantiatedMethodKey key)
{
@@ -502,7 +502,7 @@ namespace Internal.TypeSystem
}
}
- public class MethodForInstantiatedTypeKeyHashtable : LockFreeReaderHashtable<MethodForInstantiatedTypeKey, MethodForInstantiatedType>
+ public sealed class MethodForInstantiatedTypeKeyHashtable : LockFreeReaderHashtable<MethodForInstantiatedTypeKey, MethodForInstantiatedType>
{
protected override int GetKeyHashCode(MethodForInstantiatedTypeKey key)
{
@@ -575,7 +575,7 @@ namespace Internal.TypeSystem
}
}
- public class FieldForInstantiatedTypeKeyHashtable : LockFreeReaderHashtable<FieldForInstantiatedTypeKey, FieldForInstantiatedType>
+ public sealed class FieldForInstantiatedTypeKeyHashtable : LockFreeReaderHashtable<FieldForInstantiatedTypeKey, FieldForInstantiatedType>
{
protected override int GetKeyHashCode(FieldForInstantiatedTypeKey key)
{
@@ -617,7 +617,7 @@ namespace Internal.TypeSystem
//
// Signature variables
//
- private class SignatureVariableHashtable : LockFreeReaderHashtable<uint, SignatureVariable>
+ private sealed class SignatureVariableHashtable : LockFreeReaderHashtable<uint, SignatureVariable>
{
private TypeSystemContext _context;
public SignatureVariableHashtable(TypeSystemContext context)
diff --git a/src/coreclr/tools/Common/TypeSystem/Common/TypeSystemException.Resources.cs b/src/coreclr/tools/Common/TypeSystem/Common/TypeSystemException.Resources.cs
index bf5a3b97b29..056c0aa6e5a 100644
--- a/src/coreclr/tools/Common/TypeSystem/Common/TypeSystemException.Resources.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Common/TypeSystemException.Resources.cs
@@ -2,7 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
using System;
-using System.Collections.Generic;
using System.Globalization;
using System.Resources;
using System.Reflection;
@@ -11,7 +10,7 @@ using System.Reflection;
// need to support accessing these strings via the ResourceManager
namespace Internal.TypeSystem
{
- partial class TypeSystemException : Exception
+ public partial class TypeSystemException : Exception
{
private static Lazy<ResourceManager> s_stringResourceManager =
new Lazy<ResourceManager>(() => new ResourceManager("Internal.TypeSystem.Strings", typeof(TypeSystemException).GetTypeInfo().Assembly));
diff --git a/src/coreclr/tools/Common/TypeSystem/Common/TypeSystemException.cs b/src/coreclr/tools/Common/TypeSystem/Common/TypeSystemException.cs
index 39015e807d9..6c8cd66654a 100644
--- a/src/coreclr/tools/Common/TypeSystem/Common/TypeSystemException.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Common/TypeSystemException.cs
@@ -50,12 +50,12 @@ namespace Internal.TypeSystem
{
if (formatString != null)
{
- return String.Format(formatString, (object[])args);
+ return string.Format(formatString, (object[])args);
}
}
catch {}
-
- return "[TEMPORARY EXCEPTION MESSAGE] " + id.ToString() + ": " + String.Join(", ", args);
+
+ return "[TEMPORARY EXCEPTION MESSAGE] " + id.ToString() + ": " + string.Join(", ", args);
}
/// <summary>
diff --git a/src/coreclr/tools/Common/TypeSystem/Common/TypeSystemHelpers.cs b/src/coreclr/tools/Common/TypeSystem/Common/TypeSystemHelpers.cs
index 7c841444f15..749136b698b 100644
--- a/src/coreclr/tools/Common/TypeSystem/Common/TypeSystemHelpers.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Common/TypeSystemHelpers.cs
@@ -363,7 +363,7 @@ namespace Internal.TypeSystem
// It is generally a bug to have instantiations over generic parameters
// in the system. Typical instantiations are represented as instantiations
// over own formals - so these should be signature variables instead.
- throw new ArgumentException();
+ throw new InvalidOperationException();
default:
Debug.Assert(thisType is DefType);
diff --git a/src/coreclr/tools/Common/TypeSystem/Common/UniversalCanonLayoutAlgorithm.cs b/src/coreclr/tools/Common/TypeSystem/Common/UniversalCanonLayoutAlgorithm.cs
index 196aef8c7e4..36987f95094 100644
--- a/src/coreclr/tools/Common/TypeSystem/Common/UniversalCanonLayoutAlgorithm.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Common/UniversalCanonLayoutAlgorithm.cs
@@ -3,10 +3,6 @@
using System;
-using Internal.NativeFormat;
-
-using Debug = System.Diagnostics.Debug;
-
namespace Internal.TypeSystem
{
public class UniversalCanonLayoutAlgorithm : FieldLayoutAlgorithm
diff --git a/src/coreclr/tools/Common/TypeSystem/Common/Utilities/CustomAttributeTypeNameFormatter.cs b/src/coreclr/tools/Common/TypeSystem/Common/Utilities/CustomAttributeTypeNameFormatter.cs
index 94a9caa2ad1..67ee949b835 100644
--- a/src/coreclr/tools/Common/TypeSystem/Common/Utilities/CustomAttributeTypeNameFormatter.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Common/Utilities/CustomAttributeTypeNameFormatter.cs
@@ -165,7 +165,7 @@ namespace Internal.TypeSystem
}
private static char[] s_escapedChars = new char[] { ',', '=', '"', ']', '[', '*', '&', '+', '\\' };
- private void AppendEscapedIdentifier(StringBuilder sb, string identifier)
+ private static void AppendEscapedIdentifier(StringBuilder sb, string identifier)
{
if (identifier.IndexOfAny(s_escapedChars) < 0)
{
diff --git a/src/coreclr/tools/Common/TypeSystem/Common/Utilities/CustomAttributeTypeNameParser.cs b/src/coreclr/tools/Common/TypeSystem/Common/Utilities/CustomAttributeTypeNameParser.cs
index 1b901f5e623..8089f6585d4 100644
--- a/src/coreclr/tools/Common/TypeSystem/Common/Utilities/CustomAttributeTypeNameParser.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Common/Utilities/CustomAttributeTypeNameParser.cs
@@ -78,7 +78,7 @@ namespace Internal.TypeSystem
if (typeDef == null)
return null;
- ArrayBuilder<TypeDesc> genericArgs = new ArrayBuilder<TypeDesc>();
+ ArrayBuilder<TypeDesc> genericArgs = default(ArrayBuilder<TypeDesc>);
// Followed by generic instantiation parameters (but check for the array case)
if (ch < nameEnd && ch.Current == '[' && (ch + 1) < nameEnd && (ch + 1).Current != ']' && (ch + 1).Current != ',')
@@ -184,7 +184,9 @@ namespace Internal.TypeSystem
if (ch.Current == '&')
{
loadedType = loadedType.MakeByRefType();
+#pragma warning disable IDE0059 // Unnecessary assignment of a value
ch++;
+#pragma warning restore IDE0059 // Unnecessary assignment of a value
}
}
@@ -232,7 +234,7 @@ namespace Internal.TypeSystem
{
if (throwIfNotFound)
ThrowHelper.ThrowTypeLoadException(typeName.ToString(), outerType.Module);
-
+
return null;
}
}
@@ -374,7 +376,7 @@ namespace Internal.TypeSystem
return new StringIterator(s, s.Length);
}
- struct StringIterator
+ private struct StringIterator : IEquatable<StringIterator>
{
private string _string;
private int _index;
@@ -396,46 +398,46 @@ namespace Internal.TypeSystem
public static string Substring(StringIterator it1, StringIterator it2)
{
- Debug.Assert(Object.ReferenceEquals(it1._string, it2._string));
+ Debug.Assert(ReferenceEquals(it1._string, it2._string));
return it1._string.Substring(it1._index, it2._index - it1._index);
}
- public static StringIterator operator++(StringIterator it)
+ public static StringIterator operator ++(StringIterator it)
{
return new StringIterator(it._string, ++it._index);
}
public static bool operator <(StringIterator it1, StringIterator it2)
{
- Debug.Assert(Object.ReferenceEquals(it1._string, it2._string));
+ Debug.Assert(ReferenceEquals(it1._string, it2._string));
return it1._index < it2._index;
}
public static bool operator >(StringIterator it1, StringIterator it2)
{
- Debug.Assert(Object.ReferenceEquals(it1._string, it2._string));
+ Debug.Assert(ReferenceEquals(it1._string, it2._string));
return it1._index > it2._index;
}
- public static StringIterator operator+(StringIterator it, int val)
+ public static StringIterator operator +(StringIterator it, int val)
{
return new StringIterator(it._string, it._index + val);
}
- public static StringIterator operator-(StringIterator it, int val)
+ public static StringIterator operator -(StringIterator it, int val)
{
return new StringIterator(it._string, it._index - val);
}
- public static bool operator==(StringIterator it1, StringIterator it2)
+ public static bool operator ==(StringIterator it1, StringIterator it2)
{
- Debug.Assert(Object.ReferenceEquals(it1._string, it2._string));
+ Debug.Assert(ReferenceEquals(it1._string, it2._string));
return it1._index == it2._index;
}
public static bool operator !=(StringIterator it1, StringIterator it2)
{
- Debug.Assert(Object.ReferenceEquals(it1._string, it2._string));
+ Debug.Assert(ReferenceEquals(it1._string, it2._string));
return it1._index != it2._index;
}
@@ -448,6 +450,11 @@ namespace Internal.TypeSystem
{
throw new NotImplementedException();
}
+
+ public bool Equals(StringIterator other)
+ {
+ throw new NotImplementedException();
+ }
}
#endregion
}
diff --git a/src/coreclr/tools/Common/TypeSystem/Common/Utilities/DebugNameFormatter.cs b/src/coreclr/tools/Common/TypeSystem/Common/Utilities/DebugNameFormatter.cs
index 607287e45f6..8c6c3a00fa7 100644
--- a/src/coreclr/tools/Common/TypeSystem/Common/Utilities/DebugNameFormatter.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Common/Utilities/DebugNameFormatter.cs
@@ -4,8 +4,6 @@
using System;
using System.Text;
-using Debug = System.Diagnostics.Debug;
-
namespace Internal.TypeSystem
{
public partial class DebugNameFormatter : TypeNameFormatter<DebugNameFormatter.Void, DebugNameFormatter.FormatOptions>
diff --git a/src/coreclr/tools/Common/TypeSystem/Common/Utilities/ExceptionTypeNameFormatter.Metadata.cs b/src/coreclr/tools/Common/TypeSystem/Common/Utilities/ExceptionTypeNameFormatter.Metadata.cs
index 92d3319a0c1..79a6da8f59a 100644
--- a/src/coreclr/tools/Common/TypeSystem/Common/Utilities/ExceptionTypeNameFormatter.Metadata.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Common/Utilities/ExceptionTypeNameFormatter.Metadata.cs
@@ -4,14 +4,14 @@
namespace Internal.TypeSystem
{
// Type name formatting functionality that relies on metadata.
- partial class ExceptionTypeNameFormatter
+ public partial class ExceptionTypeNameFormatter
{
- private string GetTypeName(DefType type)
+ private static string GetTypeName(DefType type)
{
return type.Name;
}
- private string GetTypeNamespace(DefType type)
+ private static string GetTypeNamespace(DefType type)
{
return type.Namespace;
}
diff --git a/src/coreclr/tools/Common/TypeSystem/Common/Utilities/GCPointerMap.Algorithm.cs b/src/coreclr/tools/Common/TypeSystem/Common/Utilities/GCPointerMap.Algorithm.cs
index b4fc577fb7b..eca01c4b3a4 100644
--- a/src/coreclr/tools/Common/TypeSystem/Common/Utilities/GCPointerMap.Algorithm.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Common/Utilities/GCPointerMap.Algorithm.cs
@@ -5,7 +5,7 @@ using Debug = System.Diagnostics.Debug;
namespace Internal.TypeSystem
{
- partial struct GCPointerMap
+ public partial struct GCPointerMap
{
/// <summary>
/// Computes the GC pointer map for the instance fields of <paramref name="type"/>.
diff --git a/src/coreclr/tools/Common/TypeSystem/Common/Utilities/GCPointerMap.cs b/src/coreclr/tools/Common/TypeSystem/Common/Utilities/GCPointerMap.cs
index 7f2d2195f3c..0e2bacf49bf 100644
--- a/src/coreclr/tools/Common/TypeSystem/Common/Utilities/GCPointerMap.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Common/Utilities/GCPointerMap.cs
@@ -129,7 +129,7 @@ namespace Internal.TypeSystem
sb.Append(bit ? '1' : '0');
return sb.ToString();
}
-
+
public int CompareTo(GCPointerMap other)
{
if (_numCells != other._numCells)
diff --git a/src/coreclr/tools/Common/TypeSystem/Common/Utilities/LockFreeReaderHashtable.cs b/src/coreclr/tools/Common/TypeSystem/Common/Utilities/LockFreeReaderHashtable.cs
index 77e777d3c0d..ad43bf90904 100644
--- a/src/coreclr/tools/Common/TypeSystem/Common/Utilities/LockFreeReaderHashtable.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Common/Utilities/LockFreeReaderHashtable.cs
@@ -6,7 +6,6 @@ using System.Collections;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Threading;
-using System.Threading.Tasks;
using Debug = System.Diagnostics.Debug;
namespace Internal.TypeSystem
@@ -245,7 +244,7 @@ namespace Internal.TypeSystem
if (sentinel == null)
return null;
- var sw = new SpinWait();
+ var sw = default(SpinWait);
while (true)
{
TValue value = Volatile.Read(ref hashtable[tableIndex]);
@@ -594,7 +593,7 @@ namespace Internal.TypeSystem
public TValue GetValueIfExists(TValue value)
{
if (value == null)
- throw new ArgumentNullException();
+ throw new ArgumentNullException(nameof(value));
TValue[] hashTableLocal = GetCurrentHashtable();
Debug.Assert(hashTableLocal.Length > 0);
diff --git a/src/coreclr/tools/Common/TypeSystem/Common/Utilities/TypeNameFormatter.cs b/src/coreclr/tools/Common/TypeSystem/Common/Utilities/TypeNameFormatter.cs
index 11ad86d7874..4dc7e6020d9 100644
--- a/src/coreclr/tools/Common/TypeSystem/Common/Utilities/TypeNameFormatter.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Common/Utilities/TypeNameFormatter.cs
@@ -1,7 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
using System.Text;
using Debug = System.Diagnostics.Debug;
diff --git a/src/coreclr/tools/Common/TypeSystem/Common/WellKnownType.cs b/src/coreclr/tools/Common/TypeSystem/Common/WellKnownType.cs
index b16257f2169..c726b3f719f 100644
--- a/src/coreclr/tools/Common/TypeSystem/Common/WellKnownType.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Common/WellKnownType.cs
@@ -1,8 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-
namespace Internal.TypeSystem
{
// The following enum is required for interop with the VS Debugger
diff --git a/src/coreclr/tools/Common/TypeSystem/Ecma/CachingMetadataStringDecoder.cs b/src/coreclr/tools/Common/TypeSystem/Ecma/CachingMetadataStringDecoder.cs
index 7a1ccfadb8b..cd0e77453cc 100644
--- a/src/coreclr/tools/Common/TypeSystem/Ecma/CachingMetadataStringDecoder.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Ecma/CachingMetadataStringDecoder.cs
@@ -1,9 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
using System.Reflection.Metadata;
-using System.Runtime.CompilerServices;
using Debug = System.Diagnostics.Debug;
using Internal.NativeFormat;
@@ -173,7 +171,7 @@ namespace Internal.TypeSystem.Ecma
return Add(hashCode, s);
}
- public unsafe override string GetString(byte* bytes, int byteCount)
+ public override unsafe string GetString(byte* bytes, int byteCount)
{
bool isAscii;
int hashCode = TypeHashingAlgorithms.ComputeASCIINameHashCode(bytes, byteCount, out isAscii);
diff --git a/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaAssembly.Symbols.cs b/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaAssembly.Symbols.cs
index 0ca7305763c..90ad54f4456 100644
--- a/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaAssembly.Symbols.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaAssembly.Symbols.cs
@@ -7,7 +7,7 @@ using System.Reflection.PortableExecutable;
namespace Internal.TypeSystem.Ecma
{
// Pluggable file that adds PDB handling functionality to EcmaAssembly
- partial class EcmaAssembly
+ public partial class EcmaAssembly
{
internal EcmaAssembly(TypeSystemContext context, PEReader peReader, MetadataReader metadataReader, PdbSymbolReader pdbReader, IModuleResolver customModuleResolver)
: base(context, peReader, metadataReader, containingAssembly: null, pdbReader, customModuleResolver)
diff --git a/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaField.CodeGen.cs b/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaField.CodeGen.cs
index 2f76289e4ab..963ee08762c 100644
--- a/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaField.CodeGen.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaField.CodeGen.cs
@@ -3,7 +3,7 @@
namespace Internal.TypeSystem.Ecma
{
- partial class EcmaField
+ public partial class EcmaField
{
public override bool IsIntrinsic
{
diff --git a/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaField.Serialization.cs b/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaField.Serialization.cs
index 52a7a474dbf..f2767d45915 100644
--- a/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaField.Serialization.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaField.Serialization.cs
@@ -3,7 +3,7 @@
namespace Internal.TypeSystem.Ecma
{
- partial class EcmaField
+ public partial class EcmaField
{
public override bool IsNotSerialized
{
diff --git a/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaField.Sorting.cs b/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaField.Sorting.cs
index 9151b571936..5b3dd3200f1 100644
--- a/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaField.Sorting.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaField.Sorting.cs
@@ -6,7 +6,7 @@ using System.Reflection.Metadata.Ecma335;
namespace Internal.TypeSystem.Ecma
{
// Functionality related to deterministic ordering of types and members
- partial class EcmaField
+ public partial class EcmaField
{
protected internal override int ClassCode => 44626835;
diff --git a/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaGenericParameter.Sorting.cs b/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaGenericParameter.Sorting.cs
index cc74c3ba5e6..730abcce7f0 100644
--- a/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaGenericParameter.Sorting.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaGenericParameter.Sorting.cs
@@ -6,7 +6,7 @@ using System.Reflection.Metadata.Ecma335;
namespace Internal.TypeSystem.Ecma
{
// Functionality related to deterministic ordering of types
- partial class EcmaGenericParameter
+ public partial class EcmaGenericParameter
{
protected internal override int ClassCode => -1548417824;
diff --git a/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaGenericParameter.cs b/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaGenericParameter.cs
index 7451c0a9fb4..0ecf1c409be 100644
--- a/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaGenericParameter.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaGenericParameter.cs
@@ -1,10 +1,8 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
using System.Collections.Generic;
using System.Reflection.Metadata;
-using Internal.NativeFormat;
using Debug = System.Diagnostics.Debug;
using GenericParameterAttributes = System.Reflection.GenericParameterAttributes;
@@ -108,7 +106,7 @@ namespace Internal.TypeSystem.Ecma
return (GenericConstraints)(parameter.Attributes & GenericParameterAttributes.SpecialConstraintMask);
}
}
-
+
public override IEnumerable<TypeDesc> TypeConstraints
{
get
@@ -119,7 +117,7 @@ namespace Internal.TypeSystem.Ecma
GenericParameterConstraintHandleCollection constraintHandles = parameter.GetConstraints();
if (constraintHandles.Count == 0)
- return TypeDesc.EmptyTypes;
+ return EmptyTypes;
TypeDesc[] constraintTypes = new TypeDesc[constraintHandles.Count];
diff --git a/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaMethod.Sorting.cs b/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaMethod.Sorting.cs
index 09ea200aa06..3ad587d76bb 100644
--- a/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaMethod.Sorting.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaMethod.Sorting.cs
@@ -6,7 +6,7 @@ using System.Reflection.Metadata.Ecma335;
namespace Internal.TypeSystem.Ecma
{
// Functionality related to deterministic ordering of types
- partial class EcmaMethod
+ public partial class EcmaMethod
{
protected internal override int ClassCode => 1419431046;
diff --git a/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaMethod.cs b/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaMethod.cs
index 182a87c5676..63eb97c3726 100644
--- a/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaMethod.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaMethod.cs
@@ -362,7 +362,7 @@ namespace Internal.TypeSystem.Ecma
get
{
MethodAttributes attributes = Attributes;
- return attributes.IsRuntimeSpecialName()
+ return attributes.IsRuntimeSpecialName()
&& attributes.IsPublic()
&& Signature.Length == 0
&& Name == ".ctor"
@@ -546,7 +546,7 @@ namespace Internal.TypeSystem.Ecma
public override ParameterMetadata[] GetParameterMetadata()
{
MetadataReader metadataReader = MetadataReader;
-
+
// Spot check the enums match
Debug.Assert((int)ParameterAttributes.In == (int)ParameterMetadataAttributes.In);
Debug.Assert((int)ParameterAttributes.Out == (int)ParameterMetadataAttributes.Out);
diff --git a/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaModule.Sorting.cs b/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaModule.Sorting.cs
index a86c4f030d5..86ec5968907 100644
--- a/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaModule.Sorting.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaModule.Sorting.cs
@@ -7,7 +7,7 @@ using Debug = System.Diagnostics.Debug;
namespace Internal.TypeSystem.Ecma
{
- partial class EcmaModule
+ public partial class EcmaModule
{
public int CompareTo(EcmaModule other)
{
diff --git a/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaModule.Symbols.cs b/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaModule.Symbols.cs
index 821f8643ea3..30d0d180b9e 100644
--- a/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaModule.Symbols.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaModule.Symbols.cs
@@ -7,7 +7,7 @@ using System.Reflection.PortableExecutable;
namespace Internal.TypeSystem.Ecma
{
// Pluggable file that adds PDB handling functionality to EcmaModule
- partial class EcmaModule
+ public partial class EcmaModule
{
public PdbSymbolReader PdbReader
{
diff --git a/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaModule.cs b/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaModule.cs
index 35634b46d1e..7140a8b0333 100644
--- a/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaModule.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaModule.cs
@@ -51,7 +51,7 @@ namespace Internal.TypeSystem.Ecma
}
}
- internal class EcmaObjectLookupHashtable : LockFreeReaderHashtable<EntityHandle, IEntityHandleObject>
+ internal sealed class EcmaObjectLookupHashtable : LockFreeReaderHashtable<EntityHandle, IEntityHandleObject>
{
private EcmaModule _module;
@@ -77,7 +77,7 @@ namespace Internal.TypeSystem.Ecma
protected override bool CompareValueToValue(IEntityHandleObject value1, IEntityHandleObject value2)
{
- if (Object.ReferenceEquals(value1, value2))
+ if (ReferenceEquals(value1, value2))
return true;
else
return value1.Handle.Equals(value2.Handle);
@@ -177,7 +177,7 @@ namespace Internal.TypeSystem.Ecma
}
private LockFreeReaderHashtable<EntityHandle, IEntityHandleObject> _resolvedTokens;
- IModuleResolver _moduleResolver;
+ private IModuleResolver _moduleResolver;
internal EcmaModule(TypeSystemContext context, PEReader peReader, MetadataReader metadataReader, IAssemblyDesc containingAssembly, IModuleResolver customModuleResolver)
: base(context, containingAssembly)
@@ -185,7 +185,7 @@ namespace Internal.TypeSystem.Ecma
_peReader = peReader;
_metadataReader = metadataReader;
_resolvedTokens = new EcmaObjectLookupHashtable(this);
- _moduleResolver = customModuleResolver != null ? customModuleResolver : context;
+ _moduleResolver = customModuleResolver ?? context;
}
public static EcmaModule Create(TypeSystemContext context, PEReader peReader, IAssemblyDesc containingAssembly, IModuleResolver customModuleResolver = null)
@@ -208,7 +208,7 @@ namespace Internal.TypeSystem.Ecma
var stringDecoderProvider = context as IMetadataStringDecoderProvider;
MetadataReader metadataReader = peReader.GetMetadataReader(MetadataReaderOptions.None /* MetadataReaderOptions.ApplyWindowsRuntimeProjections */,
- (stringDecoderProvider != null) ? stringDecoderProvider.GetMetadataStringDecoder() : null);
+ stringDecoderProvider?.GetMetadataStringDecoder());
return metadataReader;
}
@@ -353,7 +353,7 @@ namespace Internal.TypeSystem.Ecma
{
TypeDesc type = GetObject(handle, NotFoundBehavior.Throw) as TypeDesc;
if (type == null)
- ThrowHelper.ThrowBadImageFormatException($"type expected for handle {handle.ToString()}");
+ ThrowHelper.ThrowBadImageFormatException($"type expected for handle {handle}");
return type;
}
@@ -361,7 +361,7 @@ namespace Internal.TypeSystem.Ecma
{
MethodDesc method = GetObject(handle, NotFoundBehavior.Throw) as MethodDesc;
if (method == null)
- ThrowHelper.ThrowBadImageFormatException($"method expected for handle {handle.ToString()}");
+ ThrowHelper.ThrowBadImageFormatException($"method expected for handle {handle}");
return method;
}
@@ -369,11 +369,11 @@ namespace Internal.TypeSystem.Ecma
{
FieldDesc field = GetObject(handle, NotFoundBehavior.Throw) as FieldDesc;
if (field == null)
- ThrowHelper.ThrowBadImageFormatException($"field expected for handle {handle.ToString()}");
+ ThrowHelper.ThrowBadImageFormatException($"field expected for handle {handle}");
return field;
}
- public Object GetObject(EntityHandle handle, NotFoundBehavior notFoundBehavior = NotFoundBehavior.Throw)
+ public object GetObject(EntityHandle handle, NotFoundBehavior notFoundBehavior = NotFoundBehavior.Throw)
{
IEntityHandleObject obj = _resolvedTokens.GetOrCreateValue(handle);
if (obj is EcmaObjectLookupWrapper)
@@ -394,7 +394,7 @@ namespace Internal.TypeSystem.Ecma
}
}
- private Object ResolveMethodSpecification(MethodSpecificationHandle handle)
+ private object ResolveMethodSpecification(MethodSpecificationHandle handle)
{
MethodSpecification methodSpecification = _metadataReader.GetMethodSpecification(handle);
@@ -404,7 +404,7 @@ namespace Internal.TypeSystem.Ecma
MethodDesc methodDef = resolvedMethod as MethodDesc;
if (methodDef == null)
- ThrowHelper.ThrowBadImageFormatException($"method expected for handle {handle.ToString()}");
+ ThrowHelper.ThrowBadImageFormatException($"method expected for handle {handle}");
BlobReader signatureReader = _metadataReader.GetBlobReader(methodSpecification.Signature);
EcmaSignatureParser parser = new EcmaSignatureParser(this, signatureReader, NotFoundBehavior.ReturnResolutionFailure);
@@ -417,7 +417,7 @@ namespace Internal.TypeSystem.Ecma
return Context.GetInstantiatedMethod(methodDef, new Instantiation(instantiation));
}
- private Object ResolveStandaloneSignature(StandaloneSignatureHandle handle)
+ private object ResolveStandaloneSignature(StandaloneSignatureHandle handle)
{
StandaloneSignature signature = _metadataReader.GetStandaloneSignature(handle);
BlobReader signatureReader = _metadataReader.GetBlobReader(signature.Signature);
@@ -429,7 +429,7 @@ namespace Internal.TypeSystem.Ecma
return methodSig;
}
- private Object ResolveTypeSpecification(TypeSpecificationHandle handle)
+ private object ResolveTypeSpecification(TypeSpecificationHandle handle)
{
TypeSpecification typeSpecification = _metadataReader.GetTypeSpecification(handle);
@@ -443,11 +443,11 @@ namespace Internal.TypeSystem.Ecma
return parsedType;
}
- private Object ResolveMemberReference(MemberReferenceHandle handle)
+ private object ResolveMemberReference(MemberReferenceHandle handle)
{
MemberReference memberReference = _metadataReader.GetMemberReference(handle);
- Object parent = GetObject(memberReference.Parent, NotFoundBehavior.ReturnResolutionFailure);
+ object parent = GetObject(memberReference.Parent, NotFoundBehavior.ReturnResolutionFailure);
if (parent is ResolutionFailure)
return parent;
@@ -533,11 +533,11 @@ namespace Internal.TypeSystem.Ecma
return null;
}
- private Object ResolveTypeReference(TypeReferenceHandle handle)
+ private object ResolveTypeReference(TypeReferenceHandle handle)
{
TypeReference typeReference = _metadataReader.GetTypeReference(handle);
- Object resolutionScope = GetObject(typeReference.ResolutionScope, NotFoundBehavior.ReturnResolutionFailure);
+ object resolutionScope = GetObject(typeReference.ResolutionScope, NotFoundBehavior.ReturnResolutionFailure);
if (resolutionScope is ResolutionFailure)
{
return resolutionScope;
@@ -564,7 +564,7 @@ namespace Internal.TypeSystem.Ecma
throw new NotImplementedException();
}
- private Object ResolveAssemblyReference(AssemblyReferenceHandle handle)
+ private object ResolveAssemblyReference(AssemblyReferenceHandle handle)
{
AssemblyReference assemblyReference = _metadataReader.GetAssemblyReference(handle);
@@ -592,22 +592,20 @@ namespace Internal.TypeSystem.Ecma
return assembly;
}
- private Object ResolveExportedType(ExportedTypeHandle handle)
+ private object ResolveExportedType(ExportedTypeHandle handle)
{
ExportedType exportedType = _metadataReader.GetExportedType(handle);
var implementation = GetObject(exportedType.Implementation, NotFoundBehavior.ReturnResolutionFailure);
- if (implementation is ModuleDesc)
+ if (implementation is ModuleDesc module)
{
- var module = (ModuleDesc)implementation;
string nameSpace = _metadataReader.GetString(exportedType.Namespace);
string name = _metadataReader.GetString(exportedType.Name);
return module.GetType(nameSpace, name, NotFoundBehavior.ReturnResolutionFailure);
}
else
- if (implementation is MetadataType)
+ if (implementation is MetadataType type)
{
- var type = (MetadataType)implementation;
string name = _metadataReader.GetString(exportedType.Name);
var nestedType = type.GetNestedType(name);
if (nestedType == null)
diff --git a/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaSignatureEncoder.cs b/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaSignatureEncoder.cs
index 68110e076d3..275cbcb6058 100644
--- a/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaSignatureEncoder.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaSignatureEncoder.cs
@@ -3,12 +3,9 @@
using System;
using System.Collections.Immutable;
-using System.Reflection;
using System.Reflection.Metadata.Ecma335;
using System.Reflection.Metadata;
-using Internal.TypeSystem;
-
namespace Internal.TypeSystem.Ecma
{
public interface IEntityHandleProvider
@@ -20,7 +17,7 @@ namespace Internal.TypeSystem.Ecma
public class EcmaSignatureEncoder<TEntityHandleProvider> where TEntityHandleProvider : IEntityHandleProvider
{
- TEntityHandleProvider _entityHandleProvider;
+ private TEntityHandleProvider _entityHandleProvider;
public EcmaSignatureEncoder(TEntityHandleProvider entityHandleProvider)
{
diff --git a/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaSignatureParser.cs b/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaSignatureParser.cs
index f2530ec8b19..4df655766af 100644
--- a/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaSignatureParser.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaSignatureParser.cs
@@ -3,11 +3,8 @@
using System;
using System.Reflection.Metadata;
-using System.Runtime.InteropServices;
using System.Diagnostics;
using System.Text;
-
-using Internal.TypeSystem;
using System.Collections.Generic;
namespace Internal.TypeSystem.Ecma
@@ -49,10 +46,9 @@ namespace Internal.TypeSystem.Ecma
_resolutionFailure = null;
}
- void SetResolutionFailure(ResolutionFailure failure)
+ private void SetResolutionFailure(ResolutionFailure failure)
{
- if (_resolutionFailure == null)
- _resolutionFailure = failure;
+ _resolutionFailure ??= failure;
}
public ResolutionFailure ResolutionFailure => _resolutionFailure;
@@ -100,10 +96,7 @@ namespace Internal.TypeSystem.Ecma
_indexStack.Push(0);
}
TypeDesc result = ParseTypeImpl(typeCode);
- if (_indexStack != null)
- {
- _indexStack.Pop();
- }
+ _indexStack?.Pop();
return result;
}
@@ -270,10 +263,7 @@ namespace Internal.TypeSystem.Ecma
_indexStack.Push(0);
}
SignatureTypeCode result = ParseTypeCodeImpl(skipPinned);
- if (_indexStack != null)
- {
- _indexStack.Pop();
- }
+ _indexStack?.Pop();
return result;
}
@@ -286,20 +276,14 @@ namespace Internal.TypeSystem.Ecma
if (typeCode == SignatureTypeCode.RequiredModifier)
{
EntityHandle typeHandle = _reader.ReadTypeHandle();
- if (_embeddedSignatureDataList != null)
- {
- _embeddedSignatureDataList.Add(new EmbeddedSignatureData { index = string.Join(".", _indexStack), kind = EmbeddedSignatureDataKind.RequiredCustomModifier, type = ResolveHandle(typeHandle) });
- }
+ _embeddedSignatureDataList?.Add(new EmbeddedSignatureData { index = string.Join(".", _indexStack), kind = EmbeddedSignatureDataKind.RequiredCustomModifier, type = ResolveHandle(typeHandle) });
continue;
}
if (typeCode == SignatureTypeCode.OptionalModifier)
{
EntityHandle typeHandle = _reader.ReadTypeHandle();
- if (_embeddedSignatureDataList != null)
- {
- _embeddedSignatureDataList.Add(new EmbeddedSignatureData { index = string.Join(".", _indexStack), kind = EmbeddedSignatureDataKind.OptionalCustomModifier, type = ResolveHandle(typeHandle) });
- }
+ _embeddedSignatureDataList?.Add(new EmbeddedSignatureData { index = string.Join(".", _indexStack), kind = EmbeddedSignatureDataKind.OptionalCustomModifier, type = ResolveHandle(typeHandle) });
continue;
}
@@ -323,10 +307,7 @@ namespace Internal.TypeSystem.Ecma
_indexStack.Push(0);
}
TypeDesc result = ParseTypeImpl();
- if (_indexStack != null)
- {
- _indexStack.Pop();
- }
+ _indexStack?.Pop();
return result;
}
@@ -370,10 +351,7 @@ namespace Internal.TypeSystem.Ecma
_indexStack.Push(0);
}
MethodSignature result = ParseMethodSignatureImpl(skipEmbeddedSignatureData);
- if (_indexStack != null)
- {
- _indexStack.Pop();
- }
+ _indexStack?.Pop();
return result;
}
diff --git a/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaSignatureTranslator.cs b/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaSignatureTranslator.cs
index dd7e01fec9e..4ef47c3fe45 100644
--- a/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaSignatureTranslator.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaSignatureTranslator.cs
@@ -9,10 +9,10 @@ namespace Internal.TypeSystem.Ecma
{
public struct EcmaSignatureTranslator
{
- BlobReader _input;
- BlobBuilder _output;
+ private BlobReader _input;
+ private BlobBuilder _output;
- Func<int, int> _getAlternateStreamToken;
+ private Func<int, int> _getAlternateStreamToken;
public EcmaSignatureTranslator(BlobReader input, BlobBuilder output, Func<int, int> getAlternateStreamToken)
{
@@ -23,31 +23,31 @@ namespace Internal.TypeSystem.Ecma
// Various parsing functions for processing through the locals of a function and translating them to the
// alternate form with new tokens.
- int ParseCompressedInt()
+ private int ParseCompressedInt()
{
int value = _input.ReadCompressedInteger();
_output.WriteCompressedInteger(value);
return value;
}
- int ParseCompressedSignedInt()
+ private int ParseCompressedSignedInt()
{
int value = _input.ReadCompressedSignedInteger();
_output.WriteCompressedSignedInteger(value);
return value;
}
- byte ParseByte()
+ private byte ParseByte()
{
byte value = _input.ReadByte();
_output.WriteByte(value);
return value;
}
- byte PeekByte()
+ private byte PeekByte()
{
byte value = _input.ReadByte();
- _input.Offset = _input.Offset - 1;
+ _input.Offset--;
return value;
}
@@ -109,8 +109,7 @@ namespace Internal.TypeSystem.Ecma
}
}
-
- void ParseTypeHandle()
+ private void ParseTypeHandle()
{
int token = MetadataTokens.GetToken(_input.ReadTypeHandle());
int newToken = _getAlternateStreamToken(token);
@@ -179,7 +178,7 @@ namespace Internal.TypeSystem.Ecma
case SignatureTypeCode.Array:
{
ParseType();
- var rank = ParseCompressedInt();
+ /*var rank = */ParseCompressedInt();
var boundsCount = ParseCompressedInt();
for (int i = 0; i < boundsCount; i++)
diff --git a/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaType.Diagnostic.cs b/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaType.Diagnostic.cs
index 028fec14c23..d991a3f9b28 100644
--- a/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaType.Diagnostic.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaType.Diagnostic.cs
@@ -1,15 +1,8 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-using System.Collections.Generic;
-using System.Reflection;
using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335;
-using System.Threading;
-using Debug = System.Diagnostics.Debug;
-
-using Internal.NativeFormat;
namespace Internal.TypeSystem.Ecma
{
diff --git a/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaType.Interfaces.cs b/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaType.Interfaces.cs
index 44639a27ebe..fb9a7befa31 100644
--- a/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaType.Interfaces.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaType.Interfaces.cs
@@ -2,12 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
using System;
-using System.Reflection;
-using System.Reflection.Metadata;
-using System.Threading;
-using Debug = System.Diagnostics.Debug;
-
-using Internal.TypeSystem;
namespace Internal.TypeSystem.Ecma
{
diff --git a/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaType.MethodImpls.cs b/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaType.MethodImpls.cs
index e9f16ef1ca3..e7e7ccb14b9 100644
--- a/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaType.MethodImpls.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaType.MethodImpls.cs
@@ -1,15 +1,10 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
using System.Collections.Generic;
-using System.Reflection;
using System.Reflection.Metadata;
-using System.Threading;
using Debug = System.Diagnostics.Debug;
-using Internal.TypeSystem;
-
namespace Internal.TypeSystem.Ecma
{
// This file has implementations of the .MethodImpl.cs logic from its base type.
@@ -21,7 +16,7 @@ namespace Internal.TypeSystem.Ecma
{
MetadataReader metadataReader = _module.MetadataReader;
var stringComparer = metadataReader.StringComparer;
- ArrayBuilder<MethodImplRecord> foundRecords = new ArrayBuilder<MethodImplRecord>();
+ ArrayBuilder<MethodImplRecord> foundRecords = default(ArrayBuilder<MethodImplRecord>);
foreach (var methodImplHandle in _typeDefinition.GetMethodImplementations())
{
@@ -79,7 +74,7 @@ namespace Internal.TypeSystem.Ecma
protected override MethodImplRecord[] ComputeVirtualMethodImplsForType()
{
- ArrayBuilder<MethodImplRecord> records = new ArrayBuilder<MethodImplRecord>();
+ ArrayBuilder<MethodImplRecord> records = default(ArrayBuilder<MethodImplRecord>);
MetadataReader metadataReader = _module.MetadataReader;
@@ -90,8 +85,8 @@ namespace Internal.TypeSystem.Ecma
EntityHandle methodDeclCheckHandle = methodImpl.MethodDeclaration;
HandleKind methodDeclHandleKind = methodDeclCheckHandle.Kind;
- // We want to check that the type is not an interface matches before actually getting the MethodDesc.
- // For MethodSpecifications we need to dereference that handle to the underlying member reference to
+ // We want to check that the type is not an interface matches before actually getting the MethodDesc.
+ // For MethodSpecifications we need to dereference that handle to the underlying member reference to
// look at the owning type.
if (methodDeclHandleKind == HandleKind.MethodSpecification)
{
diff --git a/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaType.Serialization.cs b/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaType.Serialization.cs
index 0f826f68936..9cfd879b023 100644
--- a/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaType.Serialization.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaType.Serialization.cs
@@ -5,7 +5,7 @@ using System.Reflection;
namespace Internal.TypeSystem.Ecma
{
- partial class EcmaType
+ public partial class EcmaType
{
public override bool IsSerializable
{
diff --git a/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaType.Sorting.cs b/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaType.Sorting.cs
index 2f0aefcab74..f8443196adf 100644
--- a/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaType.Sorting.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaType.Sorting.cs
@@ -6,7 +6,7 @@ using System.Reflection.Metadata.Ecma335;
namespace Internal.TypeSystem.Ecma
{
// Functionality related to deterministic ordering of types
- partial class EcmaType
+ public partial class EcmaType
{
protected internal override int ClassCode => 1340416537;
diff --git a/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaType.cs b/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaType.cs
index fe041b71b6a..245c51458a4 100644
--- a/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaType.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaType.cs
@@ -7,7 +7,6 @@ using System.Reflection;
using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335;
using System.Threading;
-using Debug = System.Diagnostics.Debug;
using Internal.NativeFormat;
@@ -106,7 +105,7 @@ namespace Internal.TypeSystem.Ecma
}
else
{
- _genericParameters = TypeDesc.EmptyTypes;
+ _genericParameters = EmptyTypes;
}
}
diff --git a/src/coreclr/tools/Common/TypeSystem/Ecma/IEcmaModule.cs b/src/coreclr/tools/Common/TypeSystem/Ecma/IEcmaModule.cs
index 816906f7cb9..4aee7b4ac00 100644
--- a/src/coreclr/tools/Common/TypeSystem/Ecma/IEcmaModule.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Ecma/IEcmaModule.cs
@@ -1,12 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-using System.Collections.Generic;
-using System.Reflection;
using System.Reflection.Metadata;
-using System.Reflection.Metadata.Ecma335;
-using System.Reflection.PortableExecutable;
using Internal.TypeSystem.Ecma;
@@ -48,7 +43,7 @@ namespace Internal.TypeSystem.Ecma
{
MetadataReader MetadataReader { get; }
TypeDesc GetType(EntityHandle handle);
- Object GetObject(EntityHandle handle, NotFoundBehavior notFoundBehavior = NotFoundBehavior.Throw);
+ object GetObject(EntityHandle handle, NotFoundBehavior notFoundBehavior = NotFoundBehavior.Throw);
int CompareTo(IEcmaModule other);
int ModuleTypeSort { get; }
diff --git a/src/coreclr/tools/Common/TypeSystem/Ecma/IMetadataStringDecoderProvider.cs b/src/coreclr/tools/Common/TypeSystem/Ecma/IMetadataStringDecoderProvider.cs
index b37bec733a5..2dccf664c5f 100644
--- a/src/coreclr/tools/Common/TypeSystem/Ecma/IMetadataStringDecoderProvider.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Ecma/IMetadataStringDecoderProvider.cs
@@ -1,7 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
using System.Reflection.Metadata;
namespace Internal.TypeSystem.Ecma
diff --git a/src/coreclr/tools/Common/TypeSystem/Ecma/MetadataExtensions.cs b/src/coreclr/tools/Common/TypeSystem/Ecma/MetadataExtensions.cs
index d021fb01be2..640a70efa7c 100644
--- a/src/coreclr/tools/Common/TypeSystem/Ecma/MetadataExtensions.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Ecma/MetadataExtensions.cs
@@ -122,7 +122,7 @@ namespace Internal.TypeSystem.Ecma
return default(CustomAttributeHandle);
}
- private static bool IsEqualCustomAttributeName(CustomAttributeHandle attributeHandle, MetadataReader metadataReader,
+ private static bool IsEqualCustomAttributeName(CustomAttributeHandle attributeHandle, MetadataReader metadataReader,
string attributeNamespace, string attributeName)
{
StringHandle namespaceHandle, nameHandle;
@@ -136,8 +136,8 @@ namespace Internal.TypeSystem.Ecma
public static bool GetAttributeNamespaceAndName(this MetadataReader metadataReader, CustomAttributeHandle attributeHandle,
out StringHandle namespaceHandle, out StringHandle nameHandle)
{
- EntityHandle attributeType, attributeCtor;
- if (!GetAttributeTypeAndConstructor(metadataReader, attributeHandle, out attributeType, out attributeCtor))
+ EntityHandle attributeType;
+ if (!GetAttributeTypeAndConstructor(metadataReader, attributeHandle, out attributeType, out _))
{
namespaceHandle = default(StringHandle);
nameHandle = default(StringHandle);
@@ -211,7 +211,7 @@ namespace Internal.TypeSystem.Ecma
public static PInvokeFlags GetDelegatePInvokeFlags(this EcmaType type)
{
PInvokeFlags flags = new PInvokeFlags(PInvokeAttributes.PreserveSig);
-
+
if (!type.IsDelegate)
{
return flags;
diff --git a/src/coreclr/tools/Common/TypeSystem/Ecma/SymbolReader/PortablePdbSymbolReader.cs b/src/coreclr/tools/Common/TypeSystem/Ecma/SymbolReader/PortablePdbSymbolReader.cs
index 4baae1590cf..17cee6d38cc 100644
--- a/src/coreclr/tools/Common/TypeSystem/Ecma/SymbolReader/PortablePdbSymbolReader.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Ecma/SymbolReader/PortablePdbSymbolReader.cs
@@ -1,7 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
using System.Collections.Generic;
using System.IO;
using System.IO.MemoryMappedFiles;
@@ -105,8 +104,7 @@ namespace Internal.TypeSystem.Ecma
public override void Dispose()
{
- if (_mappedViewAccessor != null)
- _mappedViewAccessor.Dispose();
+ _mappedViewAccessor?.Dispose();
}
public override int GetStateMachineKickoffMethod(int methodToken)
diff --git a/src/coreclr/tools/Common/TypeSystem/Ecma/SymbolReader/UnmanagedPdbSymbolReader.cs b/src/coreclr/tools/Common/TypeSystem/Ecma/SymbolReader/UnmanagedPdbSymbolReader.cs
index d4b6f3686be..40979241487 100644
--- a/src/coreclr/tools/Common/TypeSystem/Ecma/SymbolReader/UnmanagedPdbSymbolReader.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Ecma/SymbolReader/UnmanagedPdbSymbolReader.cs
@@ -8,7 +8,6 @@ using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Collections;
using System.Diagnostics;
-using System.Runtime.InteropServices.ComTypes;
using System.Runtime.CompilerServices;
#if !DISABLE_UNMANAGED_PDB_SYMBOLS
@@ -48,7 +47,7 @@ namespace Internal.TypeSystem.Ecma
static extern int CLRCreateInstance(ref Guid clsid, ref Guid riid, out IntPtr ptr);
}
- interface ICLRMetaHost
+ private interface ICLRMetaHost
{
public static readonly Guid IID = new Guid("d332db9e-b9b3-4125-8207-a14884f53216");
@@ -78,7 +77,7 @@ namespace Internal.TypeSystem.Ecma
protected override void ReleaseObjects(IEnumerable objects) => throw new NotImplementedException();
- public unsafe class ClrMetaHostRcw : ICLRMetaHost, IDisposable
+ public sealed unsafe class ClrMetaHostRcw : ICLRMetaHost, IDisposable
{
private bool _disposed;
private readonly IntPtr _inst;
@@ -125,7 +124,7 @@ namespace Internal.TypeSystem.Ecma
}
}
- interface ICLRRuntimeInfo
+ private interface ICLRRuntimeInfo
{
int GetInterface(ref Guid rclsid, ref Guid riid, out MetaDataDispenserWrapperCache.MetaDataDispenserRcw? ppUnk);
@@ -134,7 +133,7 @@ namespace Internal.TypeSystem.Ecma
// Don't need any other methods.
}
- private class CLRRuntimeInfoWrapperCache : ComWrappers
+ private sealed class CLRRuntimeInfoWrapperCache : ComWrappers
{
public static readonly CLRRuntimeInfoWrapperCache Instance = new CLRRuntimeInfoWrapperCache();
private CLRRuntimeInfoWrapperCache() { }
@@ -159,7 +158,7 @@ namespace Internal.TypeSystem.Ecma
BindAsLegacyV2Runtime = 13
}
- private bool _disposed = false;
+ private bool _disposed;
public int GetInterface(ref Guid rclsid, ref Guid riid, out MetaDataDispenserWrapperCache.MetaDataDispenserRcw? ppUnk)
{
@@ -230,7 +229,7 @@ namespace Internal.TypeSystem.Ecma
public sealed unsafe record MetaDataDispenserRcw(IntPtr Inst) : IMetaDataDispenser, IDisposable
{
- private bool _disposed = false;
+ private bool _disposed;
/// <remarks>
/// <paramref="punk" /> is simply a boxed IntPtr, because we don't need an RCW.
@@ -293,9 +292,9 @@ namespace Internal.TypeSystem.Ecma
}
protected override void ReleaseObjects(IEnumerable objects) => throw new NotImplementedException();
- public unsafe record SymUnmanagedBinderRcw(IntPtr Inst) : ISymUnmanagedBinder
+ public sealed unsafe record SymUnmanagedBinderRcw(IntPtr Inst) : ISymUnmanagedBinder
{
- private bool _disposed = false;
+ private bool _disposed;
public int GetReaderForFile(MetadataImportRcw metadataImporter, string fileName, string searchPath, out SymUnmanagedReaderWrapperCache.SymUnmanagedReaderRcw? reader)
{
@@ -343,7 +342,7 @@ namespace Internal.TypeSystem.Ecma
/// </summary>
private sealed record MetadataImportRcw(IntPtr Ptr) : IDisposable
{
- private bool _disposed = false;
+ private bool _disposed;
public void Dispose()
{
@@ -363,7 +362,7 @@ namespace Internal.TypeSystem.Ecma
}
}
- interface ISymUnmanagedReader
+ private interface ISymUnmanagedReader
{
int GetMethod(int methodToken, out ISymUnmanagedMethod? method);
// No more members are used
@@ -383,7 +382,7 @@ namespace Internal.TypeSystem.Ecma
public sealed unsafe record SymUnmanagedNamespaceRcw(IntPtr Inst) : ISymUnmanagedNamespace
{
- private bool _disposed = false;
+ private bool _disposed;
public int GetName(int bufferLength, out int count, char[] name)
{
@@ -418,7 +417,7 @@ namespace Internal.TypeSystem.Ecma
{
for (int i = 0; i < count; i++)
{
- namespaces[i] = (SymUnmanagedNamespaceWrapperCache.SymUnmanagedNamespaceRcw)SymUnmanagedNamespaceWrapperCache.Instance.GetOrCreateObjectForComInstance(intermediate[i], CreateObjectFlags.UniqueInstance);
+ namespaces[i] = (SymUnmanagedNamespaceWrapperCache.SymUnmanagedNamespaceRcw)Instance.GetOrCreateObjectForComInstance(intermediate[i], CreateObjectFlags.UniqueInstance);
}
}
}
@@ -496,7 +495,7 @@ namespace Internal.TypeSystem.Ecma
public sealed unsafe record SymUnmanagedVariableRcw(IntPtr Inst) : ISymUnmanagedVariable
{
- private bool _disposed = false;
+ private bool _disposed;
public int GetName(int bufferLength, out int count, char[] name)
{
@@ -580,7 +579,7 @@ namespace Internal.TypeSystem.Ecma
public sealed unsafe record SymUnmanagedScopeRcw(IntPtr Inst) : ISymUnmanagedScope
{
- private bool _disposed = false;
+ private bool _disposed;
public int GetMethod(out ISymUnmanagedMethod? method)
{
@@ -599,7 +598,7 @@ namespace Internal.TypeSystem.Ecma
IntPtr scopePtr;
int hr = func(Inst, &scopePtr);
scope = hr == 0
- ? (SymUnmanagedScopeWrapperCache.SymUnmanagedScopeRcw)SymUnmanagedScopeWrapperCache.Instance.GetOrCreateObjectForComInstance(scopePtr, CreateObjectFlags.UniqueInstance)
+ ? (SymUnmanagedScopeWrapperCache.SymUnmanagedScopeRcw)Instance.GetOrCreateObjectForComInstance(scopePtr, CreateObjectFlags.UniqueInstance)
: null;
return hr;
}
@@ -627,7 +626,7 @@ namespace Internal.TypeSystem.Ecma
{
for (int i = 0; i < count; i++)
{
- children[i] = (SymUnmanagedScopeWrapperCache.SymUnmanagedScopeRcw)SymUnmanagedScopeWrapperCache.Instance.GetOrCreateObjectForComInstance(intermediate[i], CreateObjectFlags.UniqueInstance);
+ children[i] = (SymUnmanagedScopeWrapperCache.SymUnmanagedScopeRcw)Instance.GetOrCreateObjectForComInstance(intermediate[i], CreateObjectFlags.UniqueInstance);
}
}
}
@@ -751,9 +750,9 @@ namespace Internal.TypeSystem.Ecma
}
protected override void ReleaseObjects(IEnumerable objects) => throw new NotImplementedException();
- public unsafe record SymUnmanagedDocumentRcw(IntPtr Inst) : ISymUnmanagedDocument
+ public sealed unsafe record SymUnmanagedDocumentRcw(IntPtr Inst) : ISymUnmanagedDocument
{
- private bool _disposed = false;
+ private bool _disposed;
public int GetUrl(int bufferLength, out int count, char[] url)
{
@@ -864,7 +863,7 @@ namespace Internal.TypeSystem.Ecma
public sealed unsafe record SymUnmanagedMethodRcw(IntPtr Inst) : ISymUnmanagedMethod
{
- private bool _disposed = false;
+ private bool _disposed;
public int GetToken(out int methodToken)
{
@@ -1080,7 +1079,7 @@ namespace Internal.TypeSystem.Ecma
/// </summary>
public sealed record SymUnmanagedReaderRcw(IntPtr Inst) : ISymUnmanagedReader
{
- private bool _disposed = false;
+ private bool _disposed;
public unsafe int GetMethod(int methodToken, out ISymUnmanagedMethod? method)
{
@@ -1127,7 +1126,7 @@ namespace Internal.TypeSystem.Ecma
}
private static int CoCreateInstance(ref Guid rclsid, IntPtr pUnkOuter,
- Int32 dwClsContext,
+ int dwClsContext,
ref Guid riid,
out CoCreateWrapperCache.SymUnmanagedBinderRcw? ppv)
{
@@ -1140,19 +1139,21 @@ namespace Internal.TypeSystem.Ecma
[DllImport("ole32.dll")]
static extern int CoCreateInstance(ref Guid rclsid, IntPtr pUnkOuter,
- Int32 dwClsContext,
+ int dwClsContext,
ref Guid riid,
out IntPtr ppv);
}
- private void ThrowExceptionForHR(int hr)
+ private static void ThrowExceptionForHR(int hr)
{
Marshal.ThrowExceptionForHR(hr, new IntPtr(-1));
}
private static readonly Guid SymBinderIID = new Guid(0x0a29ff9e, 0x7f9c, 0x4437, 0x8b, 0x11, 0xf4, 0x24, 0x49, 0x1e, 0x39, 0x31);
+#pragma warning disable CA1810 // Initialize reference type static fields inline
static UnmanagedPdbSymbolReader()
+#pragma warning restore CA1810 // Initialize reference type static fields inline
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
@@ -1202,8 +1203,8 @@ namespace Internal.TypeSystem.Ecma
}
}
- private readonly static MetaDataDispenserWrapperCache.MetaDataDispenserRcw? s_metadataDispenser;
- private readonly static CoCreateWrapperCache.SymUnmanagedBinderRcw? s_symBinder;
+ private static readonly MetaDataDispenserWrapperCache.MetaDataDispenserRcw? s_metadataDispenser;
+ private static readonly CoCreateWrapperCache.SymUnmanagedBinderRcw? s_symBinder;
public static PdbSymbolReader? TryOpenSymbolReaderForMetadataFile(string metadataFileName, string searchPath)
{
@@ -1252,8 +1253,7 @@ namespace Internal.TypeSystem.Ecma
{
lock (this)
{
- if (_urlCache == null)
- _urlCache = new Dictionary<ISymUnmanagedDocument, string>();
+ _urlCache ??= new Dictionary<ISymUnmanagedDocument, string>();
if (_urlCache.TryGetValue(doc, out var url))
return url;
@@ -1323,7 +1323,7 @@ namespace Internal.TypeSystem.Ecma
int attributes;
ThrowExceptionForHR(local.GetAttributes(out attributes));
- variables.Add(new ILLocalVariable(slot, new String(nameBuffer, 0, nameLength - 1), (attributes & 0x1) != 0));
+ variables.Add(new ILLocalVariable(slot, new string(nameBuffer, 0, nameLength - 1), (attributes & 0x1) != 0));
}
int childrenCount;
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/DelegateInfo.cs b/src/coreclr/tools/Common/TypeSystem/IL/DelegateInfo.cs
index 1edcea55169..11c803cf761 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/DelegateInfo.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/DelegateInfo.cs
@@ -71,10 +71,7 @@ namespace Internal.IL
{
get
{
- if (_signature == null)
- {
- _signature = _delegateType.GetKnownMethod("Invoke", null).Signature;
- }
+ _signature ??= _delegateType.GetKnownMethod("Invoke", null).Signature;
return _signature;
}
}
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/EcmaMethodIL.Symbols.cs b/src/coreclr/tools/Common/TypeSystem/IL/EcmaMethodIL.Symbols.cs
index ade8a64726c..46c30699408 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/EcmaMethodIL.Symbols.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/EcmaMethodIL.Symbols.cs
@@ -12,7 +12,7 @@ using Debug = System.Diagnostics.Debug;
namespace Internal.IL
{
// Pluggable file that adds PDB handling functionality to EcmaMethodIL
- partial class EcmaMethodIL
+ public partial class EcmaMethodIL
{
public override MethodDebugInformation GetDebugInfo()
{
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/HelperExtensions.cs b/src/coreclr/tools/Common/TypeSystem/IL/HelperExtensions.cs
index 66344ff698d..4ccaff2d6dd 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/HelperExtensions.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/HelperExtensions.cs
@@ -69,7 +69,7 @@ namespace Internal.IL
MethodDesc method = type.GetMethod(name, signature);
if (method == null)
{
- throw new InvalidOperationException(String.Format("Expected method '{0}' not found on type '{1}'", name, type));
+ throw new InvalidOperationException(string.Format("Expected method '{0}' not found on type '{1}'", name, type));
}
return method;
@@ -84,7 +84,7 @@ namespace Internal.IL
FieldDesc field = type.GetField(name);
if (field == null)
{
- throw new InvalidOperationException(String.Format("Expected field '{0}' not found on type '{1}'", name, type));
+ throw new InvalidOperationException(string.Format("Expected field '{0}' not found on type '{1}'", name, type));
}
return field;
@@ -99,7 +99,7 @@ namespace Internal.IL
MetadataType nestedType = type.GetNestedType(name);
if (nestedType == null)
{
- throw new InvalidOperationException(String.Format("Expected type '{0}' not found on type '{1}'", name, type));
+ throw new InvalidOperationException(string.Format("Expected type '{0}' not found on type '{1}'", name, type));
}
return nestedType;
@@ -115,8 +115,8 @@ namespace Internal.IL
if (type == null)
{
throw new InvalidOperationException(
- String.Format("Expected type '{0}' not found in module '{1}'",
- @namespace.Length > 0 ? String.Concat(@namespace, ".", name) : name,
+ string.Format("Expected type '{0}' not found in module '{1}'",
+ @namespace.Length > 0 ? string.Concat(@namespace, ".", name) : name,
module));
}
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/ILDisassembler.cs b/src/coreclr/tools/Common/TypeSystem/IL/ILDisassembler.cs
index f11ed8cf5db..864850ecc9c 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/ILDisassembler.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/ILDisassembler.cs
@@ -143,7 +143,7 @@ namespace Internal.IL
sb.Append(field.Name);
}
- private void AppendStringLiteral(StringBuilder sb, string s)
+ private static void AppendStringLiteral(StringBuilder sb, string s)
{
sb.Append('"');
for (int i = 0; i < s.Length; i++)
@@ -187,20 +187,21 @@ namespace Internal.IL
return _ilBytes[_currentOffset++];
}
- private UInt16 ReadILUInt16()
+ private ushort ReadILUInt16()
{
- UInt16 val = (UInt16)(_ilBytes[_currentOffset] + (_ilBytes[_currentOffset + 1] << 8));
+ ushort val = (ushort)(_ilBytes[_currentOffset] + (_ilBytes[_currentOffset + 1] << 8));
_currentOffset += 2;
return val;
}
- private UInt32 ReadILUInt32()
+ private uint ReadILUInt32()
{
- UInt32 val = (UInt32)(_ilBytes[_currentOffset] + (_ilBytes[_currentOffset + 1] << 8) + (_ilBytes[_currentOffset + 2] << 16) + (_ilBytes[_currentOffset + 3] << 24));
+ uint val = (uint)(_ilBytes[_currentOffset] + (_ilBytes[_currentOffset + 1] << 8) + (_ilBytes[_currentOffset + 2] << 16) + (_ilBytes[_currentOffset + 3] << 24));
_currentOffset += 4;
return val;
}
+
private int ReadILToken()
{
return (int)ReadILUInt32();
@@ -418,7 +419,7 @@ namespace Internal.IL
int delta = (int)ReadILUInt32();
AppendOffset(decodedInstruction, jmpBase + delta);
}
- decodedInstruction.Append(")");
+ decodedInstruction.Append(')');
return decodedInstruction.ToString();
}
@@ -493,7 +494,7 @@ namespace Internal.IL
public override void AppendName(StringBuilder sb, SignatureTypeVariable type)
{
- sb.Append("!");
+ sb.Append('!');
sb.Append(type.Index.ToStringInvariant());
}
@@ -514,7 +515,7 @@ namespace Internal.IL
if (i > 0)
sb.Append(", ");
AppendNameWithValueClassPrefix(sb, type.Instantiation[i]);
- }
+ }
sb.Append('>');
}
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/ILImporter.cs b/src/coreclr/tools/Common/TypeSystem/IL/ILImporter.cs
index 8f4cb7440c7..1ac634591cd 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/ILImporter.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/ILImporter.cs
@@ -1,14 +1,11 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-
using Internal.TypeSystem;
-using Internal.IL;
namespace Internal.IL
{
- internal partial class ILImporter
+ internal sealed partial class ILImporter
{
private BasicBlock[] _basicBlocks; // Maps IL offset to basic block
@@ -29,22 +26,22 @@ namespace Internal.IL
return _ilBytes[_currentOffset++];
}
- private UInt16 ReadILUInt16()
+ private ushort ReadILUInt16()
{
if (_currentOffset + 1 >= _ilBytes.Length)
ReportMethodEndInsideInstruction();
- UInt16 val = (UInt16)(_ilBytes[_currentOffset] + (_ilBytes[_currentOffset + 1] << 8));
+ ushort val = (ushort)(_ilBytes[_currentOffset] + (_ilBytes[_currentOffset + 1] << 8));
_currentOffset += 2;
return val;
}
- private UInt32 ReadILUInt32()
+ private uint ReadILUInt32()
{
if (_currentOffset + 3 >= _ilBytes.Length)
ReportMethodEndInsideInstruction();
- UInt32 val = (UInt32)(_ilBytes[_currentOffset] + (_ilBytes[_currentOffset + 1] << 8) + (_ilBytes[_currentOffset + 2] << 16) + (_ilBytes[_currentOffset + 3] << 24));
+ uint val = (uint)(_ilBytes[_currentOffset] + (_ilBytes[_currentOffset + 1] << 8) + (_ilBytes[_currentOffset + 2] << 16) + (_ilBytes[_currentOffset + 3] << 24));
_currentOffset += 4;
return val;
}
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/ILOpcode.cs b/src/coreclr/tools/Common/TypeSystem/IL/ILOpcode.cs
index f3a11e0074d..3a332e23463 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/ILOpcode.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/ILOpcode.cs
@@ -1,8 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-
namespace Internal.IL
{
/// <summary>
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/ILReader.cs b/src/coreclr/tools/Common/TypeSystem/IL/ILReader.cs
index d722b2e1712..d0022a5bad7 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/ILReader.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/ILReader.cs
@@ -1,7 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
using Internal.TypeSystem;
using Debug = System.Diagnostics.Debug;
@@ -55,22 +54,22 @@ namespace Internal.IL
return _ilBytes[_currentOffset++];
}
- public UInt16 ReadILUInt16()
+ public ushort ReadILUInt16()
{
if (_currentOffset + 2 > _ilBytes.Length)
ThrowHelper.ThrowInvalidProgramException();
- UInt16 val = (UInt16)(_ilBytes[_currentOffset] + (_ilBytes[_currentOffset + 1] << 8));
+ ushort val = (ushort)(_ilBytes[_currentOffset] + (_ilBytes[_currentOffset + 1] << 8));
_currentOffset += 2;
return val;
}
- public UInt32 ReadILUInt32()
+ public uint ReadILUInt32()
{
if (_currentOffset + 4 > _ilBytes.Length)
ThrowHelper.ThrowInvalidProgramException();
- UInt32 val = (UInt32)(_ilBytes[_currentOffset] + (_ilBytes[_currentOffset + 1] << 8) + (_ilBytes[_currentOffset + 2] << 16) + (_ilBytes[_currentOffset + 3] << 24));
+ uint val = (uint)(_ilBytes[_currentOffset] + (_ilBytes[_currentOffset + 1] << 8) + (_ilBytes[_currentOffset + 2] << 16) + (_ilBytes[_currentOffset + 3] << 24));
_currentOffset += 4;
return val;
}
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/ILStackHelper.cs b/src/coreclr/tools/Common/TypeSystem/IL/ILStackHelper.cs
index 19c643256b4..1204f1b6655 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/ILStackHelper.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/ILStackHelper.cs
@@ -24,7 +24,7 @@ namespace Internal.IL
/// </summary>
public static int ComputeMaxStack(this MethodIL methodIL)
{
- const int StackHeightNotSet = Int32.MinValue;
+ const int StackHeightNotSet = int.MinValue;
byte[] ilbytes = methodIL.GetILBytes();
int currentOffset = 0;
@@ -278,7 +278,7 @@ namespace Internal.IL
stackHeight = StackHeightNotSet;
}
break;
-
+
case ILOpcode.call:
case ILOpcode.calli:
case ILOpcode.callvirt:
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/ILTokenReplacer.cs b/src/coreclr/tools/Common/TypeSystem/IL/ILTokenReplacer.cs
index cc6dca8ef20..63c2a7fe4cb 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/ILTokenReplacer.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/ILTokenReplacer.cs
@@ -29,7 +29,7 @@ namespace Internal.IL
// Replace token in IL stream with a new token provided by the tokenReplaceFunc
//
// This is used by the StandaloneMethodMetadata logic to create method local tokens
- // and by the IL provider used for cross module inlining to create tokens which are
+ // and by the IL provider used for cross module inlining to create tokens which are
// stable and contained within the R2R module instead of being in a module separated
// by a version boundary.
int token = BinaryPrimitives.ReadInt32LittleEndian(tokenSpan);
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/InstantiatedMethodIL.cs b/src/coreclr/tools/Common/TypeSystem/IL/InstantiatedMethodIL.cs
index 9def3ed499b..5d4fb39c953 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/InstantiatedMethodIL.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/InstantiatedMethodIL.cs
@@ -1,8 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-
using Internal.TypeSystem;
using Debug = System.Diagnostics.Debug;
@@ -21,7 +19,7 @@ namespace Internal.IL
Debug.Assert(methodIL.GetMethodILDefinition() == methodIL);
Debug.Assert(owningMethod.HasInstantiation || owningMethod.OwningType.HasInstantiation);
Debug.Assert(owningMethod.GetTypicalMethodDefinition() == methodIL.OwningMethod);
-
+
_methodIL = methodIL;
_method = owningMethod;
@@ -86,12 +84,12 @@ namespace Internal.IL
}
}
- return (clone == null) ? locals : clone;
+ return clone ?? locals;
}
- public override Object GetObject(int token, NotFoundBehavior notFoundBehavior)
+ public override object GetObject(int token, NotFoundBehavior notFoundBehavior)
{
- Object o = _methodIL.GetObject(token, notFoundBehavior);
+ object o = _methodIL.GetObject(token, notFoundBehavior);
if (o is MethodDesc)
{
@@ -105,9 +103,8 @@ namespace Internal.IL
{
o = ((FieldDesc)o).InstantiateSignature(_typeInstantiation, _methodInstantiation);
}
- else if (o is MethodSignature)
+ else if (o is MethodSignature template)
{
- MethodSignature template = (MethodSignature)o;
MethodSignatureBuilder builder = new MethodSignatureBuilder(template);
builder.ReturnType = template.ReturnType.InstantiateSignature(_typeInstantiation, _methodInstantiation);
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/MethodIL.Symbols.cs b/src/coreclr/tools/Common/TypeSystem/IL/MethodIL.Symbols.cs
index 849db1a5df1..58990200f37 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/MethodIL.Symbols.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/MethodIL.Symbols.cs
@@ -4,11 +4,9 @@
using System;
using System.Collections.Generic;
-using Internal.TypeSystem;
-
namespace Internal.IL
{
- partial class MethodIL
+ public partial class MethodIL
{
public virtual MethodDebugInformation GetDebugInfo()
{
@@ -16,7 +14,7 @@ namespace Internal.IL
}
}
- partial class InstantiatedMethodIL
+ public partial class InstantiatedMethodIL
{
public override MethodDebugInformation GetDebugInfo()
{
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/MethodIL.cs b/src/coreclr/tools/Common/TypeSystem/IL/MethodIL.cs
index 2f8b5424919..13aee813f36 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/MethodIL.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/MethodIL.cs
@@ -1,14 +1,12 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-
using Internal.TypeSystem;
namespace Internal.IL
{
//
- // This duplicates types from System.Reflection.Metadata to avoid layering issues, and
+ // This duplicates types from System.Reflection.Metadata to avoid layering issues, and
// because of the System.Reflection.Metadata constructors are not public anyway.
//
@@ -73,7 +71,7 @@ namespace Internal.IL
/// (typically a <see cref="MethodDesc"/>, <see cref="FieldDesc"/>, <see cref="TypeDesc"/>,
/// or <see cref="MethodSignature"/>).
/// </summary>
- public abstract Object GetObject(int token, NotFoundBehavior notFoundBehavior = NotFoundBehavior.Throw);
+ public abstract object GetObject(int token, NotFoundBehavior notFoundBehavior = NotFoundBehavior.Throw);
public override string ToString()
{
@@ -113,7 +111,7 @@ namespace Internal.IL
/// </summary>
public abstract ILExceptionRegion[] GetExceptionRegions();
- public override sealed MethodILScope GetMethodILScopeDefinition()
+ public sealed override MethodILScope GetMethodILScopeDefinition()
{
return GetMethodILDefinition();
}
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/MethodILDebugView.cs b/src/coreclr/tools/Common/TypeSystem/IL/MethodILDebugView.cs
index 03fc460d258..28b9818c3af 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/MethodILDebugView.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/MethodILDebugView.cs
@@ -33,20 +33,20 @@ namespace Internal.IL
if (!owningMethod.Signature.IsStatic)
sb.Append("instance ");
disasm.AppendType(sb, owningMethod.Signature.ReturnType);
- sb.Append(" ");
+ sb.Append(' ');
sb.Append(owningMethod.Name);
if (owningMethod.HasInstantiation)
{
- sb.Append("<");
+ sb.Append('<');
for (int i = 0; i < owningMethod.Instantiation.Length; i++)
{
if (i != 0)
sb.Append(", ");
disasm.AppendType(sb, owningMethod.Instantiation[i]);
}
- sb.Append(">");
+ sb.Append('>');
}
- sb.Append("(");
+ sb.Append('(');
for (int i = 0; i < owningMethod.Signature.Length; i++)
{
if (i != 0)
@@ -71,7 +71,7 @@ namespace Internal.IL
if (_methodIL.IsInitLocals)
sb.Append("init ");
- sb.Append("(");
+ sb.Append('(');
for (int i = 0; i < locals.Length; i++)
{
@@ -81,7 +81,7 @@ namespace Internal.IL
sb.Append(' ', 6);
}
disasm.AppendType(sb, locals[i].Type);
- sb.Append(" ");
+ sb.Append(' ');
if (locals[i].IsPinned)
sb.Append("pinned ");
sb.Append("V_");
@@ -101,7 +101,7 @@ namespace Internal.IL
ILDisassembler.AppendOffset(sb, region.TryOffset);
sb.Append(" to ");
ILDisassembler.AppendOffset(sb, region.TryOffset + region.TryLength);
-
+
switch (region.Kind)
{
case ILExceptionRegionKind.Catch:
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/NativeAotILProvider.cs b/src/coreclr/tools/Common/TypeSystem/IL/NativeAotILProvider.cs
index 5e3f6e62ec8..2de9aa4f8c0 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/NativeAotILProvider.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/NativeAotILProvider.cs
@@ -14,7 +14,7 @@ namespace Internal.IL
{
public sealed class NativeAotILProvider : ILProvider
{
- private MethodIL TryGetRuntimeImplementedMethodIL(MethodDesc method)
+ private static MethodIL TryGetRuntimeImplementedMethodIL(MethodDesc method)
{
// Provides method bodies for runtime implemented methods. It can return null for
// methods that are treated specially by the codegen.
@@ -36,7 +36,7 @@ namespace Internal.IL
/// It can return null if it's not an intrinsic recognized by the compiler,
/// but an intrinsic e.g. recognized by codegen.
/// </summary>
- private MethodIL TryGetIntrinsicMethodIL(MethodDesc method)
+ private static MethodIL TryGetIntrinsicMethodIL(MethodDesc method)
{
Debug.Assert(method.IsIntrinsic);
@@ -108,7 +108,7 @@ namespace Internal.IL
/// are specialized per instantiation. It can return null if the intrinsic
/// is not recognized.
/// </summary>
- private MethodIL TryGetPerInstantiationIntrinsicMethodIL(MethodDesc method)
+ private static MethodIL TryGetPerInstantiationIntrinsicMethodIL(MethodDesc method)
{
Debug.Assert(method.IsIntrinsic);
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/ArrayMethodILEmitter.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/ArrayMethodILEmitter.cs
index 6a57b848dfd..0c81ec32862 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/ArrayMethodILEmitter.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/ArrayMethodILEmitter.cs
@@ -30,7 +30,7 @@ namespace Internal.IL.Stubs
_emitter = new ILEmitter();
// This helper field is needed to generate proper GC tracking. There is no direct way
- // to create interior pointer.
+ // to create interior pointer.
_helperFieldToken = _emitter.NewToken(_method.Context.GetWellKnownType(WellKnownType.Object).GetKnownField("m_pEEType"));
}
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/AssemblyGetExecutingAssemblyMethodThunk.Sorting.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/AssemblyGetExecutingAssemblyMethodThunk.Sorting.cs
index 004388db62c..fb12ea795a7 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/AssemblyGetExecutingAssemblyMethodThunk.Sorting.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/AssemblyGetExecutingAssemblyMethodThunk.Sorting.cs
@@ -7,7 +7,7 @@ using Internal.TypeSystem;
namespace Internal.IL.Stubs
{
// Functionality related to deterministic ordering of types
- partial class AssemblyGetExecutingAssemblyMethodThunk
+ internal partial class AssemblyGetExecutingAssemblyMethodThunk
{
protected override int ClassCode => 1459986716;
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/AssemblyGetExecutingAssemblyMethodThunk.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/AssemblyGetExecutingAssemblyMethodThunk.cs
index ce1d69716a7..78386fbe55c 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/AssemblyGetExecutingAssemblyMethodThunk.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/AssemblyGetExecutingAssemblyMethodThunk.cs
@@ -10,7 +10,7 @@ namespace Internal.IL.Stubs
/// is to load something that will let us identify the current assembly and call a class library
/// helper that will let us get the Assembly.
/// </summary>
- internal partial class AssemblyGetExecutingAssemblyMethodThunk : ILStubMethod
+ internal sealed partial class AssemblyGetExecutingAssemblyMethodThunk : ILStubMethod
{
public AssemblyGetExecutingAssemblyMethodThunk(TypeDesc owningType, IAssemblyDesc executingAssembly)
{
@@ -81,7 +81,7 @@ namespace Internal.IL.Stubs
}
}
- internal class AssemblyGetExecutingAssemblyMethodThunkCache
+ internal sealed class AssemblyGetExecutingAssemblyMethodThunkCache
{
private TypeDesc _owningTypeForThunks;
private Unifier _cache;
@@ -97,7 +97,7 @@ namespace Internal.IL.Stubs
return _cache.GetOrCreateValue(executingAssembly);
}
- private class Unifier : LockFreeReaderHashtable<IAssemblyDesc, AssemblyGetExecutingAssemblyMethodThunk>
+ private sealed class Unifier : LockFreeReaderHashtable<IAssemblyDesc, AssemblyGetExecutingAssemblyMethodThunk>
{
private AssemblyGetExecutingAssemblyMethodThunkCache _parent;
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/CalliMarshallingMethodThunk.Mangling.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/CalliMarshallingMethodThunk.Mangling.cs
index 95beb89a11a..fa3f8608f50 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/CalliMarshallingMethodThunk.Mangling.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/CalliMarshallingMethodThunk.Mangling.cs
@@ -1,7 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
using System.Diagnostics;
using Internal.TypeSystem;
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/CalliMarshallingMethodThunk.Sorting.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/CalliMarshallingMethodThunk.Sorting.cs
index cd6e620aa86..86bd6fce3f8 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/CalliMarshallingMethodThunk.Sorting.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/CalliMarshallingMethodThunk.Sorting.cs
@@ -6,7 +6,7 @@ using Internal.TypeSystem;
namespace Internal.IL.Stubs
{
// Functionality related to deterministic ordering of methods
- partial class CalliMarshallingMethodThunk
+ public partial class CalliMarshallingMethodThunk
{
protected override int ClassCode => 1594107963;
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/CalliMarshallingMethodThunk.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/CalliMarshallingMethodThunk.cs
index d0d397bafdf..23721ea8e1c 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/CalliMarshallingMethodThunk.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/CalliMarshallingMethodThunk.cs
@@ -1,11 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
using Internal.TypeSystem;
-using Internal.TypeSystem.Interop;
-using Debug = System.Diagnostics.Debug;
-using Internal.TypeSystem.Ecma;
namespace Internal.IL.Stubs
{
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/ComparerIntrinsics.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/ComparerIntrinsics.cs
index 91856de2d88..8f6cd67f9a6 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/ComparerIntrinsics.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/ComparerIntrinsics.cs
@@ -1,7 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
using System.Collections.Generic;
using Internal.TypeSystem;
@@ -165,7 +164,7 @@ namespace Internal.IL.Stubs
{
// This can be any of the comparers we have.
- ArrayBuilder<TypeDesc> universalComparers = new ArrayBuilder<TypeDesc>();
+ ArrayBuilder<TypeDesc> universalComparers = default(ArrayBuilder<TypeDesc>);
universalComparers.Add(context.SystemModule.GetKnownType("System.Collections.Generic", $"Nullable{flavor}`1")
.MakeInstantiatedType(type));
@@ -182,7 +181,7 @@ namespace Internal.IL.Stubs
return universalComparers.ToArray();
}
-
+
// This mirrors exactly what GetUnknownEquatableComparer and GetUnknownComparer (in the class library)
// will need at runtime. This is the general purpose code path that can be used to compare
// anything.
@@ -203,7 +202,7 @@ namespace Internal.IL.Stubs
.MakeInstantiatedType(type),
};
}
-
+
return new TypeDesc[]
{
context.SystemModule.GetKnownType("System.Collections.Generic", $"Generic{flavor}`1")
@@ -226,8 +225,7 @@ namespace Internal.IL.Stubs
if (interfaceInstantiation.Length == 1 &&
interfaceInstantiation[0] == type)
{
- if (interfaceType == null)
- interfaceType = type.Context.SystemModule.GetKnownType("System", interfaceName);
+ interfaceType ??= interfaceType = type.Context.SystemModule.GetKnownType("System", interfaceName);
if (implementedInterface.GetTypeDefinition() == interfaceType)
return true;
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/DelegateMarshallingMethodThunk.Mangling.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/DelegateMarshallingMethodThunk.Mangling.cs
index 0f8d28eb9e8..27dbb90c06c 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/DelegateMarshallingMethodThunk.Mangling.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/DelegateMarshallingMethodThunk.Mangling.cs
@@ -1,7 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
using Internal.TypeSystem;
namespace Internal.IL.Stubs
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/DelegateMarshallingMethodThunk.Sorting.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/DelegateMarshallingMethodThunk.Sorting.cs
index b38cd1fda8e..43d1c94a721 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/DelegateMarshallingMethodThunk.Sorting.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/DelegateMarshallingMethodThunk.Sorting.cs
@@ -6,7 +6,7 @@ using Internal.TypeSystem;
namespace Internal.IL.Stubs
{
// Functionality related to deterministic ordering of methods
- partial class DelegateMarshallingMethodThunk
+ public partial class DelegateMarshallingMethodThunk
{
protected override int ClassCode => 1018037605;
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/DelegateMarshallingMethodThunk.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/DelegateMarshallingMethodThunk.cs
index 5b098630690..368f19a79a7 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/DelegateMarshallingMethodThunk.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/DelegateMarshallingMethodThunk.cs
@@ -101,7 +101,7 @@ namespace Internal.IL.Stubs
}
}
- private TypeDesc GetNativeMethodParameterType(TypeDesc managedType, MarshalAsDescriptor marshalAs, InteropStateManager interopStateManager, bool isReturn, bool isAnsi)
+ private static TypeDesc GetNativeMethodParameterType(TypeDesc managedType, MarshalAsDescriptor marshalAs, InteropStateManager interopStateManager, bool isReturn, bool isAnsi)
{
TypeDesc nativeType;
try
@@ -156,7 +156,7 @@ namespace Internal.IL.Stubs
marshalAs = parameterMetadataArray[parameterIndex++].MarshalAsDescriptor;
}
- TypeDesc nativeReturnType = GetNativeMethodParameterType(delegateSignature.ReturnType,
+ TypeDesc nativeReturnType = GetNativeMethodParameterType(delegateSignature.ReturnType,
marshalAs,
_interopStateManager,
isReturn:true,
@@ -180,7 +180,7 @@ namespace Internal.IL.Stubs
var managedType = isByRefType ? delegateSignature[i].GetParameterType() : delegateSignature[i];
- var nativeType = GetNativeMethodParameterType(managedType,
+ var nativeType = GetNativeMethodParameterType(managedType,
marshalAs,
_interopStateManager,
isReturn:false,
@@ -231,8 +231,8 @@ namespace Internal.IL.Stubs
case DelegateMarshallingMethodThunkKind.ForwardNativeFunctionWrapper:
return "ForwardNativeFunctionWrapper";
default:
- System.Diagnostics.Debug.Fail("Unexpected DelegateMarshallingMethodThunkKind.");
- return String.Empty;
+ Debug.Fail("Unexpected DelegateMarshallingMethodThunkKind.");
+ return string.Empty;
}
}
}
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/DelegateThunks.Sorting.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/DelegateThunks.Sorting.cs
index 1126e01d402..fabf0153399 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/DelegateThunks.Sorting.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/DelegateThunks.Sorting.cs
@@ -6,7 +6,7 @@ using Internal.TypeSystem;
namespace Internal.IL.Stubs
{
// Functionality related to deterministic ordering of types
- partial class DelegateThunk
+ public partial class DelegateThunk
{
protected override int CompareToImpl(MethodDesc other, TypeSystemComparer comparer)
{
@@ -15,7 +15,7 @@ namespace Internal.IL.Stubs
}
}
- partial class DelegateInvokeOpenStaticThunk
+ public partial class DelegateInvokeOpenStaticThunk
{
protected override int ClassCode => 386356101;
}
@@ -25,27 +25,27 @@ namespace Internal.IL.Stubs
protected override int ClassCode => -1787190244;
}
- partial class DelegateInvokeClosedStaticThunk
+ public partial class DelegateInvokeClosedStaticThunk
{
protected override int ClassCode => 28195375;
}
- partial class DelegateInvokeMulticastThunk
+ public partial class DelegateInvokeMulticastThunk
{
protected override int ClassCode => 639863471;
}
- partial class DelegateInvokeInstanceClosedOverGenericMethodThunk
+ public partial class DelegateInvokeInstanceClosedOverGenericMethodThunk
{
protected override int ClassCode => -354480633;
}
- partial class DelegateInvokeObjectArrayThunk
+ public partial class DelegateInvokeObjectArrayThunk
{
protected override int ClassCode => 1993292344;
}
- partial class DelegateGetThunkMethodOverride
+ public partial class DelegateGetThunkMethodOverride
{
protected override int ClassCode => -321263379;
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/DelegateThunks.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/DelegateThunks.cs
index 55037d70fe8..99834d7cb23 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/DelegateThunks.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/DelegateThunks.cs
@@ -207,7 +207,7 @@ namespace Internal.IL.Stubs
codeStream.Emit(ILOpcode.box, emitter.NewToken(boxThisType));
}
}
-
+
codeStream.Emit(ILOpcode.call, emitter.NewToken(SystemDelegateType.GetKnownMethod("GetActualTargetFunctionPointer", null)));
MethodSignature targetSignature = new MethodSignature(0, 0, Signature.ReturnType, parameters);
@@ -346,7 +346,7 @@ namespace Internal.IL.Stubs
codeStream.EmitLdc(0);
codeStream.EmitStLoc(iteratorLocal);
- // Loop across every element of the array.
+ // Loop across every element of the array.
ILCodeLabel startOfLoopLabel = emitter.NewCodeLabel();
codeStream.EmitLabel(startOfLoopLabel);
@@ -494,7 +494,7 @@ namespace Internal.IL.Stubs
public override MethodIL EmitIL()
{
// We will generate the following code:
- //
+ //
// object ret;
// object[] args = new object[parameterCount];
// args[0] = param0;
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/DynamicInvokeMethodThunk.Mangling.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/DynamicInvokeMethodThunk.Mangling.cs
index 1c03c18928c..012da765943 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/DynamicInvokeMethodThunk.Mangling.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/DynamicInvokeMethodThunk.Mangling.cs
@@ -1,7 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
using Internal.TypeSystem;
namespace Internal.IL.Stubs
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/DynamicInvokeMethodThunk.Sorting.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/DynamicInvokeMethodThunk.Sorting.cs
index 3e67c728c74..0102dfc03b8 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/DynamicInvokeMethodThunk.Sorting.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/DynamicInvokeMethodThunk.Sorting.cs
@@ -1,15 +1,12 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
using Internal.TypeSystem;
-using Debug = System.Diagnostics.Debug;
-
namespace Internal.IL.Stubs
{
// Functionality related to deterministic ordering of types
- partial class DynamicInvokeMethodThunk
+ public partial class DynamicInvokeMethodThunk
{
protected override int ClassCode => -1980933220;
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/DynamicInvokeMethodThunk.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/DynamicInvokeMethodThunk.cs
index 50b446fabc3..ee50cc4f056 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/DynamicInvokeMethodThunk.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/DynamicInvokeMethodThunk.cs
@@ -1,15 +1,9 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-using System.Reflection.Emit;
-using System.Reflection;
-using System.Text;
-
using Internal.TypeSystem;
using Debug = System.Diagnostics.Debug;
-using Interlocked = System.Threading.Interlocked;
namespace Internal.IL.Stubs
{
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/EnumThunks.Sorting.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/EnumThunks.Sorting.cs
index 33b07a8e86f..b8b935da92f 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/EnumThunks.Sorting.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/EnumThunks.Sorting.cs
@@ -6,7 +6,7 @@ using Internal.TypeSystem;
namespace Internal.IL.Stubs
{
// Functionality related to deterministic ordering of types
- partial class EnumGetHashCodeThunk
+ internal partial class EnumGetHashCodeThunk
{
protected override int ClassCode => 261739662;
@@ -17,7 +17,7 @@ namespace Internal.IL.Stubs
}
}
- partial class EnumEqualsThunk
+ internal partial class EnumEqualsThunk
{
protected override int ClassCode => -1774524780;
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/EnumThunks.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/EnumThunks.cs
index dc8fba49876..f1eb89c48d5 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/EnumThunks.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/EnumThunks.cs
@@ -12,7 +12,7 @@ namespace Internal.IL.Stubs
/// This method prevents boxing of 'this' that would be required before a call to
/// the System.Enum's default implementation.
/// </summary>
- internal partial class EnumGetHashCodeThunk : ILStubMethod
+ internal sealed partial class EnumGetHashCodeThunk : ILStubMethod
{
private TypeDesc _owningType;
private MethodSignature _signature;
@@ -103,7 +103,7 @@ namespace Internal.IL.Stubs
/// This method prevents boxing of 'this' that would be required before a call to
/// the System.Enum's default implementation.
/// </summary>
- internal partial class EnumEqualsThunk : ILStubMethod
+ internal sealed partial class EnumEqualsThunk : ILStubMethod
{
private TypeDesc _owningType;
private MethodSignature _signature;
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/ForwardDelegateCreationThunk.Sorting.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/ForwardDelegateCreationThunk.Sorting.cs
index 66d5142caa2..8a1411a2624 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/ForwardDelegateCreationThunk.Sorting.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/ForwardDelegateCreationThunk.Sorting.cs
@@ -6,7 +6,7 @@ using Internal.TypeSystem;
namespace Internal.IL.Stubs
{
// Functionality related to deterministic ordering of types
- partial class ForwardDelegateCreationThunk
+ public partial class ForwardDelegateCreationThunk
{
protected override int ClassCode => 1026039617;
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/ForwardDelegateCreationThunk.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/ForwardDelegateCreationThunk.cs
index fd1e907f844..3dd0616af51 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/ForwardDelegateCreationThunk.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/ForwardDelegateCreationThunk.cs
@@ -1,11 +1,8 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
using Internal.TypeSystem;
using Internal.TypeSystem.Interop;
-using Debug = System.Diagnostics.Debug;
-using Internal.TypeSystem.Ecma;
namespace Internal.IL.Stubs
{
@@ -18,7 +15,7 @@ namespace Internal.IL.Stubs
private readonly MetadataType _delegateType;
private readonly InteropStateManager _interopStateManager;
private MethodSignature _signature;
-
+
public ForwardDelegateCreationThunk(MetadataType delegateType, TypeDesc owningType, InteropStateManager interopStateManager)
{
@@ -55,14 +52,11 @@ namespace Internal.IL.Stubs
{
get
{
- if (_signature == null)
- {
- _signature = new MethodSignature(MethodSignatureFlags.Static, 0,
+ _signature ??= new MethodSignature(MethodSignatureFlags.Static, 0,
DelegateType,
new TypeDesc[] {
Context.GetWellKnownType(WellKnownType.IntPtr)
});
- }
return _signature;
}
}
@@ -87,7 +81,7 @@ namespace Internal.IL.Stubs
/// This thunk creates a delegate from a native function pointer
/// by first creating a PInvokeDelegateWrapper from the function pointer
/// and then creating the delegate from the Invoke method of the wrapper
- ///
+ ///
/// Generated IL:
/// ldarg 0
/// newobj PInvokeDelegateWrapper.ctor
@@ -95,8 +89,8 @@ namespace Internal.IL.Stubs
/// ldvirtftn PInvokeDelegateWrapper.Invoke
/// newobj DelegateType.ctor
/// ret
- ///
- /// Equivalent C#
+ ///
+ /// Equivalent C#
/// return new DelegateType(new PInvokeDelegateWrapper(functionPointer).Invoke)
/// </summary>
public override MethodIL EmitIL()
@@ -116,8 +110,8 @@ namespace Internal.IL.Stubs
.GetPInvokeDelegateWrapperMethod(PInvokeDelegateWrapperMethodKind.Invoke)));
codeStream.Emit(ILOpcode.newobj, emitter.NewToken(
- _delegateType.GetMethod(".ctor",
- new MethodSignature(MethodSignatureFlags.None,
+ _delegateType.GetMethod(".ctor",
+ new MethodSignature(MethodSignatureFlags.None,
genericParameterCount: 0,
returnType: Context.GetWellKnownType(WellKnownType.Void),
parameters: new TypeDesc[] { Context.GetWellKnownType(WellKnownType.Object),
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/GetCanonTypeIntrinsic.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/GetCanonTypeIntrinsic.cs
index 5989185359f..9c44adad0d5 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/GetCanonTypeIntrinsic.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/GetCanonTypeIntrinsic.cs
@@ -1,8 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-
using Internal.Runtime;
using Internal.TypeSystem;
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/ILEmitter.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/ILEmitter.cs
index bc6985c43e6..b6f31e13014 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/ILEmitter.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/ILEmitter.cs
@@ -4,7 +4,6 @@
using System;
using System.Collections.Generic;
-using Internal.IL;
using Internal.TypeSystem;
using Debug = System.Diagnostics.Debug;
@@ -521,7 +520,7 @@ namespace Internal.IL.Stubs
internal int TryLength => _endTryStream.RelativeToAbsoluteOffset(_endTryOffset) - TryOffset;
internal int HandlerOffset => _beginHandlerStream.RelativeToAbsoluteOffset(_beginHandlerOffset);
internal int HandlerLength => _endHandlerStream.RelativeToAbsoluteOffset(_endHandlerOffset) - HandlerOffset;
-
+
internal bool IsDefined =>
_beginTryStream != null && _endTryStream != null
&& _beginHandlerStream != null && _endHandlerStream != null;
@@ -542,7 +541,7 @@ namespace Internal.IL.Stubs
{
private readonly byte[] _ilBytes;
private readonly LocalVariableDefinition[] _locals;
- private readonly Object[] _tokens;
+ private readonly object[] _tokens;
private readonly MethodDesc _method;
private readonly ILExceptionRegion[] _exceptionRegions;
private readonly MethodDebugInformation _debugInformation;
@@ -550,7 +549,7 @@ namespace Internal.IL.Stubs
private const int MaxStackNotSet = -1;
private int _maxStack;
- public ILStubMethodIL(MethodDesc owningMethod, byte[] ilBytes, LocalVariableDefinition[] locals, Object[] tokens, ILExceptionRegion[] exceptionRegions = null, MethodDebugInformation debugInfo = null)
+ public ILStubMethodIL(MethodDesc owningMethod, byte[] ilBytes, LocalVariableDefinition[] locals, object[] tokens, ILExceptionRegion[] exceptionRegions = null, MethodDebugInformation debugInfo = null)
{
_ilBytes = ilBytes;
_locals = locals;
@@ -558,12 +557,10 @@ namespace Internal.IL.Stubs
_method = owningMethod;
_maxStack = MaxStackNotSet;
- if (exceptionRegions == null)
- exceptionRegions = Array.Empty<ILExceptionRegion>();
+ exceptionRegions ??= Array.Empty<ILExceptionRegion>();
_exceptionRegions = exceptionRegions;
- if (debugInfo == null)
- debugInfo = MethodDebugInformation.None;
+ debugInfo ??= MethodDebugInformation.None;
_debugInformation = debugInfo;
}
@@ -622,7 +619,7 @@ namespace Internal.IL.Stubs
{
return _locals;
}
- public override Object GetObject(int token, NotFoundBehavior notFoundBehavior)
+ public override object GetObject(int token, NotFoundBehavior notFoundBehavior)
{
return _tokens[(token & 0xFFFFFF) - 1];
}
@@ -666,7 +663,7 @@ namespace Internal.IL.Stubs
{
private ArrayBuilder<ILCodeStream> _codeStreams;
private ArrayBuilder<LocalVariableDefinition> _locals;
- private ArrayBuilder<Object> _tokens;
+ private ArrayBuilder<object> _tokens;
private ArrayBuilder<ILExceptionRegionBuilder> _finallyRegions;
public ILEmitter()
@@ -680,7 +677,7 @@ namespace Internal.IL.Stubs
return stream;
}
- private ILToken NewToken(Object value, int tokenType)
+ private ILToken NewToken(object value, int tokenType)
{
Debug.Assert(value != null);
_tokens.Add(value);
@@ -802,7 +799,7 @@ namespace Internal.IL.Stubs
return result;
}
- private class EmittedMethodDebugInformation : MethodDebugInformation
+ private sealed class EmittedMethodDebugInformation : MethodDebugInformation
{
private readonly ILSequencePoint[] _sequencePoints;
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/InterlockedIntrinsics.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/InterlockedIntrinsics.cs
index 25523f68b10..7f0a8d2f191 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/InterlockedIntrinsics.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/InterlockedIntrinsics.cs
@@ -1,7 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
using Internal.TypeSystem;
using Debug = System.Diagnostics.Debug;
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/MemoryMarshalIntrinsics.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/MemoryMarshalIntrinsics.cs
index de2c2712827..aaa56db0888 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/MemoryMarshalIntrinsics.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/MemoryMarshalIntrinsics.cs
@@ -1,7 +1,8 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-
+#if READYTORUN
using ILCompiler;
+#endif
using Internal.TypeSystem;
using Debug = System.Diagnostics.Debug;
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/MethodBaseGetCurrentMethodThunk.Mangling.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/MethodBaseGetCurrentMethodThunk.Mangling.cs
index 868ffc7c759..1aeb7468376 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/MethodBaseGetCurrentMethodThunk.Mangling.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/MethodBaseGetCurrentMethodThunk.Mangling.cs
@@ -5,7 +5,7 @@ using Internal.TypeSystem;
namespace Internal.IL.Stubs
{
- partial class MethodBaseGetCurrentMethodThunk : IPrefixMangledMethod
+ internal partial class MethodBaseGetCurrentMethodThunk : IPrefixMangledMethod
{
MethodDesc IPrefixMangledMethod.BaseMethod
{
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/MethodBaseGetCurrentMethodThunk.Sorting.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/MethodBaseGetCurrentMethodThunk.Sorting.cs
index d3afe93c396..072225e0479 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/MethodBaseGetCurrentMethodThunk.Sorting.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/MethodBaseGetCurrentMethodThunk.Sorting.cs
@@ -6,7 +6,7 @@ using Internal.TypeSystem;
namespace Internal.IL.Stubs
{
// Functionality related to deterministic ordering of types
- partial class MethodBaseGetCurrentMethodThunk
+ internal partial class MethodBaseGetCurrentMethodThunk
{
protected override int ClassCode => 1889524798;
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/MethodBaseGetCurrentMethodThunk.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/MethodBaseGetCurrentMethodThunk.cs
index 82a729dc3eb..eaed268049d 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/MethodBaseGetCurrentMethodThunk.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/MethodBaseGetCurrentMethodThunk.cs
@@ -12,7 +12,7 @@ namespace Internal.IL.Stubs
/// is to LDTOKEN the method considered "current method" and call into the class library to
/// retrieve the associated MethodBase object instance.
/// </summary>
- internal partial class MethodBaseGetCurrentMethodThunk : ILStubMethod
+ internal sealed partial class MethodBaseGetCurrentMethodThunk : ILStubMethod
{
public MethodBaseGetCurrentMethodThunk(MethodDesc method)
{
@@ -90,7 +90,7 @@ namespace Internal.IL.Stubs
}
}
- internal class MethodBaseGetCurrentMethodThunkCache
+ internal sealed class MethodBaseGetCurrentMethodThunkCache
{
private Unifier _cache;
@@ -104,7 +104,7 @@ namespace Internal.IL.Stubs
return _cache.GetOrCreateValue(currentMethod.GetTypicalMethodDefinition());
}
- private class Unifier : LockFreeReaderHashtable<MethodDesc, MethodBaseGetCurrentMethodThunk>
+ private sealed class Unifier : LockFreeReaderHashtable<MethodDesc, MethodBaseGetCurrentMethodThunk>
{
protected override int GetKeyHashCode(MethodDesc key)
{
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/PInvokeILCodeStreams.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/PInvokeILCodeStreams.cs
index 1ad547dbb46..2a8aa221ce2 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/PInvokeILCodeStreams.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/PInvokeILCodeStreams.cs
@@ -22,9 +22,9 @@ namespace Internal.IL.Stubs
// store that into the local
// - CallsiteSetupCodeStream is used to used to load each previously generated local
// and call the actual target native method.
- // - ReturnValueMarshallingCodeStream is used to convert the native return value
+ // - ReturnValueMarshallingCodeStream is used to convert the native return value
// to managed one.
- // - UnmarshallingCodestream is used to propagate [out] native arguments values to
+ // - UnmarshallingCodestream is used to propagate [out] native arguments values to
// managed ones.
// - CleanupCodestream is used to perform a guaranteed cleanup
FunctionPointerLoadStream = Emitter.NewCodeStream();
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/PInvokeILEmitter.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/PInvokeILEmitter.cs
index 9d89ea53146..42c25c1eee9 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/PInvokeILEmitter.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/PInvokeILEmitter.cs
@@ -444,7 +444,7 @@ namespace Internal.IL.Stubs
}
catch (InvalidProgramException ex)
{
- Debug.Assert(!String.IsNullOrEmpty(ex.Message));
+ Debug.Assert(!string.IsNullOrEmpty(ex.Message));
return MarshalHelpers.EmitExceptionBody(ex.Message, method);
}
}
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/PInvokeLazyFixupField.Sorting.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/PInvokeLazyFixupField.Sorting.cs
index d3156fbefb2..75534099192 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/PInvokeLazyFixupField.Sorting.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/PInvokeLazyFixupField.Sorting.cs
@@ -5,7 +5,7 @@ using Internal.TypeSystem;
namespace Internal.IL.Stubs
{
- partial class PInvokeLazyFixupField
+ public partial class PInvokeLazyFixupField
{
protected override int ClassCode => -1784477702;
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/PInvokeTargetNativeMethod.Diagnostic.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/PInvokeTargetNativeMethod.Diagnostic.cs
index 66be6d96544..940710e5078 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/PInvokeTargetNativeMethod.Diagnostic.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/PInvokeTargetNativeMethod.Diagnostic.cs
@@ -1,11 +1,9 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using Internal.TypeSystem;
-
namespace Internal.IL.Stubs
{
- partial class PInvokeTargetNativeMethod
+ public partial class PInvokeTargetNativeMethod
{
public override string DiagnosticName
{
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/PInvokeTargetNativeMethod.Mangling.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/PInvokeTargetNativeMethod.Mangling.cs
index 0840a5856fa..34ec3ed4ec3 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/PInvokeTargetNativeMethod.Mangling.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/PInvokeTargetNativeMethod.Mangling.cs
@@ -5,7 +5,7 @@ using Internal.TypeSystem;
namespace Internal.IL.Stubs
{
- partial class PInvokeTargetNativeMethod : IPrefixMangledMethod
+ public partial class PInvokeTargetNativeMethod : IPrefixMangledMethod
{
MethodDesc IPrefixMangledMethod.BaseMethod
{
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/PInvokeTargetNativeMethod.Sorting.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/PInvokeTargetNativeMethod.Sorting.cs
index da12ad0a8b2..40449fc96b9 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/PInvokeTargetNativeMethod.Sorting.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/PInvokeTargetNativeMethod.Sorting.cs
@@ -6,7 +6,7 @@ using Internal.TypeSystem;
namespace Internal.IL.Stubs
{
// Functionality related to deterministic ordering of types
- partial class PInvokeTargetNativeMethod
+ public partial class PInvokeTargetNativeMethod
{
protected internal override int ClassCode => -1626939381;
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/PInvokeTargetNativeMethod.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/PInvokeTargetNativeMethod.cs
index 5683eee0429..0e3eaeae12e 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/PInvokeTargetNativeMethod.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/PInvokeTargetNativeMethod.cs
@@ -14,7 +14,7 @@ namespace Internal.IL.Stubs
{
private readonly MethodDesc _declMethod;
private readonly MethodSignature _signature;
-
+
public MethodDesc Target
{
get
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/RuntimeHelpersIntrinsics.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/RuntimeHelpersIntrinsics.cs
index 53af0f37161..b8e1a23ca21 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/RuntimeHelpersIntrinsics.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/RuntimeHelpersIntrinsics.cs
@@ -96,4 +96,3 @@ namespace Internal.IL.Stubs
}
}
}
-
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/StreamIntrinsics.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/StreamIntrinsics.cs
index 292e0240c67..fc28505f84c 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/StreamIntrinsics.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/StreamIntrinsics.cs
@@ -1,8 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-
using Internal.TypeSystem;
using Debug = System.Diagnostics.Debug;
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/StructMarshallingThunk.Sorting.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/StructMarshallingThunk.Sorting.cs
index 0cbb4f7e7c6..99365af5d86 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/StructMarshallingThunk.Sorting.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/StructMarshallingThunk.Sorting.cs
@@ -6,7 +6,7 @@ using Internal.TypeSystem;
namespace Internal.IL.Stubs
{
// Functionality related to deterministic ordering of types
- partial class StructMarshallingThunk
+ public partial class StructMarshallingThunk
{
protected override int ClassCode => 340834018;
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/StructMarshallingThunk.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/StructMarshallingThunk.cs
index 2751290f0c9..f8025e77c20 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/StructMarshallingThunk.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/StructMarshallingThunk.cs
@@ -90,7 +90,7 @@ namespace Internal.IL.Stubs
};
break;
default:
- System.Diagnostics.Debug.Fail("Unexpected Struct marshalling thunk type");
+ Debug.Fail("Unexpected Struct marshalling thunk type");
break;
}
_signature = new MethodSignature(MethodSignatureFlags.Static, 0, Context.GetWellKnownType(WellKnownType.Void), parameters);
@@ -112,7 +112,7 @@ namespace Internal.IL.Stubs
case StructMarshallingThunkType.Cleanup:
return "Cleanup";
default:
- System.Diagnostics.Debug.Fail("Unexpected Struct marshalling thunk type");
+ Debug.Fail("Unexpected Struct marshalling thunk type");
return string.Empty;
}
}
@@ -148,7 +148,7 @@ namespace Internal.IL.Stubs
Marshaller[] marshallers = new Marshaller[numInstanceFields];
- PInvokeFlags flags = new PInvokeFlags();
+ PInvokeFlags flags = default(PInvokeFlags);
if (ManagedType.PInvokeStringFormat == PInvokeStringFormat.UnicodeClass || ManagedType.PInvokeStringFormat == PInvokeStringFormat.AutoClass)
{
flags.CharSet = CharSet.Unicode;
@@ -203,17 +203,17 @@ namespace Internal.IL.Stubs
}
bool notEmpty = nativeEnumerator.MoveNext();
- Debug.Assert(notEmpty == true);
+ Debug.Assert(notEmpty);
var nativeField = nativeEnumerator.Current;
Debug.Assert(nativeField != null);
bool isInlineArray = nativeField.FieldType is InlineArrayType;
//
- // Field marshallers expects the value of the fields to be
+ // Field marshallers expects the value of the fields to be
// loaded on the stack. We load the value on the stack
// before calling the marshallers.
// Only exception is ByValArray marshallers. Since they can
- // only be used for field marshalling, they load/store values
+ // only be used for field marshalling, they load/store values
// directly from arguments.
//
@@ -270,7 +270,7 @@ namespace Internal.IL.Stubs
}
bool notEmpty = nativeEnumerator.MoveNext();
- Debug.Assert(notEmpty == true);
+ Debug.Assert(notEmpty);
var nativeField = nativeEnumerator.Current;
Debug.Assert(nativeField != null);
@@ -310,7 +310,7 @@ namespace Internal.IL.Stubs
}
catch (InvalidProgramException ex)
{
- Debug.Assert(!String.IsNullOrEmpty(ex.Message));
+ Debug.Assert(!string.IsNullOrEmpty(ex.Message));
return MarshalHelpers.EmitExceptionBody(ex.Message, this);
}
}
@@ -318,7 +318,7 @@ namespace Internal.IL.Stubs
/// <summary>
/// Loads the value of field of a struct at argument index argIndex to stack
/// </summary>
- private void LoadFieldValueFromArg(int argIndex, FieldDesc field, PInvokeILCodeStreams pInvokeILCodeStreams)
+ private static void LoadFieldValueFromArg(int argIndex, FieldDesc field, PInvokeILCodeStreams pInvokeILCodeStreams)
{
ILCodeStream stream = pInvokeILCodeStreams.MarshallingCodeStream;
ILEmitter emitter = pInvokeILCodeStreams.Emitter;
@@ -326,7 +326,7 @@ namespace Internal.IL.Stubs
stream.Emit(ILOpcode.ldfld, emitter.NewToken(field));
}
- private void StoreFieldValueFromArg(int argIndex, FieldDesc field, PInvokeILCodeStreams pInvokeILCodeStreams)
+ private static void StoreFieldValueFromArg(int argIndex, FieldDesc field, PInvokeILCodeStreams pInvokeILCodeStreams)
{
ILCodeStream stream = pInvokeILCodeStreams.MarshallingCodeStream;
ILEmitter emitter = pInvokeILCodeStreams.Emitter;
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/TypeGetTypeMethodThunk.Sorting.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/TypeGetTypeMethodThunk.Sorting.cs
index c99a3ff3b40..ceb658e3bd8 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/TypeGetTypeMethodThunk.Sorting.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/TypeGetTypeMethodThunk.Sorting.cs
@@ -8,7 +8,7 @@ using Internal.TypeSystem;
namespace Internal.IL.Stubs
{
// Functionality related to deterministic ordering of types
- partial class TypeGetTypeMethodThunk
+ internal partial class TypeGetTypeMethodThunk
{
protected override int ClassCode => -949164050;
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/TypeGetTypeMethodThunk.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/TypeGetTypeMethodThunk.cs
index 7e7a9133b13..48db579f5ea 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/TypeGetTypeMethodThunk.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/TypeGetTypeMethodThunk.cs
@@ -12,7 +12,7 @@ namespace Internal.IL.Stubs
/// the calling assembly for a matching type if the type name supplied by the user code was not assembly qualified.
/// This thunk calls a helper method, passing it a string for what should be considered the "calling assembly".
/// </summary>
- internal partial class TypeGetTypeMethodThunk : ILStubMethod
+ internal sealed partial class TypeGetTypeMethodThunk : ILStubMethod
{
private readonly MethodDesc _helperMethod;
@@ -104,7 +104,7 @@ namespace Internal.IL.Stubs
}
}
- internal class TypeGetTypeMethodThunkCache
+ internal sealed class TypeGetTypeMethodThunkCache
{
private TypeDesc _owningTypeForThunks;
private Unifier _cache;
@@ -132,7 +132,7 @@ namespace Internal.IL.Stubs
}
}
- private class Unifier : LockFreeReaderHashtable<Key, TypeGetTypeMethodThunk>
+ private sealed class Unifier : LockFreeReaderHashtable<Key, TypeGetTypeMethodThunk>
{
private TypeGetTypeMethodThunkCache _parent;
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/UnsafeIntrinsics.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/UnsafeIntrinsics.cs
index c371ec782fe..f2567177349 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/UnsafeIntrinsics.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/UnsafeIntrinsics.cs
@@ -81,7 +81,7 @@ namespace Internal.IL.Stubs
case "IsNullRef":
return new ILStubMethodIL(method, new byte[]
{
- (byte)ILOpcode.ldarg_0,
+ (byte)ILOpcode.ldarg_0,
(byte)ILOpcode.ldc_i4_0, (byte)ILOpcode.conv_u,
(byte)ILOpcode.prefix1, unchecked((byte)ILOpcode.ceq),
(byte)ILOpcode.ret }, Array.Empty<LocalVariableDefinition>(), null);
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/ValueTypeGetFieldHelperMethodOverride.Sorting.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/ValueTypeGetFieldHelperMethodOverride.Sorting.cs
index e12b3bc4156..2a650a278e2 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/ValueTypeGetFieldHelperMethodOverride.Sorting.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/ValueTypeGetFieldHelperMethodOverride.Sorting.cs
@@ -5,7 +5,7 @@ using Internal.TypeSystem;
namespace Internal.IL.Stubs
{
- partial class ValueTypeGetFieldHelperMethodOverride
+ public partial class ValueTypeGetFieldHelperMethodOverride
{
protected override int ClassCode => 2036839816;
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/ValueTypeGetFieldHelperMethodOverride.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/ValueTypeGetFieldHelperMethodOverride.cs
index 76c9184d4e6..9bb60e317e2 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/ValueTypeGetFieldHelperMethodOverride.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/ValueTypeGetFieldHelperMethodOverride.cs
@@ -71,7 +71,7 @@ namespace Internal.IL.Stubs
var switchStream = emitter.NewCodeStream();
var getFieldStream = emitter.NewCodeStream();
- ArrayBuilder<ILCodeLabel> fieldGetters = new ArrayBuilder<ILCodeLabel>();
+ ArrayBuilder<ILCodeLabel> fieldGetters = default(ArrayBuilder<ILCodeLabel>);
foreach (FieldDesc field in owningType.GetFields())
{
if (field.IsStatic)
@@ -120,7 +120,7 @@ namespace Internal.IL.Stubs
}
switchStream.EmitLdc(fieldGetters.Count);
-
+
switchStream.Emit(ILOpcode.ret);
return emitter.Link(this);
diff --git a/src/coreclr/tools/Common/TypeSystem/Interop/FieldDesc.Interop.cs b/src/coreclr/tools/Common/TypeSystem/Interop/FieldDesc.Interop.cs
index ad5a51232d7..e12791ba2d7 100644
--- a/src/coreclr/tools/Common/TypeSystem/Interop/FieldDesc.Interop.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Interop/FieldDesc.Interop.cs
@@ -3,7 +3,7 @@
namespace Internal.TypeSystem
{
- partial class FieldDesc
+ public partial class FieldDesc
{
/// <summary>
/// Returns description of how the field should be marshalled to native code.
@@ -14,7 +14,7 @@ namespace Internal.TypeSystem
}
}
- partial class FieldForInstantiatedType
+ public partial class FieldForInstantiatedType
{
public override MarshalAsDescriptor GetMarshalAsDescriptor()
{
diff --git a/src/coreclr/tools/Common/TypeSystem/Interop/IL/InlineArrayType.Sorting.cs b/src/coreclr/tools/Common/TypeSystem/Interop/IL/InlineArrayType.Sorting.cs
index a6d57faa45a..ca637423c2c 100644
--- a/src/coreclr/tools/Common/TypeSystem/Interop/IL/InlineArrayType.Sorting.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Interop/IL/InlineArrayType.Sorting.cs
@@ -4,7 +4,7 @@
namespace Internal.TypeSystem.Interop
{
// Functionality related to deterministic ordering of types
- partial class InlineArrayType
+ internal partial class InlineArrayType
{
protected override int ClassCode => 226817075;
@@ -18,7 +18,7 @@ namespace Internal.TypeSystem.Interop
return comparer.Compare(ElementType, otherType.ElementType);
}
- partial class InlineArrayMethod
+ private partial class InlineArrayMethod
{
protected override int ClassCode => -1303220581;
@@ -34,7 +34,7 @@ namespace Internal.TypeSystem.Interop
}
}
- partial class InlineArrayField
+ private partial class InlineArrayField
{
protected override int ClassCode => 1542668652;
diff --git a/src/coreclr/tools/Common/TypeSystem/Interop/IL/InlineArrayType.cs b/src/coreclr/tools/Common/TypeSystem/Interop/IL/InlineArrayType.cs
index 51ac01f9a2f..512cad4be34 100644
--- a/src/coreclr/tools/Common/TypeSystem/Interop/IL/InlineArrayType.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Interop/IL/InlineArrayType.cs
@@ -173,7 +173,7 @@ namespace Internal.TypeSystem.Interop
public override ClassLayoutMetadata GetClassLayout()
{
- ClassLayoutMetadata result = new ClassLayoutMetadata();
+ ClassLayoutMetadata result = default(ClassLayoutMetadata);
result.PackingSize = 0;
result.Size = checked((int)Length * ElementType.GetElementSize().AsInt);
return result;
@@ -329,7 +329,7 @@ namespace Internal.TypeSystem.Interop
{
return "get_Item";
}
- else
+ else
{
return "set_Item";
}
@@ -352,9 +352,9 @@ namespace Internal.TypeSystem.Interop
{
if (_kind == InlineArrayMethodKind.Getter)
{
- _signature = new MethodSignature(MethodSignatureFlags.None,
- genericParameterCount: 0,
- returnType: _owningType.ElementType,
+ _signature = new MethodSignature(MethodSignatureFlags.None,
+ genericParameterCount: 0,
+ returnType: _owningType.ElementType,
parameters: new TypeDesc[] { Context.GetWellKnownType(WellKnownType.Int32) });
}
else
@@ -373,10 +373,7 @@ namespace Internal.TypeSystem.Interop
{
var emitter = new ILEmitter();
var codeStream = emitter.NewCodeStream();
- var lIntermediate = emitter.NewCodeLabel();
- var lCheck = emitter.NewCodeLabel();
- var lValid = emitter.NewCodeLabel();
- var vFlag = emitter.NewLocal(Context.GetWellKnownType(WellKnownType.Boolean));
+ _ = emitter.NewLocal(Context.GetWellKnownType(WellKnownType.Boolean));
var elementType = _owningType.ElementType;
// Getter:
diff --git a/src/coreclr/tools/Common/TypeSystem/Interop/IL/MarshalHelpers.Aot.cs b/src/coreclr/tools/Common/TypeSystem/Interop/IL/MarshalHelpers.Aot.cs
index b047f29e9ec..29abb9313ea 100644
--- a/src/coreclr/tools/Common/TypeSystem/Interop/IL/MarshalHelpers.Aot.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Interop/IL/MarshalHelpers.Aot.cs
@@ -1,8 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-
using Internal.IL;
using Internal.IL.Stubs;
@@ -51,7 +49,7 @@ namespace Internal.TypeSystem.Interop
internal static TypeDesc GetNativeMethodParameterType(TypeDesc type, MarshalAsDescriptor marshalAs, InteropStateManager interopStateManager, bool isReturn, bool isAnsi)
{
MarshallerKind elementMarshallerKind;
- MarshallerKind marshallerKind = MarshalHelpers.GetMarshallerKind(type,
+ MarshallerKind marshallerKind = GetMarshallerKind(type,
null, /* parameterIndex */
null, /* customModifierData */
marshalAs,
@@ -70,7 +68,7 @@ namespace Internal.TypeSystem.Interop
internal static TypeDesc GetNativeStructFieldType(TypeDesc type, MarshalAsDescriptor marshalAs, InteropStateManager interopStateManager, bool isAnsi)
{
MarshallerKind elementMarshallerKind;
- MarshallerKind marshallerKind = MarshalHelpers.GetMarshallerKind(type,
+ MarshallerKind marshallerKind = GetMarshallerKind(type,
null, /* parameterIndex */
null, /* customModifierData */
marshalAs,
diff --git a/src/coreclr/tools/Common/TypeSystem/Interop/IL/MarshalHelpers.cs b/src/coreclr/tools/Common/TypeSystem/Interop/IL/MarshalHelpers.cs
index eac31ec115d..ebcaee6ddfe 100644
--- a/src/coreclr/tools/Common/TypeSystem/Interop/IL/MarshalHelpers.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Interop/IL/MarshalHelpers.cs
@@ -2,9 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
using System;
-using Internal.IL;
using Debug = System.Diagnostics.Debug;
-using Internal.IL.Stubs;
using Internal.TypeSystem.Ecma;
namespace Internal.TypeSystem.Interop
diff --git a/src/coreclr/tools/Common/TypeSystem/Interop/IL/MarshalUtils.cs b/src/coreclr/tools/Common/TypeSystem/Interop/IL/MarshalUtils.cs
index 33c609ee23b..fcc954bc8f9 100644
--- a/src/coreclr/tools/Common/TypeSystem/Interop/IL/MarshalUtils.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Interop/IL/MarshalUtils.cs
@@ -1,8 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-
namespace Internal.TypeSystem.Interop
{
public static class MarshalUtils
diff --git a/src/coreclr/tools/Common/TypeSystem/Interop/IL/Marshaller.Aot.cs b/src/coreclr/tools/Common/TypeSystem/Interop/IL/Marshaller.Aot.cs
index c001032f312..f35e028ff49 100644
--- a/src/coreclr/tools/Common/TypeSystem/Interop/IL/Marshaller.Aot.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Interop/IL/Marshaller.Aot.cs
@@ -3,7 +3,6 @@
using System;
using System.Buffers.Binary;
-using System.Runtime.InteropServices;
using Internal.IL.Stubs;
using Internal.IL;
@@ -14,7 +13,7 @@ using System.Reflection.Metadata;
namespace Internal.TypeSystem.Interop
{
- partial class Marshaller
+ internal partial class Marshaller
{
protected static Marshaller CreateMarshaller(MarshallerKind kind)
{
@@ -104,7 +103,7 @@ namespace Internal.TypeSystem.Interop
}
}
- class AnsiCharArrayMarshaller : ArrayMarshaller
+ internal sealed class AnsiCharArrayMarshaller : ArrayMarshaller
{
protected override void AllocManagedToNative(ILCodeStream codeStream)
{
@@ -141,7 +140,7 @@ namespace Internal.TypeSystem.Interop
}
}
- class AnsiCharMarshaller : Marshaller
+ internal sealed class AnsiCharMarshaller : Marshaller
{
protected override void AllocAndTransformManagedToNative(ILCodeStream codeStream)
{
@@ -166,7 +165,7 @@ namespace Internal.TypeSystem.Interop
}
}
- class StringBuilderMarshaller : Marshaller
+ internal sealed class StringBuilderMarshaller : Marshaller
{
private bool _isAnsi;
public StringBuilderMarshaller(bool isAnsi)
@@ -250,7 +249,7 @@ namespace Internal.TypeSystem.Interop
}
}
- class HandleRefMarshaller : Marshaller
+ internal sealed class HandleRefMarshaller : Marshaller
{
protected override void AllocAndTransformManagedToNative(ILCodeStream codeStream)
{
@@ -277,7 +276,7 @@ namespace Internal.TypeSystem.Interop
}
}
- class StructMarshaller : Marshaller
+ internal sealed class StructMarshaller : Marshaller
{
protected override void AllocManagedToNative(ILCodeStream codeStream)
{
@@ -315,7 +314,7 @@ namespace Internal.TypeSystem.Interop
}
}
- class ByValArrayMarshaller : ArrayMarshaller
+ internal class ByValArrayMarshaller : ArrayMarshaller
{
protected FieldDesc _managedField;
protected FieldDesc _nativeField;
@@ -542,11 +541,10 @@ namespace Internal.TypeSystem.Interop
}
}
- abstract class ByValStringMarshaller : ByValArrayMarshaller
+ internal abstract class ByValStringMarshaller : ByValArrayMarshaller
{
protected override void EmitElementCount(ILCodeStream codeStream, MarshalDirection direction)
{
- ILEmitter emitter = _ilCodeStreams.Emitter;
if (MarshalAsDescriptor == null || !MarshalAsDescriptor.SizeConst.HasValue)
{
throw new InvalidProgramException("SizeConst is required for ByValString.");
@@ -608,7 +606,7 @@ namespace Internal.TypeSystem.Interop
}
}
- class ByValAnsiStringMarshaller : ByValStringMarshaller
+ internal sealed class ByValAnsiStringMarshaller : ByValStringMarshaller
{
protected override bool IsAnsi
{
@@ -629,7 +627,7 @@ namespace Internal.TypeSystem.Interop
}
}
- class ByValUnicodeStringMarshaller : ByValStringMarshaller
+ internal sealed class ByValUnicodeStringMarshaller : ByValStringMarshaller
{
protected override bool IsAnsi
{
@@ -650,7 +648,7 @@ namespace Internal.TypeSystem.Interop
}
}
- class LayoutClassMarshaler : Marshaller
+ internal sealed class LayoutClassMarshaler : Marshaller
{
protected override void AllocManagedToNative(ILCodeStream codeStream)
{
@@ -710,7 +708,7 @@ namespace Internal.TypeSystem.Interop
}
}
- class LayoutClassPtrMarshaller : Marshaller
+ internal sealed class LayoutClassPtrMarshaller : Marshaller
{
protected override void AllocManagedToNative(ILCodeStream codeStream)
{
@@ -801,7 +799,7 @@ namespace Internal.TypeSystem.Interop
}
}
- class AsAnyMarshaller : Marshaller
+ internal sealed class AsAnyMarshaller : Marshaller
{
// This flag affects encoding of string, StringBuilder and Char array marshalling.
// It does not affect LayoutClass marshalling.
@@ -893,7 +891,7 @@ namespace Internal.TypeSystem.Interop
}
}
- class ComInterfaceMarshaller : Marshaller
+ internal sealed class ComInterfaceMarshaller : Marshaller
{
protected override void AllocAndTransformManagedToNative(ILCodeStream codeStream)
{
@@ -965,7 +963,7 @@ namespace Internal.TypeSystem.Interop
}
}
- class AnsiBSTRStringMarshaller : Marshaller
+ internal sealed class AnsiBSTRStringMarshaller : Marshaller
{
internal override bool CleanupRequired => true;
@@ -998,7 +996,7 @@ namespace Internal.TypeSystem.Interop
}
}
- class BSTRStringMarshaller : Marshaller
+ internal sealed class BSTRStringMarshaller : Marshaller
{
internal override bool CleanupRequired => true;
@@ -1031,7 +1029,7 @@ namespace Internal.TypeSystem.Interop
}
}
- class OleDateTimeMarshaller : Marshaller
+ internal sealed class OleDateTimeMarshaller : Marshaller
{
protected override void TransformManagedToNative(ILCodeStream codeStream)
{
@@ -1056,7 +1054,7 @@ namespace Internal.TypeSystem.Interop
}
}
- class OleCurrencyMarshaller : Marshaller
+ internal sealed class OleCurrencyMarshaller : Marshaller
{
protected override void TransformManagedToNative(ILCodeStream codeStream)
{
@@ -1081,7 +1079,7 @@ namespace Internal.TypeSystem.Interop
}
}
- class FailedTypeLoadMarshaller : Marshaller
+ internal sealed class FailedTypeLoadMarshaller : Marshaller
{
protected override void TransformManagedToNative(ILCodeStream codeStream)
{
@@ -1094,7 +1092,7 @@ namespace Internal.TypeSystem.Interop
}
}
- class VariantMarshaller : Marshaller
+ internal sealed class VariantMarshaller : Marshaller
{
protected override void AllocManagedToNative(ILCodeStream codeStream)
{
@@ -1150,8 +1148,9 @@ namespace Internal.TypeSystem.Interop
codeStream.Emit(ILOpcode.call, emitter.NewToken(helper));
}
}
-
- class CustomTypeMarshaller : Marshaller
+#pragma warning disable CA1852
+ internal class CustomTypeMarshaller : Marshaller
+#pragma warning restore CA1852
{
private ILLocalVariable MarshallerLocalVariable = (ILLocalVariable)(-1);
@@ -1283,7 +1282,7 @@ namespace Internal.TypeSystem.Interop
}
}
- class BlittableValueClassByRefReturn : Marshaller
+ internal sealed class BlittableValueClassByRefReturn : Marshaller
{
protected override void SetupArgumentsForReturnValueMarshalling()
{
diff --git a/src/coreclr/tools/Common/TypeSystem/Interop/IL/Marshaller.cs b/src/coreclr/tools/Common/TypeSystem/Interop/IL/Marshaller.cs
index 06d839390d1..a7d62d1c422 100644
--- a/src/coreclr/tools/Common/TypeSystem/Interop/IL/Marshaller.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Interop/IL/Marshaller.cs
@@ -20,7 +20,7 @@ namespace Internal.TypeSystem.Interop
// Each type of marshaller knows how to generate the marshalling code for the argument it marshals.
// Marshallers contain method related marshalling information (which is common to all the Marshallers)
// and also argument specific marshalling information.
- abstract partial class Marshaller
+ internal abstract partial class Marshaller
{
#region Instance state information
public TypeSystemContext Context;
@@ -111,7 +111,7 @@ namespace Internal.TypeSystem.Interop
protected Home _nativeHome;
#endregion
- enum HomeType
+ private enum HomeType
{
Arg,
Local,
@@ -122,7 +122,7 @@ namespace Internal.TypeSystem.Interop
/// <summary>
/// Abstraction for handling by-ref and non-by-ref locals/arguments
/// </summary>
- internal class Home
+ internal sealed class Home
{
public Home(ILLocalVariable var, TypeDesc type, bool isByRef)
{
@@ -203,10 +203,10 @@ namespace Internal.TypeSystem.Interop
}
}
- HomeType _homeType;
- TypeDesc _type;
- ILLocalVariable _var;
- int _argIndex;
+ private HomeType _homeType;
+ private TypeDesc _type;
+ private ILLocalVariable _var;
+ private int _argIndex;
}
#region Creation of marshallers
@@ -489,7 +489,6 @@ namespace Internal.TypeSystem.Interop
protected virtual void EmitMarshalReturnValueManagedToNative()
{
- ILEmitter emitter = _ilCodeStreams.Emitter;
SetupArgumentsForReturnValueMarshalling();
StoreNativeValue(_ilCodeStreams.ReturnValueMarshallingCodeStream);
@@ -757,7 +756,6 @@ namespace Internal.TypeSystem.Interop
protected virtual void EmitMarshalReturnValueNativeToManaged()
{
- ILEmitter emitter = _ilCodeStreams.Emitter;
SetupArgumentsForReturnValueMarshalling();
StoreManagedValue(_ilCodeStreams.ReturnValueMarshallingCodeStream);
@@ -805,7 +803,6 @@ namespace Internal.TypeSystem.Interop
protected virtual void EmitMarshalElementManagedToNative()
{
- ILEmitter emitter = _ilCodeStreams.Emitter;
ILCodeStream codeStream = _ilCodeStreams.MarshallingCodeStream;
Debug.Assert(codeStream != null);
@@ -821,7 +818,6 @@ namespace Internal.TypeSystem.Interop
protected virtual void EmitMarshalElementNativeToManaged()
{
- ILEmitter emitter = _ilCodeStreams.Emitter;
ILCodeStream codeStream = _ilCodeStreams.MarshallingCodeStream;
Debug.Assert(codeStream != null);
@@ -836,7 +832,6 @@ namespace Internal.TypeSystem.Interop
protected virtual void EmitMarshalFieldManagedToNative()
{
- ILEmitter emitter = _ilCodeStreams.Emitter;
ILCodeStream marshallingCodeStream = _ilCodeStreams.MarshallingCodeStream;
SetupArgumentsForFieldMarshalling();
@@ -854,7 +849,6 @@ namespace Internal.TypeSystem.Interop
protected virtual void EmitMarshalFieldNativeToManaged()
{
- ILEmitter emitter = _ilCodeStreams.Emitter;
ILCodeStream codeStream = _ilCodeStreams.MarshallingCodeStream;
SetupArgumentsForFieldMarshalling();
@@ -879,7 +873,7 @@ namespace Internal.TypeSystem.Interop
}
}
- class NotSupportedMarshaller : Marshaller
+ internal sealed class NotSupportedMarshaller : Marshaller
{
public override void EmitMarshallingIL(PInvokeILCodeStreams pInvokeILCodeStreams)
{
@@ -887,7 +881,7 @@ namespace Internal.TypeSystem.Interop
}
}
- class VoidReturnMarshaller : Marshaller
+ internal sealed class VoidReturnMarshaller : Marshaller
{
protected override void EmitMarshalReturnValueManagedToNative()
{
@@ -901,7 +895,7 @@ namespace Internal.TypeSystem.Interop
}
}
- class BlittableValueMarshaller : Marshaller
+ internal sealed class BlittableValueMarshaller : Marshaller
{
protected override void EmitMarshalArgumentManagedToNative()
{
@@ -944,7 +938,7 @@ namespace Internal.TypeSystem.Interop
}
}
- class BlittableStructPtrMarshaller : Marshaller
+ internal sealed class BlittableStructPtrMarshaller : Marshaller
{
protected override void TransformManagedToNative(ILCodeStream codeStream)
{
@@ -967,7 +961,7 @@ namespace Internal.TypeSystem.Interop
}
}
- class ArrayMarshaller : Marshaller
+ internal class ArrayMarshaller : Marshaller
{
private Marshaller _elementMarshaller;
@@ -1039,8 +1033,8 @@ namespace Internal.TypeSystem.Interop
else
{
- uint? sizeParamIndex = MarshalAsDescriptor != null ? MarshalAsDescriptor.SizeParamIndex : null;
- uint? sizeConst = MarshalAsDescriptor != null ? MarshalAsDescriptor.SizeConst : null;
+ uint? sizeParamIndex = MarshalAsDescriptor?.SizeParamIndex;
+ uint? sizeConst = MarshalAsDescriptor?.SizeConst;
if (sizeConst.HasValue)
{
@@ -1350,7 +1344,7 @@ namespace Internal.TypeSystem.Interop
}
}
- class BlittableArrayMarshaller : ArrayMarshaller
+ internal sealed class BlittableArrayMarshaller : ArrayMarshaller
{
protected override void AllocAndTransformManagedToNative(ILCodeStream codeStream)
{
@@ -1419,7 +1413,7 @@ namespace Internal.TypeSystem.Interop
}
}
- class BooleanMarshaller : Marshaller
+ internal sealed class BooleanMarshaller : Marshaller
{
private int _trueValue;
public BooleanMarshaller(int trueValue = 1)
@@ -1467,7 +1461,7 @@ namespace Internal.TypeSystem.Interop
}
}
- class UnicodeStringMarshaller : Marshaller
+ internal sealed class UnicodeStringMarshaller : Marshaller
{
private bool ShouldBePinned
{
@@ -1587,7 +1581,7 @@ namespace Internal.TypeSystem.Interop
}
}
- class AnsiStringMarshaller : Marshaller
+ internal sealed class AnsiStringMarshaller : Marshaller
{
internal override bool CleanupRequired
@@ -1648,11 +1642,11 @@ namespace Internal.TypeSystem.Interop
}
}
- class UTF8StringMarshaller : Marshaller
+ internal sealed class UTF8StringMarshaller : Marshaller
{
private const int LocalBufferLength = 0x100;
- private ILLocalVariable? _marshallerInstance = null;
+ private ILLocalVariable? _marshallerInstance;
private MetadataType Marshaller => Context.SystemModule.GetKnownType("System.Runtime.InteropServices.Marshalling", "Utf8StringMarshaller");
@@ -1680,8 +1674,7 @@ namespace Internal.TypeSystem.Interop
{
TypeDesc marshallerIn = MarshallerIn;
- if (_marshallerInstance == null)
- _marshallerInstance = emitter.NewLocal(marshallerIn);
+ _marshallerInstance ??= emitter.NewLocal(marshallerIn);
var vBuffer = emitter.NewLocal(Context.GetWellKnownType(WellKnownType.IntPtr));
codeStream.EmitLdc(LocalBufferLength);
@@ -1744,7 +1737,7 @@ namespace Internal.TypeSystem.Interop
}
}
- class SafeHandleMarshaller : Marshaller
+ internal sealed class SafeHandleMarshaller : Marshaller
{
private void AllocSafeHandle(ILCodeStream codeStream)
{
@@ -1787,7 +1780,6 @@ namespace Internal.TypeSystem.Interop
ILEmitter emitter = _ilCodeStreams.Emitter;
ILCodeStream marshallingCodeStream = _ilCodeStreams.MarshallingCodeStream;
ILCodeStream callsiteCodeStream = _ilCodeStreams.CallsiteSetupCodeStream;
- ILCodeStream unmarshallingCodeStream = _ilCodeStreams.UnmarshallingCodestream;
ILCodeStream cleanupCodeStream = _ilCodeStreams.CleanupCodeStream;
SetupArguments();
@@ -1905,7 +1897,7 @@ namespace Internal.TypeSystem.Interop
}
}
- class DelegateMarshaller : Marshaller
+ internal sealed class DelegateMarshaller : Marshaller
{
protected override void AllocAndTransformManagedToNative(ILCodeStream codeStream)
{
diff --git a/src/coreclr/tools/Common/TypeSystem/Interop/IL/MarshallerKind.cs b/src/coreclr/tools/Common/TypeSystem/Interop/IL/MarshallerKind.cs
index 65f9e979e76..b1ff401809e 100644
--- a/src/coreclr/tools/Common/TypeSystem/Interop/IL/MarshallerKind.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Interop/IL/MarshallerKind.cs
@@ -3,7 +3,7 @@
namespace Internal.TypeSystem.Interop
{
- enum MarshallerKind
+ internal enum MarshallerKind
{
Unknown,
BlittableValue,
diff --git a/src/coreclr/tools/Common/TypeSystem/Interop/IL/NativeStructType.Mangling.cs b/src/coreclr/tools/Common/TypeSystem/Interop/IL/NativeStructType.Mangling.cs
index fe3edc15682..c209aebdec5 100644
--- a/src/coreclr/tools/Common/TypeSystem/Interop/IL/NativeStructType.Mangling.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Interop/IL/NativeStructType.Mangling.cs
@@ -3,7 +3,7 @@
namespace Internal.TypeSystem.Interop
{
- partial class NativeStructType : IPrefixMangledType
+ public partial class NativeStructType : IPrefixMangledType
{
TypeDesc IPrefixMangledType.BaseType => ManagedStructType;
diff --git a/src/coreclr/tools/Common/TypeSystem/Interop/IL/NativeStructType.Sorting.cs b/src/coreclr/tools/Common/TypeSystem/Interop/IL/NativeStructType.Sorting.cs
index e66dc55d975..1796d26e607 100644
--- a/src/coreclr/tools/Common/TypeSystem/Interop/IL/NativeStructType.Sorting.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Interop/IL/NativeStructType.Sorting.cs
@@ -4,7 +4,7 @@
namespace Internal.TypeSystem.Interop
{
// Functionality related to deterministic ordering of types
- partial class NativeStructType
+ public partial class NativeStructType
{
protected override int ClassCode => -377751537;
@@ -13,7 +13,7 @@ namespace Internal.TypeSystem.Interop
return comparer.Compare(ManagedStructType, ((NativeStructType)other).ManagedStructType);
}
- partial class NativeStructField
+ private sealed partial class NativeStructField
{
protected override int ClassCode => 1580219745;
diff --git a/src/coreclr/tools/Common/TypeSystem/Interop/IL/NativeStructType.cs b/src/coreclr/tools/Common/TypeSystem/Interop/IL/NativeStructType.cs
index 477d5c8168b..9f5ee9edcb9 100644
--- a/src/coreclr/tools/Common/TypeSystem/Interop/IL/NativeStructType.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Interop/IL/NativeStructType.cs
@@ -161,7 +161,7 @@ namespace Internal.TypeSystem.Interop
}
[ThreadStatic]
- static Stack<MetadataType> s_typesBeingLookedAt;
+ private static Stack<MetadataType> s_typesBeingLookedAt;
public NativeStructType(ModuleDesc owningModule, MetadataType managedStructType, InteropStateManager interopStateManager)
{
@@ -190,7 +190,6 @@ namespace Internal.TypeSystem.Interop
private void CalculateFields()
{
- bool isSequential = ManagedStructType.IsSequentialLayout;
bool isAnsi = ManagedStructType.PInvokeStringFormat == PInvokeStringFormat.AnsiClass;
int numFields = 0;
diff --git a/src/coreclr/tools/Common/TypeSystem/Interop/IL/PInvokeDelegateWrapper.Mangling.cs b/src/coreclr/tools/Common/TypeSystem/Interop/IL/PInvokeDelegateWrapper.Mangling.cs
index ab66c754f58..9ebfc462f96 100644
--- a/src/coreclr/tools/Common/TypeSystem/Interop/IL/PInvokeDelegateWrapper.Mangling.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Interop/IL/PInvokeDelegateWrapper.Mangling.cs
@@ -3,7 +3,7 @@
namespace Internal.TypeSystem.Interop
{
- partial class PInvokeDelegateWrapper : IPrefixMangledType
+ public partial class PInvokeDelegateWrapper : IPrefixMangledType
{
TypeDesc IPrefixMangledType.BaseType
{
diff --git a/src/coreclr/tools/Common/TypeSystem/Interop/IL/PInvokeDelegateWrapper.Sorting.cs b/src/coreclr/tools/Common/TypeSystem/Interop/IL/PInvokeDelegateWrapper.Sorting.cs
index c62bc7675e5..0611936fca4 100644
--- a/src/coreclr/tools/Common/TypeSystem/Interop/IL/PInvokeDelegateWrapper.Sorting.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Interop/IL/PInvokeDelegateWrapper.Sorting.cs
@@ -4,7 +4,7 @@
namespace Internal.TypeSystem.Interop
{
// Functionality related to deterministic ordering of types
- partial class PInvokeDelegateWrapper
+ public partial class PInvokeDelegateWrapper
{
protected override int ClassCode => -262930217;
diff --git a/src/coreclr/tools/Common/TypeSystem/Interop/IL/PInvokeDelegateWrapper.cs b/src/coreclr/tools/Common/TypeSystem/Interop/IL/PInvokeDelegateWrapper.cs
index dcc2fbff41c..c7577641566 100644
--- a/src/coreclr/tools/Common/TypeSystem/Interop/IL/PInvokeDelegateWrapper.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Interop/IL/PInvokeDelegateWrapper.cs
@@ -3,7 +3,6 @@
using System;
using System.Collections.Generic;
-using Internal.IL;
using Internal.IL.Stubs;
using Debug = System.Diagnostics.Debug;
using System.Threading;
@@ -154,7 +153,7 @@ namespace Internal.TypeSystem.Interop
Debug.Assert(delegateType.IsDelegate);
Module = owningModule;
- DelegateType = delegateType;
+ DelegateType = delegateType;
_interopStateManager = interopStateManager;
}
@@ -238,7 +237,7 @@ namespace Internal.TypeSystem.Interop
{
MethodDesc[] methods = new MethodDesc[] {
new PInvokeDelegateWrapperConstructor(this), // Constructor
- new DelegateMarshallingMethodThunk(DelegateType, this, _interopStateManager,
+ new DelegateMarshallingMethodThunk(DelegateType, this, _interopStateManager,
DelegateMarshallingMethodThunkKind.ForwardNativeFunctionWrapper) // a forward marshalling instance method
};
diff --git a/src/coreclr/tools/Common/TypeSystem/Interop/IL/PInvokeDelegateWrapperConstructor.Sorting.cs b/src/coreclr/tools/Common/TypeSystem/Interop/IL/PInvokeDelegateWrapperConstructor.Sorting.cs
index 5fe9290213b..d5b75a170e3 100644
--- a/src/coreclr/tools/Common/TypeSystem/Interop/IL/PInvokeDelegateWrapperConstructor.Sorting.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Interop/IL/PInvokeDelegateWrapperConstructor.Sorting.cs
@@ -4,7 +4,7 @@
namespace Internal.TypeSystem.Interop
{
// Functionality related to deterministic ordering of methods
- partial class PInvokeDelegateWrapperConstructor
+ public partial class PInvokeDelegateWrapperConstructor
{
protected override int ClassCode => 1000342011;
diff --git a/src/coreclr/tools/Common/TypeSystem/Interop/IL/PInvokeDelegateWrapperConstructor.cs b/src/coreclr/tools/Common/TypeSystem/Interop/IL/PInvokeDelegateWrapperConstructor.cs
index 2e138f6098c..10727fac2b4 100644
--- a/src/coreclr/tools/Common/TypeSystem/Interop/IL/PInvokeDelegateWrapperConstructor.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Interop/IL/PInvokeDelegateWrapperConstructor.cs
@@ -1,12 +1,8 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-using System.Collections.Generic;
using Internal.IL;
using Internal.IL.Stubs;
-using Debug = System.Diagnostics.Debug;
-using System.Threading;
namespace Internal.TypeSystem.Interop
{
@@ -46,15 +42,12 @@ namespace Internal.TypeSystem.Interop
{
get
{
- if (_signature == null)
- {
- _signature = new MethodSignature(MethodSignatureFlags.None,
+ _signature ??= new MethodSignature(MethodSignatureFlags.None,
genericParameterCount: 0,
returnType: Context.GetWellKnownType(WellKnownType.Void),
parameters: new TypeDesc[] {
Context.GetWellKnownType(WellKnownType.IntPtr)
});
- }
return _signature;
}
}
diff --git a/src/coreclr/tools/Common/TypeSystem/Interop/InteropStateManager.cs b/src/coreclr/tools/Common/TypeSystem/Interop/InteropStateManager.cs
index f149f08dc44..f8a3ea39640 100644
--- a/src/coreclr/tools/Common/TypeSystem/Interop/InteropStateManager.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Interop/InteropStateManager.cs
@@ -1,7 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
using Internal.IL.Stubs;
using Internal.TypeSystem.Interop;
using Debug = System.Diagnostics.Debug;
@@ -195,7 +194,7 @@ namespace Internal.TypeSystem
return _pInvokeCalliHashtable.GetOrCreateValue(new CalliMarshallingMethodThunkKey(normalizedSignatureBuilder.ToSignature(), MarshalHelpers.IsRuntimeMarshallingEnabled(moduleContext)));
}
- private class NativeStructTypeHashtable : LockFreeReaderHashtable<MetadataType, NativeStructType>
+ private sealed class NativeStructTypeHashtable : LockFreeReaderHashtable<MetadataType, NativeStructType>
{
protected override int GetKeyHashCode(MetadataType key)
{
@@ -209,12 +208,12 @@ namespace Internal.TypeSystem
protected override bool CompareKeyToValue(MetadataType key, NativeStructType value)
{
- return Object.ReferenceEquals(key, value.ManagedStructType);
+ return ReferenceEquals(key, value.ManagedStructType);
}
protected override bool CompareValueToValue(NativeStructType value1, NativeStructType value2)
{
- return Object.ReferenceEquals(value1.ManagedStructType, value2.ManagedStructType);
+ return ReferenceEquals(value1.ManagedStructType, value2.ManagedStructType);
}
protected override NativeStructType CreateValueFromKey(MetadataType key)
@@ -244,7 +243,7 @@ namespace Internal.TypeSystem
}
}
- private class StructMarshallingThunkHashTable : LockFreeReaderHashtable<StructMarshallingThunkKey, StructMarshallingThunk>
+ private sealed class StructMarshallingThunkHashTable : LockFreeReaderHashtable<StructMarshallingThunkKey, StructMarshallingThunk>
{
protected override int GetKeyHashCode(StructMarshallingThunkKey key)
{
@@ -258,13 +257,13 @@ namespace Internal.TypeSystem
protected override bool CompareKeyToValue(StructMarshallingThunkKey key, StructMarshallingThunk value)
{
- return Object.ReferenceEquals(key.ManagedType, value.ManagedType) &&
+ return ReferenceEquals(key.ManagedType, value.ManagedType) &&
key.ThunkType == value.ThunkType;
}
protected override bool CompareValueToValue(StructMarshallingThunk value1, StructMarshallingThunk value2)
{
- return Object.ReferenceEquals(value1.ManagedType, value2.ManagedType) &&
+ return ReferenceEquals(value1.ManagedType, value2.ManagedType) &&
value1.ThunkType == value2.ThunkType;
}
@@ -283,7 +282,7 @@ namespace Internal.TypeSystem
}
}
- private class InlineArrayHashTable : LockFreeReaderHashtable<InlineArrayCandidate, InlineArrayType>
+ private sealed class InlineArrayHashTable : LockFreeReaderHashtable<InlineArrayCandidate, InlineArrayType>
{
protected override int GetKeyHashCode(InlineArrayCandidate key)
{
@@ -297,13 +296,13 @@ namespace Internal.TypeSystem
protected override bool CompareKeyToValue(InlineArrayCandidate key, InlineArrayType value)
{
- return Object.ReferenceEquals(key.ElementType, value.ElementType) &&
+ return ReferenceEquals(key.ElementType, value.ElementType) &&
key.Length == value.Length;
}
protected override bool CompareValueToValue(InlineArrayType value1, InlineArrayType value2)
{
- return Object.ReferenceEquals(value1.ElementType, value2.ElementType) &&
+ return ReferenceEquals(value1.ElementType, value2.ElementType) &&
value1.Length == value2.Length;
}
@@ -333,7 +332,7 @@ namespace Internal.TypeSystem
Kind = kind;
}
}
- private class DelegateMarshallingStubHashtable : LockFreeReaderHashtable<DelegateMarshallingStubHashtableKey, DelegateMarshallingMethodThunk>
+ private sealed class DelegateMarshallingStubHashtable : LockFreeReaderHashtable<DelegateMarshallingStubHashtableKey, DelegateMarshallingMethodThunk>
{
protected override int GetKeyHashCode(DelegateMarshallingStubHashtableKey key)
{
@@ -347,13 +346,13 @@ namespace Internal.TypeSystem
protected override bool CompareKeyToValue(DelegateMarshallingStubHashtableKey key, DelegateMarshallingMethodThunk value)
{
- return Object.ReferenceEquals(key.DelegateType, value.DelegateType) &&
+ return ReferenceEquals(key.DelegateType, value.DelegateType) &&
key.Kind== value.Kind;
}
protected override bool CompareValueToValue(DelegateMarshallingMethodThunk value1, DelegateMarshallingMethodThunk value2)
{
- return Object.ReferenceEquals(value1.DelegateType, value2.DelegateType) &&
+ return ReferenceEquals(value1.DelegateType, value2.DelegateType) &&
value1.Kind== value2.Kind;
}
@@ -373,7 +372,7 @@ namespace Internal.TypeSystem
}
}
- private class ForwardDelegateCreationStubHashtable : LockFreeReaderHashtable<MetadataType, ForwardDelegateCreationThunk>
+ private sealed class ForwardDelegateCreationStubHashtable : LockFreeReaderHashtable<MetadataType, ForwardDelegateCreationThunk>
{
protected override int GetKeyHashCode(MetadataType key)
{
@@ -387,12 +386,12 @@ namespace Internal.TypeSystem
protected override bool CompareKeyToValue(MetadataType key, ForwardDelegateCreationThunk value)
{
- return Object.ReferenceEquals(key, value.DelegateType);
+ return ReferenceEquals(key, value.DelegateType);
}
protected override bool CompareValueToValue(ForwardDelegateCreationThunk value1, ForwardDelegateCreationThunk value2)
{
- return Object.ReferenceEquals(value1.DelegateType, value2.DelegateType);
+ return ReferenceEquals(value1.DelegateType, value2.DelegateType);
}
protected override ForwardDelegateCreationThunk CreateValueFromKey(MetadataType key)
@@ -410,7 +409,7 @@ namespace Internal.TypeSystem
}
}
- private class PInvokeDelegateWrapperHashtable : LockFreeReaderHashtable<MetadataType, PInvokeDelegateWrapper>
+ private sealed class PInvokeDelegateWrapperHashtable : LockFreeReaderHashtable<MetadataType, PInvokeDelegateWrapper>
{
protected override int GetKeyHashCode(MetadataType key)
{
@@ -424,12 +423,12 @@ namespace Internal.TypeSystem
protected override bool CompareKeyToValue(MetadataType key, PInvokeDelegateWrapper value)
{
- return Object.ReferenceEquals(key, value.DelegateType);
+ return ReferenceEquals(key, value.DelegateType);
}
protected override bool CompareValueToValue(PInvokeDelegateWrapper value1, PInvokeDelegateWrapper value2)
{
- return Object.ReferenceEquals(value1.DelegateType, value2.DelegateType);
+ return ReferenceEquals(value1.DelegateType, value2.DelegateType);
}
protected override PInvokeDelegateWrapper CreateValueFromKey(MetadataType key)
@@ -447,7 +446,7 @@ namespace Internal.TypeSystem
}
}
- private class PInvokeLazyFixupFieldHashtable : LockFreeReaderHashtable<MethodDesc, PInvokeLazyFixupField>
+ private sealed class PInvokeLazyFixupFieldHashtable : LockFreeReaderHashtable<MethodDesc, PInvokeLazyFixupField>
{
protected override int GetKeyHashCode(MethodDesc key)
{
@@ -484,7 +483,7 @@ namespace Internal.TypeSystem
private readonly record struct CalliMarshallingMethodThunkKey(MethodSignature Signature, bool RuntimeMarshallingEnabled);
- private class PInvokeCalliHashtable : LockFreeReaderHashtable<CalliMarshallingMethodThunkKey, CalliMarshallingMethodThunk>
+ private sealed class PInvokeCalliHashtable : LockFreeReaderHashtable<CalliMarshallingMethodThunkKey, CalliMarshallingMethodThunk>
{
private readonly InteropStateManager _interopStateManager;
private readonly TypeDesc _owningType;
diff --git a/src/coreclr/tools/Common/TypeSystem/Interop/InteropTypes.cs b/src/coreclr/tools/Common/TypeSystem/Interop/InteropTypes.cs
index f69879a10ee..8bbdb13630b 100644
--- a/src/coreclr/tools/Common/TypeSystem/Interop/InteropTypes.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Interop/InteropTypes.cs
@@ -3,8 +3,6 @@
using Internal.IL;
-using Debug = System.Diagnostics.Debug;
-
namespace Internal.TypeSystem.Interop
{
public static class InteropTypes
diff --git a/src/coreclr/tools/Common/TypeSystem/Interop/MarshalAsDescriptor.cs b/src/coreclr/tools/Common/TypeSystem/Interop/MarshalAsDescriptor.cs
index c76e2cf4693..39ecc973755 100644
--- a/src/coreclr/tools/Common/TypeSystem/Interop/MarshalAsDescriptor.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Interop/MarshalAsDescriptor.cs
@@ -1,8 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System.Runtime.CompilerServices;
-using System;
using System.Diagnostics;
namespace Internal.TypeSystem
diff --git a/src/coreclr/tools/Common/TypeSystem/Interop/MetadataType.Interop.cs b/src/coreclr/tools/Common/TypeSystem/Interop/MetadataType.Interop.cs
index eeed1cc9343..10e3bbeeb18 100644
--- a/src/coreclr/tools/Common/TypeSystem/Interop/MetadataType.Interop.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Interop/MetadataType.Interop.cs
@@ -1,8 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-
namespace Internal.TypeSystem
{
public enum PInvokeStringFormat
diff --git a/src/coreclr/tools/Common/TypeSystem/Interop/MethodDelegator.Interop.cs b/src/coreclr/tools/Common/TypeSystem/Interop/MethodDelegator.Interop.cs
index 47291cd62bc..d9919796639 100644
--- a/src/coreclr/tools/Common/TypeSystem/Interop/MethodDelegator.Interop.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Interop/MethodDelegator.Interop.cs
@@ -3,7 +3,7 @@
namespace Internal.TypeSystem
{
- partial class MethodDelegator
+ public partial class MethodDelegator
{
public override bool IsPInvoke => _wrappedMethod.IsPInvoke;
diff --git a/src/coreclr/tools/Common/TypeSystem/Interop/MethodDesc.Interop.cs b/src/coreclr/tools/Common/TypeSystem/Interop/MethodDesc.Interop.cs
index c49c654423a..39e7e751bbc 100644
--- a/src/coreclr/tools/Common/TypeSystem/Interop/MethodDesc.Interop.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Interop/MethodDesc.Interop.cs
@@ -7,7 +7,7 @@ using System.Runtime.InteropServices;
namespace Internal.TypeSystem
{
// Additional extensions to MethodDesc related to interop
- partial class MethodDesc
+ public partial class MethodDesc
{
/// <summary>
/// Gets a value indicating whether this method is a (native unmanaged) platform invoke.
@@ -350,7 +350,7 @@ namespace Internal.TypeSystem
}
}
- partial class InstantiatedMethod
+ public partial class InstantiatedMethod
{
public override ParameterMetadata[] GetParameterMetadata()
{
@@ -358,7 +358,7 @@ namespace Internal.TypeSystem
}
}
- partial class MethodForInstantiatedType
+ public partial class MethodForInstantiatedType
{
public override ParameterMetadata[] GetParameterMetadata()
{
diff --git a/src/coreclr/tools/Common/TypeSystem/MetadataEmitter/TypeSystemMetadataEmitter.cs b/src/coreclr/tools/Common/TypeSystem/MetadataEmitter/TypeSystemMetadataEmitter.cs
index 8e0a9272392..8499fa23d80 100644
--- a/src/coreclr/tools/Common/TypeSystem/MetadataEmitter/TypeSystemMetadataEmitter.cs
+++ b/src/coreclr/tools/Common/TypeSystem/MetadataEmitter/TypeSystemMetadataEmitter.cs
@@ -9,22 +9,23 @@ using System.Reflection;
using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335;
using System.Reflection.PortableExecutable;
-using Internal.TypeSystem;
namespace Internal.TypeSystem
{
- class TypeSystemMetadataEmitter
+#pragma warning disable CA1852
+ internal class TypeSystemMetadataEmitter
+#pragma warning restore CA1852
{
- MetadataBuilder _metadataBuilder;
- BlobBuilder _ilBuilder;
- MethodBodyStreamEncoder _methodBodyStream;
- Dictionary<string, AssemblyReferenceHandle> _assemblyRefNameHandles = new Dictionary<string, AssemblyReferenceHandle>();
- Dictionary<IAssemblyDesc, AssemblyReferenceHandle> _assemblyRefs = new Dictionary<IAssemblyDesc, AssemblyReferenceHandle>();
- Dictionary<TypeDesc, EntityHandle> _typeRefs = new Dictionary<TypeDesc, EntityHandle>();
- Dictionary<MethodDesc, EntityHandle> _methodRefs = new Dictionary<MethodDesc, EntityHandle>();
- Dictionary<FieldDesc, EntityHandle> _fieldRefs = new Dictionary<FieldDesc, EntityHandle>();
- Blob _mvidFixup;
- BlobHandle _noArgsVoidReturnStaticMethodSigHandle;
+ private MetadataBuilder _metadataBuilder;
+ private BlobBuilder _ilBuilder;
+ private MethodBodyStreamEncoder _methodBodyStream;
+ private Dictionary<string, AssemblyReferenceHandle> _assemblyRefNameHandles = new Dictionary<string, AssemblyReferenceHandle>();
+ private Dictionary<IAssemblyDesc, AssemblyReferenceHandle> _assemblyRefs = new Dictionary<IAssemblyDesc, AssemblyReferenceHandle>();
+ private Dictionary<TypeDesc, EntityHandle> _typeRefs = new Dictionary<TypeDesc, EntityHandle>();
+ private Dictionary<MethodDesc, EntityHandle> _methodRefs = new Dictionary<MethodDesc, EntityHandle>();
+ private Dictionary<FieldDesc, EntityHandle> _fieldRefs = new Dictionary<FieldDesc, EntityHandle>();
+ private Blob _mvidFixup;
+ private BlobHandle _noArgsVoidReturnStaticMethodSigHandle;
protected TypeSystemContext _typeSystemContext;
public TypeSystemMetadataEmitter(AssemblyName assemblyName, TypeSystemContext context, AssemblyFlags flags = default(AssemblyFlags), byte[] publicKeyArray = null, AssemblyHashAlgorithm hashAlgorithm = AssemblyHashAlgorithm.None)
@@ -41,7 +42,7 @@ namespace Internal.TypeSystem
_mvidFixup = mvid.Content;
_metadataBuilder.AddModule(0, assemblyNameHandle, mvid.Handle, default(GuidHandle), default(GuidHandle));
- _metadataBuilder.AddAssembly(assemblyNameHandle, assemblyName.Version ?? new Version(0,0,0,0), default(StringHandle), publicKey: publicKeyArray != null ? _metadataBuilder.GetOrAddBlob(publicKeyArray) : default(BlobHandle), flags, AssemblyHashAlgorithm.None);
+ _metadataBuilder.AddAssembly(assemblyNameHandle, assemblyName.Version ?? new Version(0, 0, 0, 0), default(StringHandle), publicKey: publicKeyArray != null ? _metadataBuilder.GetOrAddBlob(publicKeyArray) : default(BlobHandle), flags, AssemblyHashAlgorithm.None);
_metadataBuilder.AddTypeDefinition(
default(TypeAttributes),
@@ -167,7 +168,7 @@ namespace Internal.TypeSystem
throw new NotSupportedException();
}
}
-
+
public IEnumerable<KeyValuePair<TypeSystemEntity, EntityHandle>> TypeSystemEntitiesKnown
{
get
@@ -264,7 +265,6 @@ namespace Internal.TypeSystem
private BlobHandle GetFieldSignatureBlobHandle(FieldDesc field)
{
- var fieldDef = field.GetTypicalFieldDefinition();
var embeddedSigData = field.GetEmbeddedSignatureData();
EmbeddedSignatureDataEmitter signatureDataEmitter;
if (embeddedSigData != null && embeddedSigData.Length != 0)
@@ -455,9 +455,8 @@ namespace Internal.TypeSystem
{
blobBuilder.WriteByte((byte)SignatureTypeCode.Void);
}
- else if (type is SignatureVariable)
+ else if (type is SignatureVariable sigVar)
{
- SignatureVariable sigVar = (SignatureVariable)type;
SignatureTypeCode code = sigVar.IsMethodSignatureVariable ? SignatureTypeCode.GenericMethodParameter : SignatureTypeCode.GenericTypeParameter;
blobBuilder.WriteByte((byte)code);
blobBuilder.WriteCompressedInteger(sigVar.Index);
@@ -470,9 +469,8 @@ namespace Internal.TypeSystem
foreach (var instantiationArg in type.Instantiation)
EncodeType(blobBuilder, instantiationArg, signatureDataEmitter);
}
- else if (type is MetadataType)
+ else if (type is MetadataType metadataType)
{
- var metadataType = (MetadataType)type;
// Must be class or valuetype
blobBuilder.WriteByte(type.IsValueType ? (byte)SignatureTypeKind.ValueType : (byte)SignatureTypeKind.Class);
int codedIndex = CodedIndex.TypeDefOrRef(GetTypeRef(metadataType));
@@ -486,12 +484,12 @@ namespace Internal.TypeSystem
signatureDataEmitter.Pop();
}
- class EmbeddedSignatureDataEmitter
+ private sealed class EmbeddedSignatureDataEmitter
{
- EmbeddedSignatureData[] _embeddedData;
- int _embeddedDataIndex;
- Stack<int> _indexStack = new Stack<int>();
- TypeSystemMetadataEmitter _metadataEmitter;
+ private EmbeddedSignatureData[] _embeddedData;
+ private int _embeddedDataIndex;
+ private Stack<int> _indexStack = new Stack<int>();
+ private TypeSystemMetadataEmitter _metadataEmitter;
public static EmbeddedSignatureDataEmitter EmptySingleton = new EmbeddedSignatureDataEmitter(null, null);
@@ -536,11 +534,11 @@ namespace Internal.TypeSystem
for (int i = 0; i < boundsStr.Length; i++)
{
- bounds[i] = Int32.Parse(boundsStr[i]);
+ bounds[i] = int.Parse(boundsStr[i]);
}
for (int i = 0; i < loBoundsStr.Length; i++)
{
- loBounds[i] = Int32.Parse(loBoundsStr[i]);
+ loBounds[i] = int.Parse(loBoundsStr[i]);
}
shapeEncoder.Shape(rank, ImmutableArray.Create(bounds), ImmutableArray.Create(loBounds));
@@ -636,7 +634,7 @@ namespace Internal.TypeSystem
}
}
- void EncodeMethodSignature(BlobBuilder signatureBuilder, MethodSignature sig, EmbeddedSignatureDataEmitter signatureDataEmitter)
+ private void EncodeMethodSignature(BlobBuilder signatureBuilder, MethodSignature sig, EmbeddedSignatureDataEmitter signatureDataEmitter)
{
signatureDataEmitter.Push();
BlobEncoder signatureEncoder = new BlobEncoder(signatureBuilder);
@@ -672,7 +670,7 @@ namespace Internal.TypeSystem
signatureDataEmitter.Pop();
}
- void EncodeFieldSignature(BlobBuilder signatureBuilder, TypeDesc fieldType, EmbeddedSignatureDataEmitter signatureDataEmitter)
+ private void EncodeFieldSignature(BlobBuilder signatureBuilder, TypeDesc fieldType, EmbeddedSignatureDataEmitter signatureDataEmitter)
{
signatureDataEmitter.Push();
BlobEncoder signatureEncoder = new BlobEncoder(signatureBuilder);
diff --git a/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/ArrayType.RuntimeDetermined.cs b/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/ArrayType.RuntimeDetermined.cs
index 2e05f1b87f2..5da5d7f0313 100644
--- a/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/ArrayType.RuntimeDetermined.cs
+++ b/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/ArrayType.RuntimeDetermined.cs
@@ -3,7 +3,7 @@
namespace Internal.TypeSystem
{
- partial class ArrayType
+ public partial class ArrayType
{
public override TypeDesc GetNonRuntimeDeterminedTypeFromRuntimeDeterminedSubtypeViaSubstitution(Instantiation typeInstantiation, Instantiation methodInstantiation)
{
@@ -17,7 +17,7 @@ namespace Internal.TypeSystem
}
}
- partial class ArrayMethod
+ public partial class ArrayMethod
{
public override MethodDesc GetNonRuntimeDeterminedMethodFromRuntimeDeterminedMethodViaSubstitution(Instantiation typeInstantiation, Instantiation methodInstantiation)
{
diff --git a/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/ByRefType.RuntimeDetermined.cs b/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/ByRefType.RuntimeDetermined.cs
index 21b4b9a3b06..8f3426cf753 100644
--- a/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/ByRefType.RuntimeDetermined.cs
+++ b/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/ByRefType.RuntimeDetermined.cs
@@ -3,7 +3,7 @@
namespace Internal.TypeSystem
{
- partial class ByRefType
+ public partial class ByRefType
{
public override TypeDesc GetNonRuntimeDeterminedTypeFromRuntimeDeterminedSubtypeViaSubstitution(Instantiation typeInstantiation, Instantiation methodInstantiation)
{
diff --git a/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/DefType.RuntimeDetermined.cs b/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/DefType.RuntimeDetermined.cs
index 81d24031df3..62799f6ba61 100644
--- a/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/DefType.RuntimeDetermined.cs
+++ b/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/DefType.RuntimeDetermined.cs
@@ -3,7 +3,7 @@
namespace Internal.TypeSystem
{
- partial class DefType
+ public partial class DefType
{
public override bool IsRuntimeDeterminedSubtype
{
diff --git a/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/FieldDesc.RuntimeDetermined.cs b/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/FieldDesc.RuntimeDetermined.cs
index 748ea1d8772..f1bf0d96818 100644
--- a/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/FieldDesc.RuntimeDetermined.cs
+++ b/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/FieldDesc.RuntimeDetermined.cs
@@ -3,7 +3,7 @@
namespace Internal.TypeSystem
{
- partial class FieldDesc
+ public partial class FieldDesc
{
public FieldDesc GetNonRuntimeDeterminedFieldFromRuntimeDeterminedFieldViaSubstitution(Instantiation typeInstantiation, Instantiation methodInstantiation)
{
diff --git a/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/FunctionPointerType.RuntimeDetermined.cs b/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/FunctionPointerType.RuntimeDetermined.cs
index 64767657f56..5f2d9b5c8af 100644
--- a/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/FunctionPointerType.RuntimeDetermined.cs
+++ b/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/FunctionPointerType.RuntimeDetermined.cs
@@ -5,7 +5,7 @@ using Debug = System.Diagnostics.Debug;
namespace Internal.TypeSystem
{
- partial class FunctionPointerType
+ public partial class FunctionPointerType
{
public override bool IsRuntimeDeterminedSubtype
{
diff --git a/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/GenericParameterDesc.RuntimeDetermined.cs b/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/GenericParameterDesc.RuntimeDetermined.cs
index e2abaf141c4..d6540d7ae40 100644
--- a/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/GenericParameterDesc.RuntimeDetermined.cs
+++ b/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/GenericParameterDesc.RuntimeDetermined.cs
@@ -5,7 +5,7 @@ using Debug = System.Diagnostics.Debug;
namespace Internal.TypeSystem
{
- partial class GenericParameterDesc
+ public partial class GenericParameterDesc
{
public sealed override bool IsRuntimeDeterminedSubtype
{
diff --git a/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/MethodDesc.RuntimeDetermined.cs b/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/MethodDesc.RuntimeDetermined.cs
index 909c73465d8..2a66359448f 100644
--- a/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/MethodDesc.RuntimeDetermined.cs
+++ b/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/MethodDesc.RuntimeDetermined.cs
@@ -1,11 +1,9 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using Debug = System.Diagnostics.Debug;
-
namespace Internal.TypeSystem
{
- partial class MethodDesc
+ public partial class MethodDesc
{
/// <summary>
/// Gets the shared runtime determined form of the method. This is a canonical form of the method
diff --git a/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/MethodForRuntimeDeterminedType.Diagnostic.cs b/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/MethodForRuntimeDeterminedType.Diagnostic.cs
index aca586c0c15..40047e9c6ab 100644
--- a/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/MethodForRuntimeDeterminedType.Diagnostic.cs
+++ b/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/MethodForRuntimeDeterminedType.Diagnostic.cs
@@ -3,7 +3,7 @@
namespace Internal.TypeSystem
{
- partial class MethodForRuntimeDeterminedType
+ public partial class MethodForRuntimeDeterminedType
{
public override string DiagnosticName => _typicalMethodDef.DiagnosticName;
}
diff --git a/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/MethodForRuntimeDeterminedType.Sorting.cs b/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/MethodForRuntimeDeterminedType.Sorting.cs
index 2aeab414f4a..2aec790ee00 100644
--- a/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/MethodForRuntimeDeterminedType.Sorting.cs
+++ b/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/MethodForRuntimeDeterminedType.Sorting.cs
@@ -4,7 +4,7 @@
namespace Internal.TypeSystem
{
// Functionality related to deterministic ordering of types
- partial class MethodForRuntimeDeterminedType
+ public partial class MethodForRuntimeDeterminedType
{
protected internal override int ClassCode => 719937490;
diff --git a/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/MethodForRuntimeDeterminedType.cs b/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/MethodForRuntimeDeterminedType.cs
index 24f7ec0eb2d..d111f8b130a 100644
--- a/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/MethodForRuntimeDeterminedType.cs
+++ b/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/MethodForRuntimeDeterminedType.cs
@@ -1,7 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
using System.Diagnostics;
namespace Internal.TypeSystem
diff --git a/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/ParameterizedType.RuntimeDetermined.cs b/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/ParameterizedType.RuntimeDetermined.cs
index 430e57596c9..a241bc7d050 100644
--- a/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/ParameterizedType.RuntimeDetermined.cs
+++ b/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/ParameterizedType.RuntimeDetermined.cs
@@ -3,7 +3,7 @@
namespace Internal.TypeSystem
{
- partial class ParameterizedType
+ public partial class ParameterizedType
{
public sealed override bool IsRuntimeDeterminedSubtype
{
diff --git a/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/PointerType.RuntimeDetermined.cs b/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/PointerType.RuntimeDetermined.cs
index ef6c1e6bb06..5219e32e4a5 100644
--- a/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/PointerType.RuntimeDetermined.cs
+++ b/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/PointerType.RuntimeDetermined.cs
@@ -3,7 +3,7 @@
namespace Internal.TypeSystem
{
- partial class PointerType
+ public partial class PointerType
{
public override TypeDesc GetNonRuntimeDeterminedTypeFromRuntimeDeterminedSubtypeViaSubstitution(Instantiation typeInstantiation, Instantiation methodInstantiation)
{
diff --git a/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/RuntimeDeterminedCanonicalizationAlgorithm.cs b/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/RuntimeDeterminedCanonicalizationAlgorithm.cs
index a0e7c077783..f3b9094e11e 100644
--- a/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/RuntimeDeterminedCanonicalizationAlgorithm.cs
+++ b/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/RuntimeDeterminedCanonicalizationAlgorithm.cs
@@ -110,7 +110,7 @@ namespace Internal.TypeSystem
else if (typeToConvert.IsRuntimeDeterminedType)
{
// For non-universal canon cases, RuntimeDeterminedType's passed into this function are either
- // reference types (which are turned into normal Canon), or instantiated types (which are handled
+ // reference types (which are turned into normal Canon), or instantiated types (which are handled
// by the above case.). But for UniversalCanon, we can have non-instantiated universal canon
// which will reach this case.
diff --git a/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/RuntimeDeterminedFieldLayoutAlgorithm.cs b/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/RuntimeDeterminedFieldLayoutAlgorithm.cs
index 7dd50f06f34..55c3bfbd85f 100644
--- a/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/RuntimeDeterminedFieldLayoutAlgorithm.cs
+++ b/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/RuntimeDeterminedFieldLayoutAlgorithm.cs
@@ -2,9 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
using System;
-using System.Collections.Generic;
-
-using Debug = System.Diagnostics.Debug;
namespace Internal.TypeSystem
{
@@ -37,7 +34,7 @@ namespace Internal.TypeSystem
return result;
}
- public unsafe override ComputedStaticFieldLayout ComputeStaticFieldLayout(DefType defType, StaticLayoutKind layoutKind)
+ public override unsafe ComputedStaticFieldLayout ComputeStaticFieldLayout(DefType defType, StaticLayoutKind layoutKind)
{
// Static field layout for a RuntimeDeterminedType is not a supported operation
throw new NotSupportedException();
diff --git a/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/RuntimeDeterminedType.Diagnostic.cs b/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/RuntimeDeterminedType.Diagnostic.cs
index 91451e43ee6..09899ba8923 100644
--- a/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/RuntimeDeterminedType.Diagnostic.cs
+++ b/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/RuntimeDeterminedType.Diagnostic.cs
@@ -1,11 +1,9 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-
namespace Internal.TypeSystem
{
- partial class RuntimeDeterminedType
+ public partial class RuntimeDeterminedType
{
public override string DiagnosticName
{
@@ -19,7 +17,7 @@ namespace Internal.TypeSystem
{
get
{
- return String.Concat(_runtimeDeterminedDetailsType.DiagnosticName, "_", _rawCanonType.DiagnosticNamespace); ;
+ return string.Concat(_runtimeDeterminedDetailsType.DiagnosticName, "_", _rawCanonType.DiagnosticNamespace); ;
}
}
}
diff --git a/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/RuntimeDeterminedType.Sorting.cs b/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/RuntimeDeterminedType.Sorting.cs
index 70d1d7e7348..5a1a2293a22 100644
--- a/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/RuntimeDeterminedType.Sorting.cs
+++ b/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/RuntimeDeterminedType.Sorting.cs
@@ -4,7 +4,7 @@
namespace Internal.TypeSystem
{
// Functionality related to deterministic ordering of types
- partial class RuntimeDeterminedType
+ public partial class RuntimeDeterminedType
{
protected internal override int ClassCode => 351938209;
diff --git a/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/RuntimeDeterminedType.cs b/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/RuntimeDeterminedType.cs
index df7dbd13dde..d9f2742c25f 100644
--- a/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/RuntimeDeterminedType.cs
+++ b/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/RuntimeDeterminedType.cs
@@ -1,7 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
using System.Collections.Generic;
using Debug = System.Diagnostics.Debug;
@@ -17,11 +16,11 @@ namespace Internal.TypeSystem
/// The use of runtime determined types is limited to the dependency analysis and to communicating
/// with the codegen backend during shared generic code generation. They should not show up within
/// the system otherwise.
- ///
+ ///
/// Runtime determined types behave mostly like the canonical type they are wrapping. Most of the overrides
/// this type implements will forward the implementation to the <see cref="_rawCanonType"/>'s
/// implementation.
- ///
+ ///
/// Runtime determined types also behave like signature variables in the sense that they allow being
/// substituted during signature instantiation.
/// </remarks>
@@ -102,7 +101,7 @@ namespace Internal.TypeSystem
{
get
{
- return String.Concat(_runtimeDeterminedDetailsType.Name, "_", _rawCanonType.Namespace);
+ return string.Concat(_runtimeDeterminedDetailsType.Name, "_", _rawCanonType.Namespace);
}
}
diff --git a/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/SignatureVariable.RuntimeDetermined.cs b/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/SignatureVariable.RuntimeDetermined.cs
index 8eff9f51954..7caa4d7255c 100644
--- a/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/SignatureVariable.RuntimeDetermined.cs
+++ b/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/SignatureVariable.RuntimeDetermined.cs
@@ -5,7 +5,7 @@ using Debug = System.Diagnostics.Debug;
namespace Internal.TypeSystem
{
- partial class SignatureVariable
+ public partial class SignatureVariable
{
public sealed override bool IsRuntimeDeterminedSubtype
{
diff --git a/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/TypeDesc.RuntimeDetermined.cs b/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/TypeDesc.RuntimeDetermined.cs
index dc602f5ed28..f69f411f1f7 100644
--- a/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/TypeDesc.RuntimeDetermined.cs
+++ b/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/TypeDesc.RuntimeDetermined.cs
@@ -3,7 +3,7 @@
namespace Internal.TypeSystem
{
- partial class TypeDesc
+ public partial class TypeDesc
{
/// <summary>
/// Gets a value indicating whether the concrete type this object represents is unknown
diff --git a/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/TypeSystemContext.RuntimeDetermined.cs b/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/TypeSystemContext.RuntimeDetermined.cs
index dbbb7442aa4..689905e9526 100644
--- a/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/TypeSystemContext.RuntimeDetermined.cs
+++ b/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/TypeSystemContext.RuntimeDetermined.cs
@@ -8,7 +8,7 @@ using Internal.NativeFormat;
namespace Internal.TypeSystem
{
- partial class TypeSystemContext
+ public partial class TypeSystemContext
{
private struct RuntimeDeterminedTypeKey
{
@@ -21,7 +21,7 @@ namespace Internal.TypeSystem
_detailsType = detailsType;
}
- public class RuntimeDeterminedTypeKeyHashtable : LockFreeReaderHashtable<RuntimeDeterminedTypeKey, RuntimeDeterminedType>
+ public sealed class RuntimeDeterminedTypeKeyHashtable : LockFreeReaderHashtable<RuntimeDeterminedTypeKey, RuntimeDeterminedType>
{
protected override int GetKeyHashCode(RuntimeDeterminedTypeKey key)
{
@@ -96,7 +96,7 @@ namespace Internal.TypeSystem
}
}
- public class MethodForRuntimeDeterminedTypeKeyHashtable : LockFreeReaderHashtable<MethodForRuntimeDeterminedTypeKey, MethodForRuntimeDeterminedType>
+ public sealed class MethodForRuntimeDeterminedTypeKeyHashtable : LockFreeReaderHashtable<MethodForRuntimeDeterminedTypeKey, MethodForRuntimeDeterminedType>
{
protected override int GetKeyHashCode(MethodForRuntimeDeterminedTypeKey key)
{
diff --git a/src/coreclr/tools/Common/TypeSystem/Serialization/FieldDesc.Serialization.cs b/src/coreclr/tools/Common/TypeSystem/Serialization/FieldDesc.Serialization.cs
index 6552d1eaaa8..c30d2521188 100644
--- a/src/coreclr/tools/Common/TypeSystem/Serialization/FieldDesc.Serialization.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Serialization/FieldDesc.Serialization.cs
@@ -4,7 +4,7 @@
namespace Internal.TypeSystem
{
// Additional members of FieldDesc related to serialization.
- partial class FieldDesc
+ public partial class FieldDesc
{
/// <summary>
/// Gets a value indicating whether this field is not serialized.
@@ -19,7 +19,7 @@ namespace Internal.TypeSystem
}
}
- partial class FieldForInstantiatedType
+ public partial class FieldForInstantiatedType
{
public override bool IsNotSerialized
{
diff --git a/src/coreclr/tools/Common/TypeSystem/Serialization/TypeDesc.Serialization.cs b/src/coreclr/tools/Common/TypeSystem/Serialization/TypeDesc.Serialization.cs
index 9c4fcf89376..ff129b0885a 100644
--- a/src/coreclr/tools/Common/TypeSystem/Serialization/TypeDesc.Serialization.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Serialization/TypeDesc.Serialization.cs
@@ -3,7 +3,7 @@
namespace Internal.TypeSystem
{
- partial class TypeDesc
+ public partial class TypeDesc
{
/// <summary>
/// Gets a value indicating whether this type is serializable.
@@ -17,7 +17,7 @@ namespace Internal.TypeSystem
}
}
- partial class InstantiatedType
+ public partial class InstantiatedType
{
public override bool IsSerializable
{
diff --git a/src/coreclr/tools/Common/TypeSystem/Sorting/ArrayType.Sorting.cs b/src/coreclr/tools/Common/TypeSystem/Sorting/ArrayType.Sorting.cs
index 30993214e5d..bdd089e939c 100644
--- a/src/coreclr/tools/Common/TypeSystem/Sorting/ArrayType.Sorting.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Sorting/ArrayType.Sorting.cs
@@ -4,7 +4,7 @@
namespace Internal.TypeSystem
{
// Functionality related to deterministic ordering of types
- partial class ArrayType
+ public partial class ArrayType
{
protected internal override int ClassCode => -1274559616;
@@ -19,7 +19,7 @@ namespace Internal.TypeSystem
}
}
- partial class ArrayMethod
+ public partial class ArrayMethod
{
protected internal override int ClassCode => 487354154;
diff --git a/src/coreclr/tools/Common/TypeSystem/Sorting/ByRefType.Sorting.cs b/src/coreclr/tools/Common/TypeSystem/Sorting/ByRefType.Sorting.cs
index 031e675c684..34708718db4 100644
--- a/src/coreclr/tools/Common/TypeSystem/Sorting/ByRefType.Sorting.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Sorting/ByRefType.Sorting.cs
@@ -4,7 +4,7 @@
namespace Internal.TypeSystem
{
// Functionality related to deterministic ordering of types
- partial class ByRefType
+ public partial class ByRefType
{
protected internal override int ClassCode => -959602231;
diff --git a/src/coreclr/tools/Common/TypeSystem/Sorting/FieldDesc.Sorting.cs b/src/coreclr/tools/Common/TypeSystem/Sorting/FieldDesc.Sorting.cs
index a1f7c02a2d5..bf02ec18b86 100644
--- a/src/coreclr/tools/Common/TypeSystem/Sorting/FieldDesc.Sorting.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Sorting/FieldDesc.Sorting.cs
@@ -4,7 +4,7 @@
namespace Internal.TypeSystem
{
// Functionality related to deterministic ordering of types and members
- partial class FieldDesc
+ public partial class FieldDesc
{
/// <summary>
/// Gets an identifier that is the same for all instances of this <see cref="FieldDesc"/>
diff --git a/src/coreclr/tools/Common/TypeSystem/Sorting/FieldForInstantiatedType.Sorting.cs b/src/coreclr/tools/Common/TypeSystem/Sorting/FieldForInstantiatedType.Sorting.cs
index 1682d6abe97..5548241264c 100644
--- a/src/coreclr/tools/Common/TypeSystem/Sorting/FieldForInstantiatedType.Sorting.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Sorting/FieldForInstantiatedType.Sorting.cs
@@ -4,7 +4,7 @@
namespace Internal.TypeSystem
{
// Functionality related to deterministic ordering of types and members
- partial class FieldForInstantiatedType
+ public partial class FieldForInstantiatedType
{
protected internal override int ClassCode => 1140200283;
diff --git a/src/coreclr/tools/Common/TypeSystem/Sorting/FunctionPointerType.Sorting.cs b/src/coreclr/tools/Common/TypeSystem/Sorting/FunctionPointerType.Sorting.cs
index e833b9557fa..5bcbb190d89 100644
--- a/src/coreclr/tools/Common/TypeSystem/Sorting/FunctionPointerType.Sorting.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Sorting/FunctionPointerType.Sorting.cs
@@ -4,7 +4,7 @@
namespace Internal.TypeSystem
{
// Functionality related to deterministic ordering of types
- partial class FunctionPointerType
+ public partial class FunctionPointerType
{
protected internal override int ClassCode => -914739489;
diff --git a/src/coreclr/tools/Common/TypeSystem/Sorting/InstantiatedMethod.Sorting.cs b/src/coreclr/tools/Common/TypeSystem/Sorting/InstantiatedMethod.Sorting.cs
index 0fe7eb4686f..5527d2813fb 100644
--- a/src/coreclr/tools/Common/TypeSystem/Sorting/InstantiatedMethod.Sorting.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Sorting/InstantiatedMethod.Sorting.cs
@@ -4,7 +4,7 @@
namespace Internal.TypeSystem
{
// Functionality related to deterministic ordering of types
- partial class InstantiatedMethod
+ public partial class InstantiatedMethod
{
protected internal override int ClassCode => -873941872;
@@ -16,9 +16,9 @@ namespace Internal.TypeSystem
// to each other. This is a better heuristic than sorting by method definition
// then by instantiation.
//
- // The goal is to sort methods like SomeClass.SomeMethod<UserStruct>,
+ // The goal is to sort methods like SomeClass.SomeMethod<UserStruct>,
// near SomeOtherClass.SomeOtherMethod<UserStruct, int>
- int result = 0;
+ int result;
// Sort instantiations of the same type together
for (int i = 0; i < _instantiation.Length; i++)
{
diff --git a/src/coreclr/tools/Common/TypeSystem/Sorting/InstantiatedType.Sorting.cs b/src/coreclr/tools/Common/TypeSystem/Sorting/InstantiatedType.Sorting.cs
index 887effee970..ff304295a7a 100644
--- a/src/coreclr/tools/Common/TypeSystem/Sorting/InstantiatedType.Sorting.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Sorting/InstantiatedType.Sorting.cs
@@ -1,12 +1,10 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using Debug = System.Diagnostics.Debug;
-
namespace Internal.TypeSystem
{
// Functionality related to deterministic ordering of types
- partial class InstantiatedType
+ public partial class InstantiatedType
{
protected internal override int ClassCode => 1150020412;
@@ -21,13 +19,13 @@ namespace Internal.TypeSystem
// The goal is to sort classes like SomeClass<UserStruct>,
// near SomeOtherClass<UserStruct, int>
- int result = 0;
// Sort instantiations of the same type together
for (int i = 0; i < _instantiation.Length; i++)
{
if (i >= otherType._instantiation.Length)
return 1;
- result = comparer.Compare(_instantiation[i], otherType._instantiation[i]);
+
+ int result = comparer.Compare(_instantiation[i], otherType._instantiation[i]);
if (result != 0)
return result;
}
diff --git a/src/coreclr/tools/Common/TypeSystem/Sorting/MethodDesc.Sorting.cs b/src/coreclr/tools/Common/TypeSystem/Sorting/MethodDesc.Sorting.cs
index baa78bda203..05f1091628a 100644
--- a/src/coreclr/tools/Common/TypeSystem/Sorting/MethodDesc.Sorting.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Sorting/MethodDesc.Sorting.cs
@@ -4,7 +4,7 @@
namespace Internal.TypeSystem
{
// Functionality related to deterministic ordering of types and members
- partial class MethodDesc
+ public partial class MethodDesc
{
/// <summary>
/// Gets an identifier that is the same for all instances of this <see cref="MethodDesc"/>
diff --git a/src/coreclr/tools/Common/TypeSystem/Sorting/MethodForInstantiatedType.Sorting.cs b/src/coreclr/tools/Common/TypeSystem/Sorting/MethodForInstantiatedType.Sorting.cs
index eabd0ce0a23..3de11f8d634 100644
--- a/src/coreclr/tools/Common/TypeSystem/Sorting/MethodForInstantiatedType.Sorting.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Sorting/MethodForInstantiatedType.Sorting.cs
@@ -4,7 +4,7 @@
namespace Internal.TypeSystem
{
// Functionality related to deterministic ordering of types
- partial class MethodForInstantiatedType
+ public partial class MethodForInstantiatedType
{
protected internal override int ClassCode => 1359759636;
diff --git a/src/coreclr/tools/Common/TypeSystem/Sorting/MethodSignature.Sorting.cs b/src/coreclr/tools/Common/TypeSystem/Sorting/MethodSignature.Sorting.cs
index edeaf981a52..4ec7211d7b9 100644
--- a/src/coreclr/tools/Common/TypeSystem/Sorting/MethodSignature.Sorting.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Sorting/MethodSignature.Sorting.cs
@@ -4,7 +4,7 @@
namespace Internal.TypeSystem
{
// Functionality related to deterministic ordering of types
- partial class MethodSignature
+ public partial class MethodSignature
{
internal int CompareTo(MethodSignature other, TypeSystemComparer comparer)
{
diff --git a/src/coreclr/tools/Common/TypeSystem/Sorting/PointerType.Sorting.cs b/src/coreclr/tools/Common/TypeSystem/Sorting/PointerType.Sorting.cs
index 6d2a13ebe30..e8eb0276aa5 100644
--- a/src/coreclr/tools/Common/TypeSystem/Sorting/PointerType.Sorting.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Sorting/PointerType.Sorting.cs
@@ -4,7 +4,7 @@
namespace Internal.TypeSystem
{
// Functionality related to deterministic ordering of types
- partial class PointerType
+ public partial class PointerType
{
protected internal override int ClassCode => -2124247792;
diff --git a/src/coreclr/tools/Common/TypeSystem/Sorting/SignatureVariable.Sorting.cs b/src/coreclr/tools/Common/TypeSystem/Sorting/SignatureVariable.Sorting.cs
index ddfdbb065da..b11a1b3f414 100644
--- a/src/coreclr/tools/Common/TypeSystem/Sorting/SignatureVariable.Sorting.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Sorting/SignatureVariable.Sorting.cs
@@ -1,12 +1,10 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-
namespace Internal.TypeSystem
{
// Functionality related to deterministic ordering of types
- partial class SignatureVariable
+ public partial class SignatureVariable
{
protected internal sealed override int CompareToImpl(TypeDesc other, TypeSystemComparer comparer)
{
@@ -14,7 +12,7 @@ namespace Internal.TypeSystem
}
}
- partial class SignatureTypeVariable
+ public partial class SignatureTypeVariable
{
protected internal override int ClassCode
{
@@ -25,7 +23,7 @@ namespace Internal.TypeSystem
}
}
- partial class SignatureMethodVariable
+ public partial class SignatureMethodVariable
{
protected internal override int ClassCode
{
diff --git a/src/coreclr/tools/Common/TypeSystem/Sorting/TypeDesc.Sorting.cs b/src/coreclr/tools/Common/TypeSystem/Sorting/TypeDesc.Sorting.cs
index 7c75359d7cb..8ed7b8b5374 100644
--- a/src/coreclr/tools/Common/TypeSystem/Sorting/TypeDesc.Sorting.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Sorting/TypeDesc.Sorting.cs
@@ -4,7 +4,7 @@
namespace Internal.TypeSystem
{
// Functionality related to deterministic ordering of types and members
- partial class TypeDesc
+ public partial class TypeDesc
{
/// <summary>
/// Gets an identifier that is the same for all instances of this <see cref="TypeDesc"/>
diff --git a/src/coreclr/tools/Common/TypeSystem/Sorting/TypeSystemComparer.cs b/src/coreclr/tools/Common/TypeSystem/Sorting/TypeSystemComparer.cs
index 39f795683d6..4db2f4e603e 100644
--- a/src/coreclr/tools/Common/TypeSystem/Sorting/TypeSystemComparer.cs
+++ b/src/coreclr/tools/Common/TypeSystem/Sorting/TypeSystemComparer.cs
@@ -131,4 +131,3 @@ namespace Internal.TypeSystem
}
}
}
-