[llvm] r206847 - [Modules] Fix potential ODR violations by sinking the DEBUG_TYPE

Chandler Carruth chandlerc at gmail.com
Mon Apr 21 20:07:47 PDT 2014


Author: chandlerc
Date: Mon Apr 21 22:07:47 2014
New Revision: 206847

URL: http://llvm.org/viewvc/llvm-project?rev=206847&view=rev
Log:
[Modules] Fix potential ODR violations by sinking the DEBUG_TYPE
definition below all of the header #include lines, lib/Support edition.

Modified:
    llvm/trunk/lib/Support/APInt.cpp
    llvm/trunk/lib/Support/DataStream.cpp

Modified: llvm/trunk/lib/Support/APInt.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/APInt.cpp?rev=206847&r1=206846&r2=206847&view=diff
==============================================================================
--- llvm/trunk/lib/Support/APInt.cpp (original)
+++ llvm/trunk/lib/Support/APInt.cpp Mon Apr 21 22:07:47 2014
@@ -12,7 +12,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define DEBUG_TYPE "apint"
 #include "llvm/ADT/APInt.h"
 #include "llvm/ADT/FoldingSet.h"
 #include "llvm/ADT/Hashing.h"
@@ -28,6 +27,8 @@
 #include <limits>
 using namespace llvm;
 
+#define DEBUG_TYPE "apint"
+
 /// A utility function for allocating memory, checking for allocation failures,
 /// and ensuring the contents are zeroed.
 inline static uint64_t* getClearedMemory(unsigned numWords) {

Modified: llvm/trunk/lib/Support/DataStream.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/DataStream.cpp?rev=206847&r1=206846&r2=206847&view=diff
==============================================================================
--- llvm/trunk/lib/Support/DataStream.cpp (original)
+++ llvm/trunk/lib/Support/DataStream.cpp Mon Apr 21 22:07:47 2014
@@ -14,7 +14,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define DEBUG_TYPE "Data-stream"
 #include "llvm/Support/DataStream.h"
 #include "llvm/ADT/Statistic.h"
 #include "llvm/Support/FileSystem.h"
@@ -30,6 +29,8 @@
 #endif
 using namespace llvm;
 
+#define DEBUG_TYPE "Data-stream"
+
 // Interface goals:
 // * StreamableMemoryObject doesn't care about complexities like using
 //   threads/async callbacks to actually overlap download+compile





More information about the llvm-commits mailing list