[Modules] Fix potential ODR violations by sinking the DEBUG_TYPE
authorChandler Carruth <chandlerc@gmail.com>
Tue, 22 Apr 2014 03:04:17 +0000 (03:04 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Tue, 22 Apr 2014 03:04:17 +0000 (03:04 +0000)
definition below all the header #include lines. This updates most of the
miscellaneous other lib/... directories. A few left though.

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

15 files changed:
lib/ExecutionEngine/ExecutionEngine.cpp
lib/ExecutionEngine/ExecutionEngineBindings.cpp
lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp
lib/ExecutionEngine/Interpreter/Execution.cpp
lib/ExecutionEngine/JIT/JITEmitter.cpp
lib/ExecutionEngine/JIT/JITMemoryManager.cpp
lib/ExecutionEngine/OProfileJIT/OProfileJITEventListener.cpp
lib/ExecutionEngine/OProfileJIT/OProfileWrapper.cpp
lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
lib/MC/MCAssembler.cpp
lib/MC/MCExpr.cpp
lib/MC/WinCOFFObjectWriter.cpp
lib/MC/WinCOFFStreamer.cpp

index 41283e98ceb87aa806aa7a0a359b741b6f2ea569..ab89814951284789864271849d6723f80e3b1dd6 100644 (file)
@@ -12,7 +12,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define DEBUG_TYPE "jit"
 #include "llvm/ExecutionEngine/ExecutionEngine.h"
 #include "llvm/ADT/SmallString.h"
 #include "llvm/ADT/Statistic.h"
@@ -37,6 +36,8 @@
 #include <cstring>
 using namespace llvm;
 
+#define DEBUG_TYPE "jit"
+
 STATISTIC(NumInitBytes, "Number of bytes of global vars initialized");
 STATISTIC(NumGlobals  , "Number of global vars initialized");
 
index de707a09d5e928e7e844f978bc455b40961a2107..5ecf3ac44320c7065a970caad468a3e92ab79fba 100644 (file)
@@ -11,7 +11,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define DEBUG_TYPE "jit"
 #include "llvm-c/ExecutionEngine.h"
 #include "llvm/ExecutionEngine/ExecutionEngine.h"
 #include "llvm/ExecutionEngine/GenericValue.h"
@@ -23,6 +22,8 @@
 
 using namespace llvm;
 
+#define DEBUG_TYPE "jit"
+
 // Wrapping the C bindings types.
 DEFINE_SIMPLE_CONVERSION_FUNCTIONS(GenericValue, LLVMGenericValueRef)
 
index 39b9c0431f502e7d7565f6442789058a25516011..9a65fa09b2310c7b6c790acf3f5ce1971d979dc5 100644 (file)
@@ -15,7 +15,6 @@
 #include "llvm/Config/config.h"
 #include "llvm/ExecutionEngine/JITEventListener.h"
 
-#define DEBUG_TYPE "amplifier-jit-event-listener"
 #include "llvm/IR/DebugInfo.h"
 #include "llvm/IR/Function.h"
 #include "llvm/IR/Metadata.h"
@@ -34,6 +33,8 @@
 using namespace llvm;
 using namespace llvm::jitprofiling;
 
+#define DEBUG_TYPE "amplifier-jit-event-listener"
+
 namespace {
 
 class IntelJITEventListener : public JITEventListener {
index 8a80285f98c91ef88a03229721bd41b0dcd39d27..a0a945be6255734187ba8c12889d691370df80f8 100644 (file)
@@ -11,7 +11,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define DEBUG_TYPE "interpreter"
 #include "Interpreter.h"
 #include "llvm/ADT/APInt.h"
 #include "llvm/ADT/Statistic.h"
@@ -28,6 +27,8 @@
 #include <cmath>
 using namespace llvm;
 
+#define DEBUG_TYPE "interpreter"
+
 STATISTIC(NumDynamicInsts, "Number of dynamic instructions executed");
 
 static cl::opt<bool> PrintVolatile("interpreter-print-volatile", cl::Hidden,
index 9d215ec96aee7263a59f39411680e5931858d0dc..ed23ae3dd000b6a060b4a874926177504cd20781 100644 (file)
@@ -12,7 +12,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define DEBUG_TYPE "jit"
 #include "JIT.h"
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/SmallPtrSet.h"
@@ -52,6 +51,8 @@
 #endif
 using namespace llvm;
 
+#define DEBUG_TYPE "jit"
+
 STATISTIC(NumBytes, "Number of bytes of machine code compiled");
 STATISTIC(NumRelos, "Number of relocations applied");
 STATISTIC(NumRetries, "Number of retries with more memory");
index acd034b83e6dca10a67a1dd01fc7a3569db5c5da..e5e0cfa51d56cb6d955507ab8610446c86769f37 100644 (file)
@@ -11,7 +11,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define DEBUG_TYPE "jit"
 #include "llvm/ExecutionEngine/JITMemoryManager.h"
 #include "llvm/ADT/SmallPtrSet.h"
 #include "llvm/ADT/Statistic.h"
@@ -40,6 +39,8 @@
 
 using namespace llvm;
 
+#define DEBUG_TYPE "jit"
+
 STATISTIC(NumSlabs, "Number of slabs of memory allocated by the JIT");
 
 JITMemoryManager::~JITMemoryManager() {}
index 834251f40940e1edbefead0c55ee4f006bd5dd00..fd37a13b112f12f464fa2f44883d8a6d48130773 100644 (file)
@@ -15,7 +15,6 @@
 #include "llvm/Config/config.h"
 #include "llvm/ExecutionEngine/JITEventListener.h"
 
-#define DEBUG_TYPE "oprofile-jit-event-listener"
 #include "llvm/IR/DebugInfo.h"
 #include "llvm/IR/Function.h"
 #include "llvm/CodeGen/MachineFunction.h"
@@ -33,6 +32,8 @@
 using namespace llvm;
 using namespace llvm::jitprofiling;
 
+#define DEBUG_TYPE "oprofile-jit-event-listener"
+
 namespace {
 
 class OProfileJITEventListener : public JITEventListener {
index 6702e20d50d217840cd44098c58ded9ab6533e6c..04edbd2a300e72c8893542fcd19790c491f44762 100644 (file)
@@ -13,7 +13,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define DEBUG_TYPE "oprofile-wrapper"
 #include "llvm/ExecutionEngine/OProfileWrapper.h"
 #include "llvm/ADT/SmallString.h"
 #include "llvm/Support/Debug.h"
@@ -29,6 +28,8 @@
 #include <sys/stat.h>
 #include <unistd.h>
 
+#define DEBUG_TYPE "oprofile-wrapper"
+
 namespace {
 
 // Global mutex to ensure a single thread initializes oprofile agent.
index f9a81db4df0aa73a2e751068619d7524a7d81bed..65b544dcafd570e0197790294db031506fbb11e0 100644 (file)
@@ -11,7 +11,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define DEBUG_TYPE "dyld"
 #include "llvm/ExecutionEngine/RuntimeDyld.h"
 #include "JITRegistrar.h"
 #include "ObjectImageCommon.h"
@@ -25,6 +24,8 @@
 using namespace llvm;
 using namespace llvm::object;
 
+#define DEBUG_TYPE "dyld"
+
 // Empty out-of-line virtual destructor as the key function.
 RuntimeDyldImpl::~RuntimeDyldImpl() {}
 
index 3204b81df2bf7ca42214ce849f91ea1009248128..434a1adf4f0fa63fd07105e3e16874bd253791eb 100644 (file)
@@ -11,7 +11,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define DEBUG_TYPE "dyld"
 #include "RuntimeDyldELF.h"
 #include "JITRegistrar.h"
 #include "ObjectImageCommon.h"
@@ -29,6 +28,8 @@
 using namespace llvm;
 using namespace llvm::object;
 
+#define DEBUG_TYPE "dyld"
+
 namespace {
 
 static inline error_code check(error_code Err) {
index 7eae9c2145b84c9f10c8c3b5ed0ee2540469f94a..999e8f32617806302c4a85c6bd368faa92425237 100644 (file)
 //
 //===----------------------------------------------------------------------===//
 
-#define DEBUG_TYPE "dyld"
 #include "RuntimeDyldMachO.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/StringRef.h"
 using namespace llvm;
 using namespace llvm::object;
 
+#define DEBUG_TYPE "dyld"
+
 namespace llvm {
 
 static unsigned char *processFDE(unsigned char *P, intptr_t DeltaForText,
index 2cee2b8a475cc9b92bdccbbf9b8c50e1cd5a0696..b3b2bb3d31b95e8a547656a2c0364ffaa71365d7 100644 (file)
@@ -7,7 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define DEBUG_TYPE "assembler"
 #include "llvm/MC/MCAssembler.h"
 #include "llvm/ADT/Statistic.h"
 #include "llvm/ADT/StringExtras.h"
@@ -31,6 +30,8 @@
 
 using namespace llvm;
 
+#define DEBUG_TYPE "assembler"
+
 namespace {
 namespace stats {
 STATISTIC(EmittedFragments, "Number of emitted assembler fragments - total");
index fbc2e0cd81e06c9a9ede9821ca65107c9786ccdd..5b06104bf73f8b457c7fe1ec107b7627b46c6259 100644 (file)
@@ -7,7 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define DEBUG_TYPE "mcexpr"
 #include "llvm/MC/MCExpr.h"
 #include "llvm/ADT/Statistic.h"
 #include "llvm/ADT/StringSwitch.h"
@@ -23,6 +22,8 @@
 #include "llvm/Support/raw_ostream.h"
 using namespace llvm;
 
+#define DEBUG_TYPE "mcexpr"
+
 namespace {
 namespace stats {
 STATISTIC(MCExprEvaluate, "Number of MCExpr evaluations");
index 7819d6285cc2f597ac5ae6aecd2cd228b428de0d..fba519fca890ba0a9bb0c0abda48898420f07cd9 100644 (file)
@@ -11,8 +11,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define DEBUG_TYPE "WinCOFFObjectWriter"
-
 #include "llvm/MC/MCWinCOFFObjectWriter.h"
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/StringMap.h"
@@ -36,6 +34,8 @@
 
 using namespace llvm;
 
+#define DEBUG_TYPE "WinCOFFObjectWriter"
+
 namespace {
 typedef SmallString<COFF::NameSize> name;
 
index 9f033d415dd84e9588d3af0b58f906805a8cb9f9..cc64bf077692b08bc20fae1253e368fef0f0f8cb 100644 (file)
@@ -11,8 +11,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define DEBUG_TYPE "WinCOFFStreamer"
-
 #include "llvm/MC/MCStreamer.h"
 #include "llvm/MC/MCAsmBackend.h"
 #include "llvm/MC/MCAsmLayout.h"
@@ -35,6 +33,8 @@
 
 using namespace llvm;
 
+#define DEBUG_TYPE "WinCOFFStreamer"
+
 namespace {
 class WinCOFFStreamer : public MCObjectStreamer {
 public: