[Modules] Make Support/Debug.h modular. This requires it to not change
authorChandler Carruth <chandlerc@gmail.com>
Mon, 21 Apr 2014 22:55:11 +0000 (22:55 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Mon, 21 Apr 2014 22:55:11 +0000 (22:55 +0000)
behavior based on other files defining DEBUG_TYPE, which means it cannot
define DEBUG_TYPE at all. This is actually better IMO as it forces folks
to define relevant DEBUG_TYPEs for their files. However, it requires all
files that currently use DEBUG(...) to define a DEBUG_TYPE if they don't
already. I've updated all such files in LLVM and will do the same for
other upstream projects.

This still leaves one important change in how LLVM uses the DEBUG_TYPE
macro going forward: we need to only define the macro *after* header
files have been #include-ed. Previously, this wasn't possible because
Debug.h required the macro to be pre-defined. This commit removes that.
By defining DEBUG_TYPE after the includes two things are fixed:

- Header files that need to provide a DEBUG_TYPE for some inline code
  can do so by defining the macro before their inline code and undef-ing
  it afterward so the macro does not escape.

- We no longer have rampant ODR violations due to including headers with
  different DEBUG_TYPE definitions. This may be mostly an academic
  violation today, but with modules these types of violations are easy
  to check for and potentially very relevant.

Where necessary to suppor headers with DEBUG_TYPE, I have moved the
definitions below the includes in this commit. I plan to move the rest
of the DEBUG_TYPE macros in LLVM in subsequent commits; this one is big
enough.

The comments in Debug.h, which were hilariously out of date already,
have been updated to reflect the recommended practice going forward.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206822 91177308-0d34-0410-b5e6-96231b3b80d8

59 files changed:
include/llvm/Support/Debug.h
include/llvm/Support/UnicodeCharRanges.h
include/llvm/Transforms/Utils/SSAUpdaterImpl.h
lib/Analysis/LoopPass.cpp
lib/CodeGen/MachineBasicBlock.cpp
lib/CodeGen/MachineFunction.cpp
lib/CodeGen/MachineSSAUpdater.cpp
lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
lib/DebugInfo/DWARFContext.cpp
lib/IR/ConstantsContext.h
lib/IR/Core.cpp
lib/IR/Pass.cpp
lib/MC/MCObjectDisassembler.cpp
lib/MC/MachObjectWriter.cpp
lib/Support/CommandLine.cpp
lib/Support/DAGDeltaAlgorithm.cpp
lib/Target/AArch64/AArch64Subtarget.cpp
lib/Target/ARM/ARMBaseInstrInfo.cpp
lib/Target/ARM/ARMSubtarget.cpp
lib/Target/ARM64/ARM64Subtarget.cpp
lib/Target/Hexagon/HexagonISelLowering.cpp
lib/Target/Hexagon/HexagonInstrInfo.cpp
lib/Target/Hexagon/HexagonSubtarget.cpp
lib/Target/MSP430/MSP430ISelDAGToDAG.cpp
lib/Target/MSP430/MSP430Subtarget.cpp
lib/Target/Mips/AsmParser/MipsAsmParser.cpp
lib/Target/Mips/Disassembler/MipsDisassembler.cpp
lib/Target/Mips/Mips16InstrInfo.cpp
lib/Target/Mips/Mips16RegisterInfo.cpp
lib/Target/Mips/MipsModuleISelDAGToDAG.cpp
lib/Target/Mips/MipsSERegisterInfo.cpp
lib/Target/Mips/MipsTargetMachine.cpp
lib/Target/NVPTX/NVPTXPrologEpilogPass.cpp
lib/Target/NVPTX/NVPTXSubtarget.cpp
lib/Target/NVPTX/NVVMReflect.cpp
lib/Target/PowerPC/Disassembler/PPCDisassembler.cpp
lib/Target/PowerPC/PPCInstrInfo.cpp
lib/Target/PowerPC/PPCSubtarget.cpp
lib/Target/R600/AMDGPUSubtarget.cpp
lib/Target/Sparc/SparcSubtarget.cpp
lib/Target/SystemZ/Disassembler/SystemZDisassembler.cpp
lib/Target/SystemZ/SystemZISelDAGToDAG.cpp
lib/Target/SystemZ/SystemZSubtarget.cpp
lib/Target/X86/Disassembler/X86Disassembler.cpp
lib/Target/X86/X86InstrInfo.cpp
lib/Target/XCore/Disassembler/XCoreDisassembler.cpp
lib/Target/XCore/XCoreRegisterInfo.cpp
lib/Target/XCore/XCoreSubtarget.cpp
lib/Transforms/Utils/CodeExtractor.cpp
lib/Transforms/Utils/Local.cpp
lib/Transforms/Utils/LowerSwitch.cpp
lib/Transforms/Utils/SSAUpdater.cpp
tools/bugpoint/ExtractFunction.cpp
tools/bugpoint/OptimizerDriver.cpp
tools/lli/RemoteTargetExternal.cpp
utils/TableGen/AsmMatcherEmitter.cpp
utils/TableGen/AsmWriterEmitter.cpp
utils/TableGen/CodeGenDAGPatterns.cpp
utils/TableGen/DAGISelEmitter.cpp

index 27024082962ba8c24c321c9ef37e31b48c1a98d0..e93e6ca34498bd95f4ccaefac2506208db88a382 100644 (file)
 //
 // In particular, just wrap your code with the DEBUG() macro, and it will be
 // enabled automatically if you specify '-debug' on the command-line.
-// Alternatively, you can also use the SET_DEBUG_TYPE("foo") macro to specify
-// that your debug code belongs to class "foo".  Then, on the command line, you
-// can specify '-debug-only=foo' to enable JUST the debug information for the
-// foo class.
+// Alternatively, you can also define the DEBUG_TYPE macro to "foo" specify
+// that your debug code belongs to class "foo". Be careful that you only do
+// this after including Debug.h and not around any #include of headers. Headers
+// should define and undef the macro acround the code that needs to use the
+// DEBUG() macro. Then, on the command line, you can specify '-debug-only=foo'
+// to enable JUST the debug information for the foo class.
 //
 // When compiling without assertions, the -debug-* options and all code in
 // DEBUG() statements disappears, so it does not affect the runtime of the code.
 
 namespace llvm {
 
-/// DEBUG_TYPE macro - Files can specify a DEBUG_TYPE as a string, which causes
-/// all of their DEBUG statements to be activatable with -debug-only=thatstring.
-#ifndef DEBUG_TYPE
-#define DEBUG_TYPE ""
-#endif
-
 #ifndef NDEBUG
 /// DebugFlag - This boolean is set to true if the '-debug' command line option
 /// is specified.  This should probably not be referenced directly, instead, use
index 734d323047c97faeae52c6f42d485ca6172a0a90..79137bf353633787c31489af22e14df96656e226 100644 (file)
@@ -21,6 +21,8 @@
 namespace llvm {
 namespace sys {
 
+#define DEBUG_TYPE "unicode"
+
 /// \brief Represents a closed range of Unicode code points [Lower, Upper].
 struct UnicodeCharRange {
   uint32_t Lower;
@@ -88,6 +90,8 @@ private:
   const CharRanges Ranges;
 };
 
+#undef DEBUG_TYPE // "unicode"
+
 } // namespace sys
 } // namespace llvm
 
index 3cf408aae3b6d9bd54af084c61ff657a1cfaea4b..ed0841c46c27e7ae24225a608ac7a79775aa05cd 100644 (file)
@@ -23,6 +23,8 @@
 
 namespace llvm {
 
+#define DEBUG_TYPE "ssaupdater"
+
 class CastInst;
 class PHINode;
 template<typename T> class SSAUpdaterTraits;
@@ -451,6 +453,8 @@ public:
   }
 };
 
+#undef DEBUG_TYPE // "ssaupdater"
+
 } // End llvm namespace
 
 #endif
