Skip to content

Commit

Permalink
Fix missing changes in from ProducedBy enum change (#82575)
Browse files Browse the repository at this point in the history
  • Loading branch information
tlakollo authored Feb 24, 2023
1 parent a18f563 commit afacfaf
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ void AddType (TypeDesc type)
if (typeDef.IsDelegate) {
// AOT's handling of delegates is very different from the IL/metadata picture
// So to simplify this, we're going to automatically "mark" all of the delegate's methods
foreach (MethodDesc m in typeDef.GetMethods()) {
if (ShouldIncludeEntityByDisplayName(m)) {
foreach (MethodDesc m in typeDef.GetMethods ()) {
if (ShouldIncludeEntityByDisplayName (m)) {
AddMember (m);
}
}
Expand Down Expand Up @@ -1195,7 +1195,7 @@ private static IEnumerable<CustomAttribute> GetActiveKeptAttributes (ICustomAttr
}

object? keptBy = ca.GetPropertyValue (nameof (KeptAttribute.By));
return keptBy is null ? true : ((ProducedBy) keptBy).HasFlag (ProducedBy.NativeAot);
return keptBy is null ? true : ((Tool) keptBy).HasFlag (Tool.NativeAot);
});
}

Expand All @@ -1212,7 +1212,7 @@ private static IEnumerable<CustomAttribute> GetActiveKeptDerivedAttributes (ICus
}

object? keptBy = ca.GetPropertyValue (nameof (KeptAttribute.By));
return keptBy is null ? true : ((ProducedBy) keptBy).HasFlag (ProducedBy.NativeAot);
return keptBy is null ? true : ((Tool) keptBy).HasFlag (Tool.NativeAot);
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ protected virtual void AdditionalChecking (ILCompilerTestCaseResult linkResult,
private static bool IsProducedByNativeAOT (CustomAttribute attr)
{
var producedBy = attr.GetPropertyValue ("ProducedBy");
return producedBy is null ? true : ((ProducedBy) producedBy).HasFlag (ProducedBy.NativeAot);
return producedBy is null ? true : ((Tool) producedBy).HasFlag (Tool.NativeAot);
}

private static IEnumerable<ICustomAttributeProvider> GetAttributeProviders (AssemblyDefinition assembly)
Expand Down Expand Up @@ -405,7 +405,7 @@ static bool LogMessageHasSameOriginMember (MessageContainer mc, ICustomAttribute

var actualOriginToken = new AssemblyQualifiedToken (origin.Value.MemberDefinition);
var expectedOriginToken = new AssemblyQualifiedToken (expectedOriginMember);
if (actualOriginToken.Equals(expectedOriginToken))
if (actualOriginToken.Equals (expectedOriginToken))
return true;

var actualMember = origin.Value.MemberDefinition;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ public TestCaseCompilationMetadataProvider (TestCase testCase, AssemblyDefinitio
private static bool IsIgnoredByNativeAOT (CustomAttribute attr)
{
var ignoredBy = attr.GetPropertyValue ("IgnoredBy");
return ignoredBy is null ? true : ((ProducedBy) ignoredBy).HasFlag (ProducedBy.NativeAot);
return ignoredBy is null ? true : ((Tool) ignoredBy).HasFlag (Tool.NativeAot);
}

public virtual bool IsIgnored ([NotNullWhen(true)] out string? reason)
public virtual bool IsIgnored ([NotNullWhen (true)] out string? reason)
{
var ignoreAttribute = _testCaseTypeDefinition.CustomAttributes.FirstOrDefault (attr => attr.AttributeType.Name == nameof (IgnoreTestCaseAttribute));
if (ignoreAttribute != null && IsIgnoredByNativeAOT(ignoreAttribute)) {
if (ignoreAttribute != null && IsIgnoredByNativeAOT (ignoreAttribute)) {
if (ignoreAttribute.ConstructorArguments.Count == 1) {
reason = (string) ignoreAttribute.ConstructorArguments.First ().Value;
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ public static void Test ()
[KeptMember (".ctor()")]
private abstract class AbstractMethods
{
[Kept (By = ProducedBy.Trimmer)] // NativeAOT test infra doesn't check reflection-only methods (without entry point) yet
[Kept (By = Tool.Trimmer)] // NativeAOT test infra doesn't check reflection-only methods (without entry point) yet
[DynamicDependency (nameof (TargetMethod))]
public abstract void SourceAbstractViaReflection ();

Expand Down

0 comments on commit afacfaf

Please sign in to comment.