Debug.cpp 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft. All rights reserved.
  3. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. //-------------------------------------------------------------------------------------------------------
  5. //----------------------------------------------------------------------------
  6. //
  7. // This file contains debug dumpers which can be called from the debugger.
  8. //
  9. //----------------------------------------------------------------------------
  10. #include "BackEnd.h"
  11. #if DBG_DUMP
  12. Func *CurrentFunc;
  13. ///----------------------------------------------------------------------------
  14. ///
  15. /// Dump the given instr
  16. ///
  17. ///----------------------------------------------------------------------------
  18. void dump(IR::Instr *instr)
  19. {
  20. instr->Dump();
  21. }
  22. ///----------------------------------------------------------------------------
  23. ///
  24. /// Dump the given instr, window/2 instrs before, and window/2 instrs after
  25. ///
  26. ///----------------------------------------------------------------------------
  27. void dump(IR::Instr *instr, int window)
  28. {
  29. instr->Dump(window);
  30. }
  31. ///----------------------------------------------------------------------------
  32. ///
  33. /// Dump the current function being compiled
  34. ///
  35. ///----------------------------------------------------------------------------
  36. void dump()
  37. {
  38. CurrentFunc->Dump();
  39. }
  40. #endif // DBG_DUMP