index addff3e64c3b73838a715c8ccf6eb4ced1c99810..683d6d74ab42949b14ef5bc7c45cf11b408c855a 100644 (file)
@@ -19,6 +19,8 @@
 #include "llvm/Support/Timer.h"
 using namespace llvm;
 
+#define DEBUG_TYPE "loop-pass-manager"
+
 namespace {
 
 /// PrintLoopPass - Print a Function corresponding to a Loop.
index 210424e8e3cee65a289edf90d96a008f5524a491..0ec5c338a248492dff99a3c5fac24c5d0529e262 100644 (file)
@@ -35,6 +35,8 @@
 #include <algorithm>
 using namespace llvm;
 
+#define DEBUG_TYPE "codegen"
+
 MachineBasicBlock::MachineBasicBlock(MachineFunction &mf, const BasicBlock *bb)
   : BB(bb), Number(-1), xParent(&mf), Alignment(0), IsLandingPad(false),
     AddressTaken(false), CachedMCSymbol(nullptr) {
index 68c12617c60a0fbd75193915fdde830bd7e86226..f0ced33cdccb4225137ccd520e650d3dd85cc988 100644 (file)
@@ -38,6 +38,8 @@
 #include "llvm/Target/TargetMachine.h"
 using namespace llvm;
 
+#define DEBUG_TYPE "codegen"
+
 //===----------------------------------------------------------------------===//
 // MachineFunction implementation
 //===----------------------------------------------------------------------===//
index 6e075694cacf5dece24a643746875254cb078db8..d9173a27dc4125175eeaca32275025921cd8b87c 100644 (file)
@@ -29,6 +29,8 @@
 #include "llvm/Transforms/Utils/SSAUpdaterImpl.h"
 using namespace llvm;
 
+#define DEBUG_TYPE "machine-ssaupdater"
+
 typedef DenseMap<MachineBasicBlock*, unsigned> AvailableValsTy;
 static AvailableValsTy &getAvailableVals(void *AV) {
   return *static_cast<AvailableValsTy*>(AV);
index aceb2b47dddfaa18a1a7b900bbf68b043b68ee8b..4df5ede388fc6aed6269ad3d67fcf025da02bc62 100644 (file)
@@ -27,6 +27,8 @@
 #include "llvm/Target/TargetRegisterInfo.h"
 using namespace llvm;
 
+#define DEBUG_TYPE "dag-printer"
+
 namespace llvm {
   template<>
   struct DOTGraphTraits<SelectionDAG*> : public DefaultDOTGraphTraits {
index 148d56800f8d7fbe8b91199feefbfd409d53a3b7..863c7568d5a8d1b6498f46f0b669811b3a879cf6 100644 (file)
@@ -20,6 +20,8 @@ using namespace llvm;
 using namespace dwarf;
 using namespace object;
 
+#define DEBUG_TYPE "dwarf"
+
 typedef DWARFDebugLine::LineTable DWARFLineTable;
 
 static void dumpPubSection(raw_ostream &OS, StringRef Name, StringRef Data,
index 59b9d4d3c5ed0dd0050a127ee0480b1d0fdc88df..efa132ea9ec21650f893cd455f054e1eab9bf0ff 100644 (file)
@@ -25,6 +25,8 @@
 #include "llvm/Support/raw_ostream.h"
 #include <map>
 
+#define DEBUG_TYPE "ir"
+
 namespace llvm {
 template<class ValType>
 struct ConstantTraits;
index 81aa402b3001e5625b9fed230cb5a2cc3d3cd80e..be5727b3cb3c0e076fb77f1cb3995ce0e6a6c783 100644 (file)
@@ -41,6 +41,8 @@
 
 using namespace llvm;
 
+#define DEBUG_TYPE "ir"
+
 void llvm::initializeCore(PassRegistry &Registry) {
   initializeDominatorTreeWrapperPassPass(Registry);
   initializePrintModulePassWrapperPass(Registry);
index 0f1446fabadaf39f3222e85e150458405599c436..bb55d2af7cf8d5b5ac7e6ac151cfb537c3baac20 100644 (file)
@@ -22,6 +22,8 @@
 #include "llvm/Support/raw_ostream.h"
 using namespace llvm;
 
+#define DEBUG_TYPE "ir"
+
 //===----------------------------------------------------------------------===//
 // Pass Implementation
 //
index 1487563e715e53aceed998ddf86d81c38ab4abd1..8a258cb0909720a91a67333912cdedfe5d335361 100644 (file)
@@ -31,6 +31,8 @@
 using namespace llvm;
 using namespace object;
 
+#define DEBUG_TYPE "mc"
+
 MCObjectDisassembler::MCObjectDisassembler(const ObjectFile &Obj,
                                            const MCDisassembler &Dis,
                                            const MCInstrAnalysis &MIA)
index 2e49a2871f9f66d150a3c3ef6ac5ed807e2e968c..b4e53be7d52c1af7cc330d5bea51c5e27334a023 100644 (file)
@@ -26,6 +26,8 @@
 #include <vector>
 using namespace llvm;
 
+#define DEBUG_TYPE "mc"
+
 void MachObjectWriter::reset() {
   Relocations.clear();
   IndirectSymBase.clear();
index 2b4c43104bb4975099b17379e32364ab375273d8..6b32476e7f9a2d3b28c2707880e61ffd8e118175 100644 (file)
@@ -38,6 +38,8 @@
 using namespace llvm;
 using namespace cl;
 
+#define DEBUG_TYPE "commandline"
+
 //===----------------------------------------------------------------------===//
 // Template instantiations and anchors.
 //
index 29acb7d3387f1512d518a6c722ca9d14842e88d0..0d504ee86b4339141e05758134a5e1b026351dca 100644 (file)
@@ -42,6 +42,8 @@
 #include <map>
 using namespace llvm;
 
+#define DEBUG_TYPE "dag-delta"
+
 namespace {
 
 class DAGDeltaAlgorithmImpl {
index 53cdf30b96648b5384874d15f0f5de9eccd15823..8d6fb787aa76bcb69ec35135cdf0ae52859374a8 100644 (file)
@@ -19,6 +19,8 @@
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Target/TargetSubtargetInfo.h"
 
+#define DEBUG_TYPE "aarch64-subtarget"
+
 #define GET_SUBTARGETINFO_TARGET_DESC
 #define GET_SUBTARGETINFO_CTOR
 #include "AArch64GenSubtargetInfo.inc"
index 184b2abab720cdf80c8f43dd97b9ccdb07639760..69a62cd881a4d7b509ac2576221b0ebae1765729 100644 (file)
@@ -42,6 +42,8 @@
 
 using namespace llvm;
 
+#define DEBUG_TYPE "arm-instrinfo"
+
 static cl::opt<bool>
 EnableARM3Addr("enable-arm-3-addr-conv", cl::Hidden,
                cl::desc("Enable ARM 2-addr to 3-addr conv"));
index 5222c1b108b643d44ba2b844bd338727380afd47..e096d21797c004380affcae38030da42a121f3c9 100644 (file)
@@ -21,6 +21,8 @@
 #include "llvm/Target/TargetInstrInfo.h"
 #include "llvm/Target/TargetOptions.h"
 
+#define DEBUG_TYPE "arm-subtarget"
+
 #define GET_SUBTARGETINFO_TARGET_DESC
 #define GET_SUBTARGETINFO_CTOR
 #include "ARMGenSubtargetInfo.inc"
index 3312e8e93aba01790791c57bab19a1ab54dbeaf4..2c18fd232ab2edfb85e0b70b8a7dc80eae49a682 100644 (file)
@@ -18,6 +18,8 @@
 #include "llvm/IR/GlobalValue.h"
 #include "llvm/Support/TargetRegistry.h"
 
+#define DEBUG_TYPE "arm64-subtarget"
+
 #define GET_SUBTARGETINFO_CTOR
 #define GET_SUBTARGETINFO_TARGET_DESC
 #include "ARM64GenSubtargetInfo.inc"
index 35fa1aa0d088211c442d0796d7529db0763213b6..2ffe12bd327d586a823845b5b503ba6084f67b02 100644 (file)
@@ -39,6 +39,8 @@
 
 using namespace llvm;
 
+#define DEBUG_TYPE "hexagon-lowering"
+
 static cl::opt<bool>
 EmitJumpTables("hexagon-emit-jump-tables", cl::init(true), cl::Hidden,
                cl::desc("Control jump table emission on Hexagon target"));
index 21a12def3a398d69b76fecf335933679a14652e0..5c9c80f9d36353e670676f12f078fa3ca04c2044 100644 (file)
@@ -33,6 +33,8 @@
 
 using namespace llvm;
 
+#define DEBUG_TYPE "hexagon-instrinfo"
+
 ///
 /// Constants for Hexagon instructions.
 ///
index fca67073ef381efb839db02e03c60bd672e1e031..70c87fa19d1a839cdfb6412a0282edcbe6b43812 100644 (file)
@@ -18,6 +18,8 @@
 #include "llvm/Support/ErrorHandling.h"
 using namespace llvm;
 
+#define DEBUG_TYPE "hexagon-subtarget"
+
 #define GET_SUBTARGETINFO_CTOR
 #define GET_SUBTARGETINFO_TARGET_DESC
 #include "HexagonGenSubtargetInfo.inc"
index 4152829b60daf6f88b3664cb02aac14540fb5d80..9b33275deeb9cd95e5c29a04f0448d8e42653d3e 100644 (file)
@@ -31,6 +31,8 @@
 #include "llvm/Target/TargetLowering.h"
 using namespace llvm;
 
+#define DEBUG_TYPE "msp430-isel"
+
 namespace {
   struct MSP430ISelAddressMode {
     enum {
index edeaf34676bd13db032ecfa38e0106da66de533b..f34dca5ee0427c42c319ba1c7d84137407126998 100644 (file)
@@ -15,6 +15,8 @@
 #include "MSP430.h"
 #include "llvm/Support/TargetRegistry.h"
 
+#define DEBUG_TYPE "msp430-subtarget"
+
 #define GET_SUBTARGETINFO_TARGET_DESC
 #define GET_SUBTARGETINFO_CTOR
 #include "MSP430GenSubtargetInfo.inc"
index 41662d3f97355b4c34bc3740f18c4223ec22b404..4a6dd5e2fa2647fde5523f8f6bee91f11ceae765 100644 (file)
@@ -29,6 +29,8 @@
 
 using namespace llvm;
 
+#define DEBUG_TYPE "mips-asm-parser"
+
 namespace llvm {
 class MCInstrInfo;
 }
index 4df12ef8af865cde337a9d5f71fcfa9a5fe10fdc..8e109cdbeb4e912a8272c06be2304d9befe860aa 100644 (file)
@@ -25,6 +25,8 @@
 
 using namespace llvm;
 
+#define DEBUG_TYPE "mips-disassembler"
+
 typedef MCDisassembler::DecodeStatus DecodeStatus;
 
 namespace {
index 43c2fbdac68e7766e6e43143ed68b75bab569a4b..79607de3397e6fe9e82c5d2b06111e2b63760c25 100644 (file)
@@ -29,6 +29,7 @@
 
 using namespace llvm;
 
+#define DEBUG_TYPE "mips16-instrinfo"
 
 Mips16InstrInfo::Mips16InstrInfo(MipsTargetMachine &tm)
   : MipsInstrInfo(tm, Mips::Bimm16),
index 3a50ed9f7f81e59299f4c4d135103ecf0dee3f6d..dbee774637dd56ac46b11de36c3f3e2cf90ba5e6 100644 (file)
@@ -39,6 +39,8 @@
 
 using namespace llvm;
 
+#define DEBUG_TYPE "mips16-registerinfo"
+
 Mips16RegisterInfo::Mips16RegisterInfo(const MipsSubtarget &ST)
   : MipsRegisterInfo(ST) {}
 
index c6abf17df35395eaee361bfe49d164813882ad24..03c76eaf1996ebb77c9e9ae76923cc1ffc3d5e37 100644 (file)
@@ -14,6 +14,8 @@
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/raw_ostream.h"
 
+#define DEBUG_TYPE "mips-isel"
+
 namespace llvm {
 
 bool MipsModuleDAGToDAGISel::runOnMachineFunction(MachineFunction &MF) {
index 2ac082f4c3cfbe9e2d05d4ed183dce397cca0c7b..3178ba92ddfcaae73062644405aae657282e78e4 100644 (file)
@@ -39,6 +39,8 @@
 
 using namespace llvm;
 
+#define DEBUG_TYPE "mips-reg-info"
+
 MipsSERegisterInfo::MipsSERegisterInfo(const MipsSubtarget &ST)
   : MipsRegisterInfo(ST) {}
 
index e9053c87f0562c34fefd4798e07cb278a1eab841..8a6386ff600891ed1e0905c8233f3fb39b5a4a52 100644 (file)
@@ -35,6 +35,8 @@
 #include "llvm/Transforms/Scalar.h"
 using namespace llvm;
 
+#define DEBUG_TYPE "mips"
+
 
 
 extern "C" void LLVMInitializeMipsTarget() {
index d5b042afeef85327ec31464e53b2775a299c9004..47f2c385ee184ff145435163b588ae2c5bb1c282 100644 (file)
@@ -25,6 +25,8 @@
 
 using namespace llvm;
 
+#define DEBUG_TYPE "nvptx-prolog-epilog"
+
 namespace {
 class NVPTXPrologEpilogPass : public MachineFunctionPass {
 public:
index 9771a176d8dc33664090f7d5c06370cfe08538cb..6898256b2d6e535d48af7c2ed16c7c1e6cf17a87 100644 (file)
@@ -12,6 +12,9 @@
 //===----------------------------------------------------------------------===//
 
 #include "NVPTXSubtarget.h"
+
+#define DEBUG_TYPE "nvptx-subtarget"
+
 #define GET_SUBTARGETINFO_ENUM
 #define GET_SUBTARGETINFO_TARGET_DESC
 #define GET_SUBTARGETINFO_CTOR
@@ -19,7 +22,6 @@
 
 using namespace llvm;
 
-
 // Pin the vtable to this file.
 void NVPTXSubtarget::anchor() {}
 
index 8b5444a66dd4488350643c1536edd255dc3d7cc0..f270eac9c286622cc8da30e389514b481770d01a 100644 (file)
@@ -38,6 +38,8 @@
 
 using namespace llvm;
 
+#define DEBUG_TYPE "nvptx-reflect"
+
 namespace llvm { void initializeNVVMReflectPass(PassRegistry &); }
 
 namespace {
index d0cd49ec9b08e235efb57e47dd92bbeb2c649633..a2305a9efc712af7c7047afce3f8806e2b2772cd 100644 (file)
@@ -17,6 +17,8 @@
 
 using namespace llvm;
 
+#define DEBUG_TYPE "ppc-disassembler"
+
 typedef MCDisassembler::DecodeStatus DecodeStatus;
 
 namespace {
index 939bbdc6cc298fb1cd5635f22c2b76836849f50b..208f6304217e834bf23428a52f5465ad6d5fc32a 100644 (file)
@@ -41,6 +41,8 @@
 
 using namespace llvm;
 
+#define DEBUG_TYPE "ppc-instr-info"
+
 static cl::
 opt<bool> DisableCTRLoopAnal("disable-ppc-ctrloop-analysis", cl::Hidden,
             cl::desc("Disable analysis for CTR loops"));
index b07abe4461894f4266e742f15ef3fc3c7f696057..0a3f58326c20bfb9d8aba167a18460885bc06f6f 100644 (file)
@@ -24,6 +24,8 @@
 #include "llvm/Target/TargetMachine.h"
 #include <cstdlib>
 
+#define DEBUG_TYPE "ppc-subtarget"
+
 #define GET_SUBTARGETINFO_TARGET_DESC
 #define GET_SUBTARGETINFO_CTOR
 #include "PPCGenSubtargetInfo.inc"
index e77ab5e6d1488bc0b8ff60683515a47cb407a833..fc34eef7fd28a85c78638a88c363d7c4f0cac9e8 100644 (file)
@@ -16,6 +16,8 @@
 
 using namespace llvm;
 
+#define DEBUG_TYPE "amdgpu-subtarget"
+
 #define GET_SUBTARGETINFO_ENUM
 #define GET_SUBTARGETINFO_TARGET_DESC
 #define GET_SUBTARGETINFO_CTOR
index 6fc9d5638488130ffed68b716c69fcfcf8a161a3..a726a734cddfb3118aff8b6b97aacb8aaf7e4c7b 100644 (file)
@@ -16,6 +16,8 @@
 #include "llvm/Support/MathExtras.h"
 #include "llvm/Support/TargetRegistry.h"
 
+#define DEBUG_TYPE "sparc-subtarget"
+
 #define GET_SUBTARGETINFO_TARGET_DESC
 #define GET_SUBTARGETINFO_CTOR
 #include "SparcGenSubtargetInfo.inc"
index 4d06e74eeb74810b51d2bd7bf921edc391af0f73..2350776e10fe2c55d47528e9f1f13b8d69b44b2e 100644 (file)
@@ -17,6 +17,8 @@
 
 using namespace llvm;
 
+#define DEBUG_TYPE "systemz-disassembler"
+
 typedef MCDisassembler::DecodeStatus DecodeStatus;
 
 namespace {
index 81d744f7d13125a39dffe902f282b7081e82c754..81f6338721aecaa133ddacf9c794fed34efdeb47 100644 (file)
@@ -19,6 +19,8 @@
 
 using namespace llvm;
 
+#define DEBUG_TYPE "systemz-isel"
+
 namespace {
 // Used to build addressing modes.
 struct SystemZAddressingMode {
index 33d7e064b088941ae4b54a86a74e8222f341c2c9..759468c6f0aab4392dcd24a9d46c83993104e2de 100644 (file)
@@ -12,6 +12,8 @@
 #include "llvm/IR/GlobalValue.h"
 #include "llvm/Support/Host.h"
 
+#define DEBUG_TYPE "systemz-subtarget"
+
 #define GET_SUBTARGETINFO_TARGET_DESC
 #define GET_SUBTARGETINFO_CTOR
 #include "SystemZGenSubtargetInfo.inc"
index 60b69679904271d12b2b49442728acc68840129c..c15be4910cafd28ed92e6eb45a0734138cd9fc20 100644 (file)
@@ -37,6 +37,8 @@
 using namespace llvm;
 using namespace llvm::X86Disassembler;
 
+#define DEBUG_TYPE "x86-disassembler"
+
 void llvm::X86Disassembler::Debug(const char *file, unsigned line,
                                   const char *s) {
   dbgs() << file << ":" << line << ": " << s;
index 6450f2af428d53d0f27c0be8ad3a6f5414bed40b..c7a44ff33b983df05c8f09f93404d7aefeb17584 100644 (file)
@@ -36,6 +36,8 @@
 #include "llvm/Target/TargetOptions.h"
 #include <limits>
 
+#define DEBUG_TYPE "x86-instr-info"
+
 #define GET_INSTRINFO_CTOR_DTOR
 #include "X86GenInstrInfo.inc"
 
index 1fe91f59d99c776a32b6d524c809ba9c91ff009c..0fe62f6d8e6907db46785bc211343b2e69f091fb 100644 (file)
@@ -24,6 +24,8 @@
 
 using namespace llvm;
 
+#define DEBUG_TYPE "xcore-disassembler"
+
 typedef MCDisassembler::DecodeStatus DecodeStatus;
 
 namespace {
index 8304059c64049e5583574daab34dcb65f4337001..e198d693b8a9c2140f8131331840db5e920b4323 100644 (file)
@@ -38,6 +38,8 @@
 
 using namespace llvm;
 
+#define DEBUG_TYPE "xcore-reg-info"
+
 XCoreRegisterInfo::XCoreRegisterInfo()
   : XCoreGenRegisterInfo(XCore::LR) {
 }
index 8cfb77089f319c6574a44d41aaa3d95e677a56e8..75500157e02524f7f0903c821318fd18bf6c0759 100644 (file)
@@ -15,6 +15,8 @@
 #include "XCore.h"
 #include "llvm/Support/TargetRegistry.h"
 
+#define DEBUG_TYPE "xcore-subtarget"
+
 #define GET_SUBTARGETINFO_TARGET_DESC
 #define GET_SUBTARGETINFO_CTOR
 #include "XCoreGenSubtargetInfo.inc"
index b81484277eb899c9d7cc977ca6c9228548572d3a..4bdff5dfb3552c1017582eb35511f38f2d5a5158 100644 (file)
@@ -38,6 +38,8 @@
 #include <set>
 using namespace llvm;
 
+#define DEBUG_TYPE "code-extractor"
+
 // Provide a command-line option to aggregate function arguments into a struct
 // for functions produced by the code extractor. This is useful when converting
 // extracted functions to pthread-based code, as only one argument (void*) can
index 9d0be8be9c4ea2282ec57ec8910ba4e42dc0709f..abd73eb5c9739abec8ddfbb0df7bfddae598ca28 100644 (file)
@@ -43,6 +43,8 @@
 #include "llvm/Support/raw_ostream.h"
 using namespace llvm;
 
+#define DEBUG_TYPE "local"
+
 STATISTIC(NumRemoved, "Number of unreachable basic blocks removed");
 
 //===----------------------------------------------------------------------===//
index 6fb74106e3fccd29cb6970ae82b4e1fb8d820c95..6d5cd780952721f005db8b646ef24c81ed20c32c 100644 (file)
@@ -27,6 +27,8 @@
 #include <algorithm>
 using namespace llvm;
 
+#define DEBUG_TYPE "lower-switch"
+
 namespace {
   /// LowerSwitch Pass - Replace all SwitchInst instructions with chained branch
   /// instructions.
index 28f5c44a9a9095103584daee0d3d8a8f99abf2cd..1bf9dea1f625443294ea845e6d8c5fc9c98bb65b 100644 (file)
@@ -11,7 +11,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define DEBUG_TYPE "ssaupdater"
 #include "llvm/Transforms/Utils/SSAUpdater.h"
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/TinyPtrVector.h"
@@ -28,6 +27,8 @@
 
 using namespace llvm;
 
+#define DEBUG_TYPE "ssaupdater"
+
 typedef DenseMap<BasicBlock*, Value*> AvailableValsTy;
 static AvailableValsTy &getAvailableVals(void *AV) {
   return *static_cast<AvailableValsTy*>(AV);
index 8bcae8a945c70b6646306962a12c74c66bb07bae..d1b1aff77850e84c54c8a550ee6e616317e01b19 100644 (file)
@@ -34,6 +34,8 @@
 #include <set>
 using namespace llvm;
 
+#define DEBUG_TYPE "bugpoint"
+
 namespace llvm {
   bool DisableSimplifyCFG = false;
   extern cl::opt<std::string> OutputPrefix;
index f91f49371166c3a056527eb5d45ebe277bb13e64..eaea9d9ed538df654007fde129efaeafdb00f065 100644 (file)
@@ -36,6 +36,8 @@
 
 using namespace llvm;
 
+#define DEBUG_TYPE "bugpoint"
+
 namespace llvm {
   extern cl::opt<std::string> OutputPrefix;
 }
index c1bc8dfe99ca991144abbebd99b7bf2365445aac..fe46248822c522884c0f423d7af3acbbb3a9faf8 100644 (file)
@@ -26,6 +26,8 @@
 
 using namespace llvm;
 
+#define DEBUG_TYPE "lli"
+
 bool RemoteTargetExternal::allocateSpace(size_t Size, unsigned Alignment,
                                  uint64_t &Address) {
   DEBUG(dbgs() << "Message [allocate space] size: " << Size <<
index 54393706052d07b1d9606910e9d4edc5a1ae6f35..77f92ff6140097507a71281fc813765ea90f13dc 100644 (file)
 #include <sstream>
 using namespace llvm;
 
+#define DEBUG_TYPE "asm-matcher-emitter"
+
 static cl::opt<std::string>
 MatchPrefix("match-prefix", cl::init(""),
             cl::desc("Only match instructions with the given prefix"));
index 718bb805fe41429eb128d6c2d54cc3642d13df53..666d0a1b8966a287296142879b50ab997d10c1a1 100644 (file)
@@ -29,6 +29,8 @@
 #include <vector>
 using namespace llvm;
 
+#define DEBUG_TYPE "asm-writer-emitter"
+
 namespace {
 class AsmWriterEmitter {
   RecordKeeper &Records;
index 10b036f36e0a8f02894901f1b66ca4fdd756d6b4..e003dc8322a45c69412439af06ff866090e4ae63 100644 (file)
@@ -25,6 +25,8 @@
 #include <set>
 using namespace llvm;
 
+#define DEBUG_TYPE "dag-patterns"
+
 //===----------------------------------------------------------------------===//
 //  EEVT::TypeSet Implementation
 //===----------------------------------------------------------------------===//
index 9294cd557670c14decf19ef0911978e2f97e75f4..82682cd5a5adcadd22b513ab5e5f794a7fcbc8e9 100644 (file)
@@ -18,6 +18,8 @@
 #include "llvm/TableGen/TableGenBackend.h"
 using namespace llvm;
 
+#define DEBUG_TYPE "dag-isel-emitter"
+
 namespace {
 /// DAGISelEmitter - The top-level class which coordinates construction
 /// and emission of the instruction selector.