2
using System.Collections.Generic;
6
using ICSharpCode.Decompiler.Ast.Transforms;
7
using ICSharpCode.NRefactory.CSharp;
9
namespace ICSharpCode.Decompiler.Tests.Helpers
11
class RemoveCompilerAttribute : DepthFirstAstVisitor<object, object>, IAstTransform
13
public override object VisitAttribute(NRefactory.CSharp.Attribute attribute, object data)
15
var section = (AttributeSection)attribute.Parent;
16
SimpleType type = attribute.Type as SimpleType;
17
if (section.AttributeTarget == "assembly" &&
18
(type.Identifier == "CompilationRelaxations" || type.Identifier == "RuntimeCompatibility" || type.Identifier == "SecurityPermission" || type.Identifier == "AssemblyVersion" || type.Identifier == "Debuggable"))
21
if (section.Attributes.Count == 0)
24
if (section.AttributeTarget == "module" && type.Identifier == "UnverifiableCode")
27
if (section.Attributes.Count == 0)
33
public void Run(AstNode node)
35
node.AcceptVisitor(this, null);