From 7944d9d9957db1efe085d9df3ea89826f50029b7 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 12 Jan 2005 03:41:21 +0000 Subject: [PATCH] Add an option to view the selection dags as they are generated. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19498 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 9ccf87cfd84..ae6b08cfb6d 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -28,11 +28,20 @@ #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Target/TargetLowering.h" #include "llvm/Target/TargetMachine.h" +#include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" #include #include using namespace llvm; +#ifndef _NDEBUG +static cl::opt +ViewDAGs("view-isel-dags", cl::Hidden, + cl::desc("Pop up a window to show isel dags as they are selected")); +#else +static const bool ViewDAGS = 0; +#endif + namespace llvm { //===--------------------------------------------------------------------===// /// FunctionLoweringInfo - This contains information that is global to a @@ -890,6 +899,8 @@ void SelectionDAGISel::SelectBasicBlock(BasicBlock *LLVMBB, MachineFunction &MF, // the code to the MachineBasicBlock. InstructionSelectBasicBlock(DAG); + if (ViewDAGs) DAG.viewGraph(); + DEBUG(std::cerr << "Selected machine code:\n"); DEBUG(BB->dump()); -- 2.34.1