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-10Unpin compiler version and use net6.0 for ilasmdarc-release/7.0-498ece01-94fe-4605-8e70-f2f687a221b1Sven Boemer
2022-11-09Update dependencies from https://github.com/dotnet/arcade build 20221108.4dotnet-maestro[bot]
Microsoft.DotNet.ApiCompat , Microsoft.DotNet.Arcade.Sdk From Version 7.0.0-beta.22379.10 -> To Version 7.0.0-beta.22558.4
2022-10-14Update dependencies from https://github.com/dotnet/arcade build 20221013.4dotnet-maestro[bot]
Microsoft.DotNet.ApiCompat , Microsoft.DotNet.Arcade.Sdk From Version 7.0.0-beta.22379.10 -> To Version 7.0.0-beta.22513.4
2022-09-20Update dependencies from https://github.com/dotnet/arcade build 20220914.4dotnet-maestro[bot]
Microsoft.DotNet.ApiCompat , Microsoft.DotNet.Arcade.Sdk From Version 7.0.0-beta.22379.10 -> To Version 7.0.0-beta.22464.4
2022-09-09Update dependencies from https://github.com/dotnet/arcade build 20220908.5dotnet-maestro[bot]
Microsoft.DotNet.ApiCompat , Microsoft.DotNet.Arcade.Sdk From Version 7.0.0-beta.22379.10 -> To Version 7.0.0-beta.22458.5
2022-08-19Update dependencies from https://github.com/dotnet/arcade build 20220818.4dotnet-maestro[bot]
Microsoft.DotNet.ApiCompat , Microsoft.DotNet.Arcade.Sdk From Version 7.0.0-beta.22379.10 -> To Version 7.0.0-beta.22418.4
2022-08-16Use HashSet instead of List for _virtual_methods (#2976)Jackson Schuster
* Use a HashSet instead of List for MarkStep._virtual_methods
2022-08-15Suppress warning in instance fields if the instance constructors are ↵Tlakaelel Axayakatl Ceja
annotated with Requires (#2973)
2022-08-15Add IL Verification to tests (#2960)Jackson Schuster
Adds an ILVerifier to check that the IL produced by the linker is valid. Unsafe C# produced unverifiable code, so we skip verification when we pass that flag to the compiler. Also, there are a few warnings that are produced by valid C# with new features like static abstract interface methods and ref fields and ref returns. In the future, it may be nice to add better error messages with the type, method name, and IL offset that produced the error, and perhaps an [ExpectedILVerifyError] attribute instead of filtering all of a type of error, but those are non-trivial to implement and don't occur in many tests (<10), so I haven't done that yet.
2022-08-15Add MakeGenericMethod tests for static interface methods (#2962)Jackson Schuster
2022-08-13Fix exception when generating warning for method definition (#2972)Vitek Karas
If we produce a warning for the method itself (no IL offset) and the method has debug symbols, it can happen that there's no sequence point for the first instruction. In that case the current code will crash because we expect to always find sequence point for offset 0. Fix this by looking for the first sequence point instead.
2022-08-12Dataflow support for ref fields (#2947)Jackson Schuster
Adds support and basic tests for ref fields. The tests ensure that a value written to an ref field is properly annotated, or an address written to a ref field has a properly annotated value, but there are some holes that can be created by assigning the address of a local or over-annotated value to an annotated ref field.
2022-08-12Fix il corruption (#2966)Sven Boemer
This prevents invalid IL in situations where removing the last instruction of a method would result in the last instruction being a conditional branch. There needs to be some IL in the not-taken branch for the IL to be valid, so this fixes the issue by injecting "ldnull; throw" at the end. Co-authored-by: vitek-karas <10670590+vitek-karas@users.noreply.github.com> Co-authored-by: Adam Sitnik <adam.sitnik@gmail.com>
2022-08-12Added IL2121 to error-codes.md (#2964)Jeremi Kurdek
2022-08-12Revert analyzer to lower CodeAnalysis version (#2968)Jackson Schuster
Analyzers look for a newer version of Microsoft.CodeAnalysis than exists in the latest version of Visual Studio, and so they don't run in FullFramework tests in dotnet/sdk#26993. This reverts the version used in the analyzers. PR #2969 will undo this change once Visual Studio ships with the correct version of Microsoft.CodeAnalysis.
2022-08-11Process static interface methods as virtual methods (#2926)Jackson Schuster
Static methods implementing static interface methods are not marked as virtual and were not checked for matching RUC and DAM annotations. This change adds all base methods to the _virtual_methods list to be checked for matching DAM and RUC annotations. This may cause extra/unnecessary warnings for mismatched annotations even a method is removed by the linker.
2022-08-10Fix missing parenthesis (#2956)Sven Boemer
2022-08-10Pin compiler version to fix build (#2958)Sven Boemer
fe3a96424d28fb5b1eee4ca8c7e1713aa37247a4 and d9aebf322b9dd6dcea16576d886bffbbe15e902f together broke the build because we are referencing a version of the compiler package greater than that used to compile the project. This uses the same version for both.
2022-08-09Test that basic ref field operations don't crash linker (#2952)Jackson Schuster
Adds test to use ref fields in various ways to confirm that they don't cause the linker to crash.
2022-08-09Build with preview5 SDK (#2954)Sven Boemer
dede5f58dc9b7296de884ed62688b35d5b154b78 didn't fix the dependency flow, because the packages for some reason are still being produced with a preview7 in the runtimeconfig. Lacking better workarounds, this change builds with the preview5 SDK that was selected in #2884 before we decided to update to preview7 (due to a dotnet-format bug). This disables the lint job to prevent those failures. We should turn it back on once we can use preview7 (once dotnet/runtime and dotnet/sdk are on preview7).
2022-08-09Update dependencies from https://github.com/dotnet/runtime build 20220807.4 ↵dotnet-maestro[bot]
(#2951) [main] Update dependencies from dotnet/runtime
2022-08-09Fixed IL2121 single warn issue (#2953)Jeremi Kurdek
2022-08-08Aot to linker sync (#2944)Vitek Karas
Sync tweaks necessary for the linker/AOT integration
2022-08-08[analyzer tool] Avoid exceptions when loading dependencies (#2949)Vitek Karas
The existing code used exceptions as a way to determine if item is part of a dictionary. That is pretty expensive and slows down loading of the dependencies quite a bit (we do it A LOT). Rewrite the code to avoid exceptions in this case.
2022-08-06Use preview 5 framework version in runtimeconfig (#2948)Sven Boemer
2022-08-05Include all warnings under suppression setting (#2930)Sven Boemer
SuppressTrimAnalysisWarnings now includes all warning codes produced by the linker or trim analyzer. Previously, only warnings in the "Trim analysis" category (see MessageSubCategory.cs) were suppressed by this setting. This makes the logic more future-proof so we don't need to keep adding new warning codes to the list. This does change the behavior a bit. It includes warnings that weren't previously part of the list. Additionally, previously if you set: <EnableTrimAnalyzer>true</EnableTrimAnalyzer> <SuppressTrimAnalysisWarnings>true</SuppressTrimAnalysisWarnings> you wouldn't see trim analysis warnings from the analyzer. With this change, you will. Similarly, previously if you set <ILLinkWarningLevel>5</ILLinkWarningLevel> <SuppressTrimAnalysisWarnings>true</SuppressTrimAnalysisWarnings> you wouldn't see trim analysis warnings, but after this change you will.
2022-08-04Update MSBuild version to fix official build (#2945)Sven Boemer
2022-08-04Update dependencies from https://github.com/dotnet/arcade build 20220729.10 ↵dotnet-maestro[bot]
(#2935) Microsoft.DotNet.ApiCompat , Microsoft.DotNet.Arcade.Sdk From Version 7.0.0-beta.22372.1 -> To Version 7.0.0-beta.22379.10 Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2022-08-04Update dependencies from https://github.com/dotnet/runtime build 20220731.5 ↵dotnet-maestro[bot]
(#2936) Microsoft.NET.Sdk.IL From Version 7.0.0-rc.1.22374.4 -> To Version 7.0.0-rc.1.22381.5 Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2022-08-04Improve tests and docs (#2941)Mike Voorhees
* Add a test for the `<namespace>` element. There were no tests. * Expand `CanPreserveTypesUsingRegex` to help highlight how it behaves differently from `<namespace>` * Add more examples to the docs
2022-08-04Adds a test with two annotated out params for the same method. (#2875)Vitek Karas
Test for https://github.com/dotnet/linker/issues/2874.
2022-08-04New constraint on a generic argument involved in MakeGenericType/Method ↵Vitek Karas
should warn (#2942) For correctness linker must be able to validate that generic parameters with new constraint will have their default .ctor preserved. If that can't be guaranteed, it needs to warn. Added tests for cases around this. Nullable<> is the only exception to this rule, so changed the code to completely skip any validation for it.
2022-08-03Separate interface method trimming logic and update for static interface ↵Jackson Schuster
methods (#2868) Fixes #2865 Also addresses marking of all static interface methods encompassing the changes from #2859, and updates the way that all interface methods are marked. Whether or not we mark an interface method due to its base method is now separated from marking other virtual methods and the marking is postponed to ProcessMarkedTypesWithInterface. In ProcessMarkedTypesWithInterfaces, interface implementations are marked, and methods that implement a marked/implemented interface are marked. Tests for static interface methods have also been updated. Co-authored-by: Sven Boemer <sbomer@gmail.com>
2022-08-02Redundant suppressions support for suppressions on events and properties ↵Jeremi Kurdek
(#2925) (#2940)
2022-08-02Redundant suppressions detection (#2922)Jeremi Kurdek
Implementation of the feature described in #2891.
2022-08-01Sync test changes from AOT (#2912)Vitek Karas
2022-08-01Add another local function branch removal test (#2931)Sven Boemer
This is like the existing test, but additionally shows a visible difference in the warning behavior. When the warning is produced for generic arguments rather than dataflow, it will show up even if we don't do dataflow for the local function whose callsite was removed. When branch removal breaks the link between the local function and its user method, this can result in warning suppressions that don't take effect. We could use the desired warning behavior to decide what the fix needs to do (whether it should do compiler-generated owning method detection before vs after constant propagation for the method).
2022-08-01Update DAMCodeFixProvider.cs (#2932)Youssef Victor
Add ExportCodeFixProvider attribute Co-authored-by: Isabel Serrato <iserrato@olin.edu>
2022-08-01Make serialization discovery opt-in (#2929)Sven Boemer
Serialization discovery is an undocumented quirk that exists for back-compat in xamarin scenarios. We turned it on by default in .NET 6, but would like to remove such quirks from the default options in .NET 7. This changes the (undocumented) command-line option to be opt-in. Xamarin SDKs will be expected to pass this option by setting <_ExtraTrimmerArgs>--enable-serialization-discovery</_ExtraTrimmerArgs>.
2022-07-29Add an interesting test case for compiler generated code marking (#2928)Vitek Karas
See the test for description of what it does. It's basically the linker repro for the case hit in https://github.com/dotnet/runtime/issues/73027#issuecomment-1199199943
2022-07-29Added support for suppressions on properties (#2925)Jeremi Kurdek
Suppressions can be now placed on properties and events.
2022-07-28[main] Update dependencies from dotnet/arcade (#2884)dotnet-maestro[bot]
[main] Update dependencies from dotnet/arcade - Bump to 7.0 preview6 sdk Fixes the dotnet-format issue. - Use TryGetValue instead of ContainsKey for Dictionary Fixes "error CA1854: Prefer a 'TryGetValue' call over a Dictionary indexer access guarded by a 'ContainsKey' check to avoid double lookup" - Seal classes to fix CA1852 - Add 7.0 P6 runtime - Upgrade SDK to nightly Preview 7 to get a fix for dotnet test bug
2022-07-27Update to .NET 7.0 TFM (#2919)Logan Bussell
2022-07-27Add more tests for parameter dataflow (#2918)Sven Boemer
Add tests for some edge cases due to the analyzer not treating captured parameters as hoisted variables like the linker does. Currently the analyzer doesn't detect hoisted parameters, and it will treat them like normal parameters - warning if a parameter is assigned a value with an annotation that doesn't match the parameter annotation. The linker will treat captured parameters the same as other captured variables, tracking all values that get assigned. So there is a subtle difference in the warning behavior: - Linker won't warn on assignment to annotated captured parameter, but analyzer will. - Linker will produce dataflow warnings for all values assigned to a captured parameter, but analyzer will not.
2022-07-26Synchronize file type between analyzer and linker (#2917)Isabel Serrato
Makes it so user does not have to zip their dumped dependencies file before running the analyzer and updates documentation to reflect the change.
2022-07-26Map type parameters for static closures (#2899)Sven Boemer
This discovers type parameter mappings between generic type parameters and static closures which reference them. It detects the closure environment by scanning for stsfld instructions which reference generic closure types. There may be multiple methods associated with the same static closure, so this case doesn't produce warnings. This also fixes an unrelated issue where in Release mode, the compiler can generate struct closure environments that will never get instantiated via a ctor call. A new testcase runs the CompilerGeneratedTypes tests in Release mode to cover this.
2022-07-26Update dependencies from https://github.com/dotnet/runtime build 20220724.4 ↵dotnet-maestro[bot]
(#2913) [main] Update dependencies from dotnet/runtime
2022-07-25DynamicallyAccessedMembers CodeFix (#2890)Isabel Serrato
* Create infrastructure for CodeFixers that will generate attribute flags for DynamicallyAccessedMembers (DAM) trimmer warnings. This commit includes fixers for the warnings `DynamicallyAccessedMembersMismatchParameterTargetsThisParameter` and `DynamicallyAccessedMembersMismatchFieldTargetsThisParameter`. Additional DiagnosticIds will be supported by future commits. * Create new class for the DAM CodeFixer that does not rely on base class. The DAM warnings require different attribute placement depending on the type of warning that is raised, causing it to differ from the implementation of the base class. * Added a test file specifically for the DAM CodeFixer, include tests for the functional fixes as well as tests for fixes that will soon be implemented. * Converted all test cases within DAM to use string literals Co-authored-by: Andy Gocke <andy@commentout.net>
2022-07-22Make StaticCs work in source build (#2909)Andy Gocke
2022-07-22Avoid dataflow analysis for generic parameters (#2908)Sven Boemer
This avoids unnecessarily running the reflection methodbody scanner in the linker, and the dataflow analysis in the analyzer, for methods that were previously only triggering dataflow analysis due to annotated generic parameters. This eliminates unnecessary warnings for reflection access to compiler-generated code.