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
diff options
context:
space:
mode:
authorJackson Schuster <jschuster@microsoft.com>2021-12-03 07:45:05 +0300
committerJackson Schuster <jschuster@microsoft.com>2021-12-10 01:39:52 +0300
commitc6293114a2d7c5134382505c495895c1f336e09c (patch)
tree8bd128e2dfc76f665f7ffd579caabb8dbe24a2ad
parentb0f04f14a791fc463129e0d463be58cfbb1748f4 (diff)
Revert files not associated with the bug fix
-rw-r--r--README.md18
-rw-r--r--src/ILLink.RoslynAnalyzer/COMAnalyzer.cs5
-rw-r--r--test/Mono.Linker.Tests.Cases/Interop/PInvoke/Warnings/ComPInvokeWarning.cs13
-rw-r--r--test/Mono.Linker.Tests.Cases/RequiresCapability/RequiresCapability.cs2
4 files changed, 5 insertions, 33 deletions
diff --git a/README.md b/README.md
index 5db37f645..7ec418620 100644
--- a/README.md
+++ b/README.md
@@ -25,24 +25,6 @@ Another tool available for developers is implemented as [Roslyn Analyzer](src/IL
We welcome contributions! Many developers have helped make this project better by reporting [issues](https://github.com/dotnet/linker/issues) or contributing [pull requests](https://github.com/dotnet/linker/pulls).
-## Clone the repo
-
-When cloning the repository, use the `--recurse-submodules` flag with git or the GitHub CLI to include the submodules.
-
-```sh
-git clone https://github.com/dotnet/linker.git --recurse-submodules
-```
-
-```sh
-gh repo clone dotnet/linker --recurse-submodules
-```
-
-Alternatively, clone the repository without the flag and update the submodules separately.
-
-```sh
-git submodule update --init --recursive
-```
-
## How to build all projects
There is a shell script available in the root folder which can build the whole project and much more (build.cmd on Windows).
diff --git a/src/ILLink.RoslynAnalyzer/COMAnalyzer.cs b/src/ILLink.RoslynAnalyzer/COMAnalyzer.cs
index 05e0aa097..8e7dfe82c 100644
--- a/src/ILLink.RoslynAnalyzer/COMAnalyzer.cs
+++ b/src/ILLink.RoslynAnalyzer/COMAnalyzer.cs
@@ -18,7 +18,6 @@ namespace ILLink.RoslynAnalyzer
private const string StructLayoutAttribute = nameof (StructLayoutAttribute);
private const string DllImportAttribute = nameof (DllImportAttribute);
private const string MarshalAsAttribute = nameof (MarshalAsAttribute);
- private const string RequiresUnreferencedCodeAttribute = nameof (RequiresUnreferencedCodeAttribute);
static readonly DiagnosticDescriptor s_correctnessOfCOMCannotBeGuaranteed = DiagnosticDescriptors.GetDiagnosticDescriptor (DiagnosticId.CorrectnessOfCOMCannotBeGuaranteed,
helpLinkUri: "https://docs.microsoft.com/en-us/dotnet/core/deploying/trim-warnings/il2050");
@@ -40,10 +39,6 @@ namespace ILLink.RoslynAnalyzer
if (!targetMethod.HasAttribute (DllImportAttribute))
return;
- if (operationContext.ContainingSymbol is ISymbol containingSymbol && containingSymbol.HasAttribute(RequiresUnreferencedCodeAttribute)) {
- return;
- }
-
bool comDangerousMethod = IsComInterop (targetMethod.ReturnType);
foreach (var parameter in targetMethod.Parameters) {
comDangerousMethod |= IsComInterop (parameter);
diff --git a/test/Mono.Linker.Tests.Cases/Interop/PInvoke/Warnings/ComPInvokeWarning.cs b/test/Mono.Linker.Tests.Cases/Interop/PInvoke/Warnings/ComPInvokeWarning.cs
index a92e86945..c652f26fd 100644
--- a/test/Mono.Linker.Tests.Cases/Interop/PInvoke/Warnings/ComPInvokeWarning.cs
+++ b/test/Mono.Linker.Tests.Cases/Interop/PInvoke/Warnings/ComPInvokeWarning.cs
@@ -30,7 +30,6 @@ namespace Mono.Linker.Tests.Cases.Interop.PInvoke.Warnings
Call_CanSuppressWarningOnParameter ();
Call_CanSuppressWarningOnReturnType ();
Call_CanSuppressWithRequiresUnreferencedCode ();
- Call_CanSuppressWithRequiresUnreferencedCodeInLambda ();
Call_CanSuppressPInvokeWithRequiresUnreferencedCode ();
Call_PInvokeWithRequiresUnreferencedCode ();
}
@@ -157,6 +156,8 @@ namespace Mono.Linker.Tests.Cases.Interop.PInvoke.Warnings
static extern IFoo CanSuppressWarningOnReturnType ();
[RequiresUnreferencedCode ("test")]
+ // Bug https://github.com/dotnet/linker/issues/2378
+ [ExpectedWarning ("IL2050", ProducedBy = ProducedBy.Analyzer)]
static void Call_CanSuppressWithRequiresUnreferencedCode ()
{
CanSuppressWithRequiresUnreferencedCode (null);
@@ -166,6 +167,8 @@ namespace Mono.Linker.Tests.Cases.Interop.PInvoke.Warnings
static extern void CanSuppressWithRequiresUnreferencedCode (IFoo foo);
[RequiresUnreferencedCode ("test")]
+ // Bug https://github.com/dotnet/linker/issues/2378
+ [ExpectedWarning ("IL2050", ProducedBy = ProducedBy.Analyzer)]
static void Call_CanSuppressPInvokeWithRequiresUnreferencedCode ()
{
CanSuppressPInvokeWithRequiresUnreferencedCode (null);
@@ -175,14 +178,6 @@ namespace Mono.Linker.Tests.Cases.Interop.PInvoke.Warnings
[DllImport ("Foo")]
static extern void CanSuppressPInvokeWithRequiresUnreferencedCode (IFoo foo);
- [RequiresUnreferencedCode ("test")]
- static void Call_CanSuppressWithRequiresUnreferencedCodeInLambda ()
- {
- var lambda = () => CanSuppressWithRequiresUnreferencedCode (null);
- lambda ();
- }
-
-
[ExpectedWarning ("IL2050")]
[ExpectedWarning ("IL2026")]
static void Call_PInvokeWithRequiresUnreferencedCode ()
diff --git a/test/Mono.Linker.Tests.Cases/RequiresCapability/RequiresCapability.cs b/test/Mono.Linker.Tests.Cases/RequiresCapability/RequiresCapability.cs
index 0cb975aa4..6d0d97dd3 100644
--- a/test/Mono.Linker.Tests.Cases/RequiresCapability/RequiresCapability.cs
+++ b/test/Mono.Linker.Tests.Cases/RequiresCapability/RequiresCapability.cs
@@ -2083,4 +2083,4 @@ namespace Mono.Linker.Tests.Cases.RequiresCapability
}
}
}
-} \ No newline at end of file
+}