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

github.com/mono/linker.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-11-10Use ContainingType instead of ContainingSymbol in GetReferenceKind (#3107)HEADmainJackson Schuster
2022-11-09Implements dead branch removal for switch opcode (#2905)Marek Safar
Fixes https://github.com/dotnet/linker/issues/2888
2022-11-09Sync shared code changes from NativeAOT (#3101)Vitek Karas
Syncing back updates to the shared code from NativeAOT. Mostly formatting - runtime has enabled an analyzer which requires all members to have visibility assigned explicitly. Some cleanup.
2022-11-08Merge pull request #3099 from dotnet/enable_codeqlMitchell Hwang
Enable CodeQL with TSA
2022-11-08FIx area pathMitchell Hwang
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
2022-11-08Add KeptByAttribute to validate an item was kept due to a specific ↵Jackson Schuster
dependency (#3096) The tests we have in the linker try to ensure that something can only be kept for a certain reason, but it can be hard to ensure it's not being kept for another reason. For example, sometimes we use typeof(TestType) to mark a type, but that also makes it relevant to variant casting, which can cause parts of TestType to be kept for unintended reasons. This PR creates the KeptByAttribute which accepts a fully qualified string in Cecil format to indicate depenency provider (the thing that is creating the dependency that marks the item with the attribute), as well as a string representing the DependencyKind to specify the "reason" there was a dependency between the two. It also can accept a System.Type, or a System.Type + name of the member to indicate the dependency provider.
2022-11-07Update dependencies from https://github.com/dotnet/arcade build 20221104.2 ↵dotnet-maestro[bot]
(#3102) [main] Update dependencies from dotnet/arcade
2022-11-03Enable CodeQL with TSAmdh1418
2022-11-02Don't mark override of abstract base if the override's declaring type is not ↵Jackson Schuster
marked (#3098) * Don't mark an override every time the base is abstract, only if the declaring type is also marked Adds a condition to ShouldMarkOverrideForBase to exit early if the declaring type of the method is not marked.
2022-11-02Fix branch removal in compiler generated code (#3088)Vitek Karas
Changes to processing of compiler generated methods lead to a state where we don't call constant prop and branch removal in all cases before we mark instructions of the method. This can lead to overmarking This change fixes this by making sure that the branch removal executes on the method in all cases before we mark instructions of the method. The change guarantees that all accesses to Body are after the constant prop/branch removal happened on the method. This does have one possibly negative impact: the issue described in https://github.com/dotnet/linker/issues/2937 is now consistent and happens always. Added tests. Note that there's still a whole in analysis of compiler generated code around state machines, see https://github.com/dotnet/linker/issues/3087 Basically if there's a local function which is going to be removed due to branch removal and if the body of that method contains code which produces a warning due to generic parameter validation, such warning will always be generated even though it's "dead" code and even if it's suppressed via RUC or similar. In such case the analysis can't figure out to which method the local function belongs (since the call site has been removed).
2022-10-31Update dependencies from https://github.com/dotnet/arcade build 20221024.5 ↵dotnet-maestro[bot]
(#3092) [main] Update dependencies from dotnet/arcade
2022-10-31Update ILLink.RoslynAnalyzer.csproj Microsoft.CodeAnalysis.CSharp version ↵Michael Simons
(#3091)
2022-10-28Check for marking virtual method due to base only when state changes (#3073)Jackson Schuster
Instead of checking every virtual method to see if it should be kept due to a base method every iteration of the MarkStep pipeline, check each method only when its relevant state has changed. Co-authored-by: Sven Boemer <sbomer@gmail.com>
2022-10-27Update CI status in readme (#3086)Jackson Schuster
* Update CI status in readme Co-authored-by: Sven Boemer <sbomer@gmail.com>
2022-10-27Create `ParameterProxy` to wrap logic surrounding parameters and use one ↵Jackson Schuster
`ParameterIndex` struct to index (#3059) This reverts commit 45e2e5944abc04763263cc1c4b3f9ed86659ae43. This commit creates a 'ParameterProxy' type and 'ParameterIndex' to represent parameters in a consistent way. This is motivated by using 'int' to represent different ways of counting parameters (sometimes offset by 1 for the 'this' parameter, sometimes not offset). ParameterIndex should now be the only type used to index into a method's parameters. ParameterIndex represents the index of the parameter as it is passed to the method in IL (i.e. 'this' is the 0 index in instance methods). ParameterProxy wraps the common convention of a MethodProxy and int to represent a parameter, and now holds a Method and a ParameterIndex to encapsulate a Parameter. No behavioral changes are expected from this change. Co-authored-by: Vitek Karas <10670590+vitek-karas@users.noreply.github.com> Co-authored-by: dotnet-maestro[bot] <42748379+dotnet-maestro[bot]@users.noreply.github.com>
2022-10-26Update linker and analyzer to handle DAM on indexable property parameters ↵Jackson Schuster
(#3081) Don't assume there is only one parameter for set and none for get. Allow DAM on the index parameters of properties. Co-authored-by: vitek-karas <10670590+vitek-karas@users.noreply.github.com> Co-authored-by: Sven Boemer <sbomer@gmail.com>
2022-10-25Change analyzer versions such that the repo can be built with .NET 7 RC2 SDK ↵Vitek Karas
(#3077) Change analyzer versions such that the repo can be built with .NET 7 RC2 SDK. - Took the versions from dotnet/runtime. - Remove CheckAttributeInstantiation method since is no longer necessary - Remove global attributes since they are no longer necessary - Workaround the fact that compiler injects System.Runtime.CompilerServices.RefSafetyRulesAttribute into every assembly to describe the language version Co-authored-by: tlakollo <tlakaelel_axayakatl@outlook.com>
2022-10-24Update dependencies from https://github.com/dotnet/arcade build 20221020.1 ↵dotnet-maestro[bot]
(#3079) [main] Update dependencies from dotnet/arcade
2022-10-20Use LinkContext caching when resolving ExportedTypes (#3075)Jackson Schuster
2022-10-18[main] Update dependencies from dotnet/runtime (#3055)dotnet-maestro[bot]
[main] Update dependencies from dotnet/runtime
2022-10-18[main] Update dependencies from dotnet/arcade (#3054)dotnet-maestro[bot]
[main] Update dependencies from dotnet/arcade
2022-10-14Add Doc comments for IntrinsicIds (#3063)Jackson Schuster
2022-10-07Remove redundant checks in IntrinsicId switch statements (#3060)Jackson Schuster
Remove redundant checks on intrinsicIds Rename Get<Member>s(BindingFlags) enum variants Make intrinsicId a required param Add doc comments for a few intrinsicIds
2022-10-04Update docker to the latest tagging schema (#3057)Djuradj Kurepa
2022-09-27Use new build images (#3051)Sven Boemer
2022-09-27Check for nulls in IsInterfaceImplementationNeededByTypeDueToInterface (#3050)Jackson Schuster
2022-09-26Update dependencies from https://github.com/dotnet/runtime build 20220923.12 ↵dotnet-maestro[bot]
(#3049) [main] Update dependencies from dotnet/runtime
2022-09-26Update dependencies from https://github.com/dotnet/arcade build 20220923.1 ↵dotnet-maestro[bot]
(#3048) [main] Update dependencies from dotnet/arcade
2022-09-22Update dependencies from https://github.com/dotnet/runtime build 20220916.6 ↵dotnet-maestro[bot]
(#3041) [main] Update dependencies from dotnet/runtime
2022-09-22Update dependencies from https://github.com/dotnet/arcade build 20220916.3 ↵dotnet-maestro[bot]
(#3040) [main] Update dependencies from dotnet/arcade
2022-09-21Add event source tracing (#3043)Jackson Schuster
Adds EventSource events for the start and end of Main() and for the start and end of each call to IStep.Process(). The dotnet/performance scenarios can use ETW events to give a more detailed breakdown of where time is spent. This PR creates a few simple events to be able to track the time the linker takes from process start to end more precisely without any noise from MSBuild. If we want to track more fine-grained details, it will be easy to add them in the future. LinkerStart is emitted right at the start of Main(). LinkerStop is emitted right before returning from Main(). LinkerStepStart is emitted right before calling IStep.Process. LinkerStrpStop is emitted right after IStep.Process returns.
2022-09-21Cleanup tests for cases which use different warnings codes that the test ↵Vitek Karas
mentions (#3044) We were lacking validation for some of the warnings, and so change in behavior of the product wasn't reflected in the tests. This cleans up tests for IL2053 and IL2054 (which are not produced anymore).
2022-09-19Remove --keep-facades option (#3036)Sven Boemer
* Remove --keep-facades option
2022-09-19[main] Update dependencies from dotnet/runtime (#3024)dotnet-maestro[bot]
[main] Update dependencies from dotnet/runtime
2022-09-19[main] Update dependencies from dotnet/arcade (#3023)dotnet-maestro[bot]
[main] Update dependencies from dotnet/arcade
2022-09-16Better warning message for DynamicDependency problem (#3035)Vitek Karas
* Improve warning message for DynamicDependency to include the name of the type along with the name of the member we were looking for. * Fix tests
2022-09-15Fix how keeping something due to DynamicDependency is traced (#3033)Vitek Karas
Fixes https://github.com/dotnet/linker/issues/1374
2022-09-08Fix lint command (#3027)Tlakaelel Axayakatl Ceja
Use new version of MicrosoftCodeAnalysisVersion in linker (Copy from runtime) to fix the dotnet format command Run the dotnet format command Reenable Lint check in ci pipelines
2022-09-06Sync AOT tests with linker (#3026)Tlakaelel Axayakatl Ceja
2022-09-02Allow codefixer to annotate accessor declarations as methods (#3017)Tlakaelel Axayakatl Ceja
Allow codefixer to insert a fix in accessor declarations if we target methods Fix tests that had accessors and were annotating properties/events Add tests
2022-09-01Fixes a null ref which happens when an XML comment cref contains generic ↵Vitek Karas
instantiation (#3015) * Fixes a null ref which happens when an XML comment cref contains generic instantiation In the cref some of the symbols (for example the type argument) are missing containing symbols, which leads to null refs. In any case, we should not perform any analysis on symbols inside crefs, only on real code. So this modifies the analyzer to ignore any symbol inside a cref. Adds a test to validate this. * Simplify the test
2022-09-01Update public pool names (#3013)Alex Perovich
Co-authored-by: Matt Galbraith <mattgal@microsoft.com>
2022-09-01[main] Update dependencies from dotnet/runtime (#2974)dotnet-maestro[bot]
[main] Update dependencies from dotnet/runtime
2022-08-31Verify if COM dangerous during call site check (#3009)Jeremi Kurdek
The motivation of the change is to reduce the number of unnecessary warnings around PInvokes. The change makes the RequiresReflectionMethodBodyScannerForCallSite check for COM to decide whether dataflow analysis is needed for PInvokes.
2022-08-30Update dependencies from https://github.com/dotnet/arcade build 20220826.8 ↵dotnet-maestro[bot]
(#3006) Microsoft.DotNet.ApiCompat , Microsoft.DotNet.Arcade.Sdk From Version 7.0.0-beta.22419.1 -> To Version 7.0.0-beta.22426.8 Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2022-08-30Annotated TestSystemTypeBase (#3008)Jeremi Kurdek
2022-08-29Use enum for method parameter indexing (#2993)Jackson Schuster
This change adds ILParameterIndex to represent the IL-based indexing where 0 may refer to this, and SourceParameterIndex where 0 is the first "real" parameter in C# source code. Converting from ILParameterIndex to SourceParameterIndex returns a SourceParameterKind to differentiate between thisand other parameters and ensure that anySourceParameterIndexwill be able to indexMethodReference.Parameters`. It uses these in ParameterReferenceValue as well as GetMethodParameterValue() and adds a GetMethodThisParameterValue(), ThisParameterReferenceValue, and bubbles the changes where necessary. Most places should use SourceParameterIndex, and convert to ILParameterIndex when necessary or at the boundary of updated and old code.
2022-08-27[main] Update dependencies from dotnet/arcade (#2950)dotnet-maestro[bot]
* Update dependencies from https://github.com/dotnet/arcade build 20220805.6 Microsoft.DotNet.ApiCompat , Microsoft.DotNet.Arcade.Sdk From Version 7.0.0-beta.22379.10 -> To Version 7.0.0-beta.22405.6 * Update dependencies from https://github.com/dotnet/arcade build 20220811.2 Microsoft.DotNet.ApiCompat , Microsoft.DotNet.Arcade.Sdk From Version 7.0.0-beta.22379.10 -> To Version 7.0.0-beta.22411.2 * Update dependencies from https://github.com/dotnet/arcade build 20220818.4 Microsoft.DotNet.ApiCompat , Microsoft.DotNet.Arcade.Sdk From Version 7.0.0-beta.22379.10 -> To Version 7.0.0-beta.22418.4 * Update dependencies from https://github.com/dotnet/arcade build 20220819.1 Microsoft.DotNet.ApiCompat , Microsoft.DotNet.Arcade.Sdk From Version 7.0.0-beta.22379.10 -> To Version 7.0.0-beta.22419.1 Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2022-08-26Don't suppress all warnings with SuppressTrimAnalysisWarnings (#3003)Sven Boemer
This replaces https://github.com/dotnet/linker/commit/82c6dc6f82aeb90cfbe509ae07cf539eecb75550 with a different approach. Now SuppressTrimAnalysisWarnings only suppresses those warnings defined to be part of the "trim analysis" category, using a separate command-line argument. An exception is 5.0 apps, where the setting continues to suppress specific warnings for compatibility.
2022-08-26Suppress warnings in 6.0 framework (#3000)Sven Boemer
This includes a sidecar XML file which will suppress new warnings in the 6.0 framework. Note that a few of the new warnings for compiler-generated code are suppressed in 7.0 with attributes on local functions. In the XML I had to suppress them with an attribute on the user method (since the signature format doesn't support compiler-generated code). Also note that this approach only includes suppressions for the core framework, not OOB assemblies. OOB assemblies or third-party nuget packages will require a slightly different approach to avoid warnings about unresolved members referenced in XML, in apps where those assemblies aren't used. There are no warnings that we need to suppress in OOB assemblies - only new warnings in already trim-incompatible code. This also includes a fix for a varargs method issue I found while running on the 6.0 framework.