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-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-04-01Files in linker repository now have the same license header at the beginning ↵Tlakaelel Axayakatl Ceja
of the file (#2469) Some of the files that hold a license from a third party now have the two licenses as header files Linker now uses the sdk format of license header instead of the runtime one Added having the license header as warning in the editor config Added THIRD-PARTY-NOTICES.TXT file to the repo root
2021-10-04Sync license header with runtime repo (#2303)Adeel Mujahid
2021-04-15Fixes a nullref and spurious warnings (#1962)Vitek Karas
Both of these issues were found by the same test, so that's why fixing them together. * Null ref in the recently added single-warning logic. If the origin of the warning is a top-level TypeDefinition, the code nullrefs. * If there's an attribute type which should be removed (like NullableAttribute) in a copy assembly, we keep the type. Since all of its members are also marked the code will call MarkType many times on it - the current guard which prevents spurious 2045 warnings doesn't work in this case since the source location member is null (in theory it should be the "copy assembly", but currently we can't represent that). To prevent the warnings it's better to rely on reason.Source as that will be the member always. Tweaked existing tests to cover this case and also added one more test case.
2021-03-30Simplify internal attributes handling by unifying them with custom ↵Marek Safar
attributes (#1911)
2021-01-23Track pending marked members (#1768)Sven Boemer
Track pending marked members This enables tracking of pending marked items which need to be fully marked by MarkStep. Contributes to #1735 - this change is in preparation for running custom steps during MarkStep, where they could change the Annotations state in ways that interact with other marking logic. The idea is that custom steps can call Annotations methods without triggering a lot of other processing, because the full logic is deferred. This way custom steps don't need to be re-entrant. This change causes Annotations.Mark to place members into a set of "pending" items which will get fully marked ("processed") later. "pending" items are already considered marked. AddPreservedMethod conceptually adds a conditional dependency from source -> destination - so if source gets marked, destination should get marked. This change will immediately call Annotations.Mark on the destination if the source is already marked, and otherwise track the condition to be applied if the source gets marked later. SetPreserve can change the TypePreserve of a type after it has been marked. This change will track any changes to TypePreserve and apply them later even for types which have already been marked. This works a little differently from AddPreservedMethod, to avoid traversing type members in Annotations. Note that once we allow custom steps to run during during MarkStep, Process will call ProcessMarkedPending - but this isn't required in this change. The intention here is just to add adding extra tracking (that will actually be used by #1666), while mostly preserving existing behavior.
2021-01-19Remove monolinker build support (#1760)Marek Safar
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
2020-12-18Add a test for attribute removal using wildcard and lazy loading (#1705)Vitek Karas
Currently this doesn't work as it should, the test is to cover the scenario - once we fully implement lazy loading this should be fixed.
2020-10-15Test clean up (#1568)Mike Voorhees
* Remove unused usings from `DynamicDependencyFromAttributeXmlOnNonReferencedAssembly` the extra usings were resulting in a compile error * Replace some Assert.IsTrue usages with Assert.That and Is.EquivalentTo. The failure message from Assert.IsTrue is generally not helpful. * Eliminate line ending mismatch vulnerability from the assert in `WarningsAreSorted` * Fix reference compilation in WarningsAreSorted * Clean up LinkerAttributeRemoval
2020-09-17Remove unused using directive from some test cases (#1494)brian-taylor-unity
2020-08-13Warnings cleanup (#1385)Vitek Karas
The most important change is to make warning codes and messages unique - that is for each code there's exactly one message. This means adding quite a few new codes as we were sharing them rather heavily. We also try to avoid logic when constructing messages (to allow for better localization), so instead of having smaller pieces concatenated we introduce several similar warnings. This change also adds more tests for some of the warnings. Infra changes: * Add the warning code parameter to unrecognized reflection call on the interface * Add a new ExpectedWarning test attribute which validates the code, the location and optionally parts of the message * Improved the unrecognized reflection pattern attribute to accept only parts of the message (and to accept more than one) * Add the ability to validat the warning code for unrecognised reflection patterns * Refactor source context for annotated values Makes the source context required by making it a a .ctor argument for all annotated nodes. Make it IMetadataTokenProvider. Fixes the problem with AnnotatedStringValue which was reported as "unknown" in warning messages. This also slightly changes what is stored in the SourceContext - now it's the actual thing (so ParameterDefinition, MethodReturnType and so on) - so printing it out doesn't require knowing which value node it came from. This is cleaner because the SourceContext describes where the value came from, not what the value is (that's the job of the ValueNode). In warnings we typically don't want to print out what the value is since in most cases we don't know the actual value (we just know things about it), so we can rely on SourceContext to simplify some code. Co-authored-by: Sven Boemer <sbomer@gmail.com>
2020-08-04Add support for property tag on CA annotations (#1397)Mateo Torres-Ruiz
* Add support for property tag on CA annotations
2020-07-23Removed the TODOs as per discussion in the PRvitek-karas
2020-07-21Don't generate warning 2045 due to the attribute type members referencing ↵vitek-karas
the type itself If an attribute is marked for removal of instances, but the linker keeps the attribute type for other reasons (for example because it's used from a copy assembly) then there will be several other references to the attribute type from the code within the attribute type itself. These warnings are useless and should not be generated. Other changes: * Moved link attribute tests into their own separate folder - they don't belong to DataFlow tests * The log verification logic now removes messages which where matched by LogContains attributes, so it's possible to validate that there are not other messages of the same kind by adding LogDoesntContain at the end