You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
692 B

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Diagnostics;
  4. using System.Linq;
  5. using ICSharpCode.Decompiler.CSharp.Syntax;
  6. using ICSharpCode.Decompiler.IL;
  7. namespace ICSharpCode.Decompiler.CSharp
  8. {
  9. [DebuggerDisplay("{Statement}")]
  10. struct TranslatedStatement
  11. {
  12. public readonly Statement Statement;
  13. public IEnumerable<ILInstruction> ILInstructions {
  14. get { return Statement.Annotations.OfType<ILInstruction>(); }
  15. }
  16. internal TranslatedStatement(Statement statement)
  17. {
  18. Debug.Assert(statement != null);
  19. this.Statement = statement;
  20. }
  21. public static implicit operator Statement(TranslatedStatement statement)
  22. {
  23. return statement.Statement;
  24. }
  25. }
  26. }