From: Chris Lattner Date: Wed, 22 May 2002 17:08:27 +0000 (+0000) Subject: Move debug options out of header files so that the header does not have X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=70e60cbd4dd59b61e3e9d0a55f24cf92b0dc8724;p=oota-llvm.git Move debug options out of header files so that the header does not have to #include CommandLine.h. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2712 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp b/lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp index edf68868d47..11056406124 100644 --- a/lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp +++ b/lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp @@ -11,17 +11,22 @@ #include "llvm/Support/CFG.h" #include "Support/PostOrderIterator.h" #include "Support/SetOperations.h" +#include "Support/CommandLine.h" #include AnalysisID FunctionLiveVarInfo::ID(AnalysisID::create()); -cl::Enum DEBUG_LV("dlivevar", cl::Hidden, +LiveVarDebugLevel_t DEBUG_LV; + +static cl::Enum DEBUG_LV_opt(DEBUG_LV, "dlivevar", cl::Hidden, "enable live-variable debugging information", clEnumValN(LV_DEBUG_None , "n", "disable debug output"), clEnumValN(LV_DEBUG_Normal , "y", "enable debug output"), clEnumValN(LV_DEBUG_Instr, "i", "print live-var sets before/after every machine instrn"), clEnumValN(LV_DEBUG_Verbose, "v", "print def, use sets for every instrn also"), 0); + + //----------------------------------------------------------------------------- // Accessor Functions //----------------------------------------------------------------------------- diff --git a/lib/CodeGen/InstrSched/InstrScheduling.cpp b/lib/CodeGen/InstrSched/InstrScheduling.cpp index 0a6d1ce3539..2d2bc147268 100644 --- a/lib/CodeGen/InstrSched/InstrScheduling.cpp +++ b/lib/CodeGen/InstrSched/InstrScheduling.cpp @@ -13,13 +13,14 @@ #include "llvm/Target/TargetMachine.h" #include "llvm/BasicBlock.h" #include "llvm/Instruction.h" +#include "Support/CommandLine.h" #include using std::cerr; using std::vector; -//************************* External Data Types *****************************/ +SchedDebugLevel_t SchedDebugLevel; -cl::Enum SchedDebugLevel("dsched", cl::Hidden, +static cl::Enum Opt(SchedDebugLevel,"dsched",cl::Hidden, "enable instruction scheduling debugging information", clEnumValN(Sched_NoDebugInfo, "n", "disable debug output"), clEnumValN(Sched_Disable, "off", "disable instruction scheduling"), diff --git a/lib/CodeGen/InstrSched/SchedPriorities.h b/lib/CodeGen/InstrSched/SchedPriorities.h index 3f087d52249..a34557ca154 100644 --- a/lib/CodeGen/InstrSched/SchedPriorities.h +++ b/lib/CodeGen/InstrSched/SchedPriorities.h @@ -24,7 +24,6 @@ #include "SchedGraph.h" #include "llvm/CodeGen/InstrScheduling.h" #include "llvm/Target/MachineSchedInfo.h" -#include "Support/CommandLine.h" #include #include #include @@ -44,7 +43,7 @@ enum SchedDebugLevel_t { Sched_PrintSchedGraphs, }; -extern cl::Enum SchedDebugLevel; +extern SchedDebugLevel_t SchedDebugLevel; //--------------------------------------------------------------------------- // Function: instrIsFeasible diff --git a/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp b/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp index ab9b1a7b176..bd0db117f0f 100644 --- a/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp +++ b/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp @@ -24,15 +24,14 @@ #include "llvm/Type.h" #include "llvm/iOther.h" #include "llvm/CodeGen/RegAllocCommon.h" +#include "Support/CommandLine.h" #include #include using std::cerr; - -// ***TODO: There are several places we add instructions. Validate the order -// of adding these instructions. - -cl::Enum DEBUG_RA("dregalloc", cl::Hidden, +RegAllocDebugLevel_t DEBUG_RA; +static cl::Enum DEBUG_RA_c(DEBUG_RA, "dregalloc", + cl::Hidden, "enable register allocation debugging information", clEnumValN(RA_DEBUG_None , "n", "disable debug output"), clEnumValN(RA_DEBUG_Normal , "y", "enable debug output"), diff --git a/lib/Target/SparcV9/InstrSched/InstrScheduling.cpp b/lib/Target/SparcV9/InstrSched/InstrScheduling.cpp index 0a6d1ce3539..2d2bc147268 100644 --- a/lib/Target/SparcV9/InstrSched/InstrScheduling.cpp +++ b/lib/Target/SparcV9/InstrSched/InstrScheduling.cpp @@ -13,13 +13,14 @@ #include "llvm/Target/TargetMachine.h" #include "llvm/BasicBlock.h" #include "llvm/Instruction.h" +#include "Support/CommandLine.h" #include using std::cerr; using std::vector; -//************************* External Data Types *****************************/ +SchedDebugLevel_t SchedDebugLevel; -cl::Enum SchedDebugLevel("dsched", cl::Hidden, +static cl::Enum Opt(SchedDebugLevel,"dsched",cl::Hidden, "enable instruction scheduling debugging information", clEnumValN(Sched_NoDebugInfo, "n", "disable debug output"), clEnumValN(Sched_Disable, "off", "disable instruction scheduling"), diff --git a/lib/Target/SparcV9/InstrSched/SchedPriorities.h b/lib/Target/SparcV9/InstrSched/SchedPriorities.h index 3f087d52249..a34557ca154 100644 --- a/lib/Target/SparcV9/InstrSched/SchedPriorities.h +++ b/lib/Target/SparcV9/InstrSched/SchedPriorities.h @@ -24,7 +24,6 @@ #include "SchedGraph.h" #include "llvm/CodeGen/InstrScheduling.h" #include "llvm/Target/MachineSchedInfo.h" -#include "Support/CommandLine.h" #include #include #include @@ -44,7 +43,7 @@ enum SchedDebugLevel_t { Sched_PrintSchedGraphs, }; -extern cl::Enum SchedDebugLevel; +extern SchedDebugLevel_t SchedDebugLevel; //--------------------------------------------------------------------------- // Function: instrIsFeasible diff --git a/lib/Target/SparcV9/LiveVar/FunctionLiveVarInfo.cpp b/lib/Target/SparcV9/LiveVar/FunctionLiveVarInfo.cpp index edf68868d47..11056406124 100644 --- a/lib/Target/SparcV9/LiveVar/FunctionLiveVarInfo.cpp +++ b/lib/Target/SparcV9/LiveVar/FunctionLiveVarInfo.cpp @@ -11,17 +11,22 @@ #include "llvm/Support/CFG.h" #include "Support/PostOrderIterator.h" #include "Support/SetOperations.h" +#include "Support/CommandLine.h" #include AnalysisID FunctionLiveVarInfo::ID(AnalysisID::create()); -cl::Enum DEBUG_LV("dlivevar", cl::Hidden, +LiveVarDebugLevel_t DEBUG_LV; + +static cl::Enum DEBUG_LV_opt(DEBUG_LV, "dlivevar", cl::Hidden, "enable live-variable debugging information", clEnumValN(LV_DEBUG_None , "n", "disable debug output"), clEnumValN(LV_DEBUG_Normal , "y", "enable debug output"), clEnumValN(LV_DEBUG_Instr, "i", "print live-var sets before/after every machine instrn"), clEnumValN(LV_DEBUG_Verbose, "v", "print def, use sets for every instrn also"), 0); + + //----------------------------------------------------------------------------- // Accessor Functions //----------------------------------------------------------------------------- diff --git a/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp b/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp index ab9b1a7b176..bd0db117f0f 100644 --- a/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp +++ b/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp @@ -24,15 +24,14 @@ #include "llvm/Type.h" #include "llvm/iOther.h" #include "llvm/CodeGen/RegAllocCommon.h" +#include "Support/CommandLine.h" #include #include using std::cerr; - -// ***TODO: There are several places we add instructions. Validate the order -// of adding these instructions. - -cl::Enum DEBUG_RA("dregalloc", cl::Hidden, +RegAllocDebugLevel_t DEBUG_RA; +static cl::Enum DEBUG_RA_c(DEBUG_RA, "dregalloc", + cl::Hidden, "enable register allocation debugging information", clEnumValN(RA_DEBUG_None , "n", "disable debug output"), clEnumValN(RA_DEBUG_Normal , "y", "enable debug output"),