[lld] r206851 - [Modules] Fix potential ODR violations by sinking the DEBUG_TYPE
Chandler Carruth
chandlerc at gmail.com
Mon Apr 21 20:21:32 PDT 2014
Author: chandlerc
Date: Mon Apr 21 22:21:31 2014
New Revision: 206851
URL: http://llvm.org/viewvc/llvm-project?rev=206851&view=rev
Log:
[Modules] Fix potential ODR violations by sinking the DEBUG_TYPE
definition below all of the header #include lines, LLD edition.
IF you want to know more details about this, you can see the recent
commits to Debug.h in LLVM. This is just the LLD segment of a cleanup
I'm doing globally for this macro.
Modified:
lld/trunk/lib/Passes/LayoutPass.cpp
lld/trunk/lib/Passes/RoundTripNativePass.cpp
lld/trunk/lib/Passes/RoundTripYAMLPass.cpp
lld/trunk/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp
lld/trunk/lib/ReaderWriter/PECOFF/ReaderImportHeader.cpp
lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp
Modified: lld/trunk/lib/Passes/LayoutPass.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Passes/LayoutPass.cpp?rev=206851&r1=206850&r2=206851&view=diff
==============================================================================
--- lld/trunk/lib/Passes/LayoutPass.cpp (original)
+++ lld/trunk/lib/Passes/LayoutPass.cpp Mon Apr 21 22:21:31 2014
@@ -7,8 +7,6 @@
//
//===----------------------------------------------------------------------===//
-#define DEBUG_TYPE "LayoutPass"
-
#include <algorithm>
#include <set>
@@ -20,6 +18,8 @@
using namespace lld;
+#define DEBUG_TYPE "LayoutPass"
+
static bool compareAtoms(const LayoutPass::SortKey &,
const LayoutPass::SortKey &);
Modified: lld/trunk/lib/Passes/RoundTripNativePass.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Passes/RoundTripNativePass.cpp?rev=206851&r1=206850&r2=206851&view=diff
==============================================================================
--- lld/trunk/lib/Passes/RoundTripNativePass.cpp (original)
+++ lld/trunk/lib/Passes/RoundTripNativePass.cpp Mon Apr 21 22:21:31 2014
@@ -7,8 +7,6 @@
//
//===----------------------------------------------------------------------===//
-#define DEBUG_TYPE "RoundTripNativePass"
-
#include "lld/Core/Instrumentation.h"
#include "lld/Passes/RoundTripNativePass.h"
#include "lld/ReaderWriter/Simple.h"
@@ -21,6 +19,8 @@
using namespace lld;
+#define DEBUG_TYPE "RoundTripNativePass"
+
/// Perform the actual pass
void RoundTripNativePass::perform(std::unique_ptr<MutableFile> &mergedFile) {
ScopedTask task(getDefaultDomain(), "RoundTripNativePass");
Modified: lld/trunk/lib/Passes/RoundTripYAMLPass.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Passes/RoundTripYAMLPass.cpp?rev=206851&r1=206850&r2=206851&view=diff
==============================================================================
--- lld/trunk/lib/Passes/RoundTripYAMLPass.cpp (original)
+++ lld/trunk/lib/Passes/RoundTripYAMLPass.cpp Mon Apr 21 22:21:31 2014
@@ -6,8 +6,6 @@
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
-#define DEBUG_TYPE "RoundTripYAMLPass"
-
#include "lld/Core/Instrumentation.h"
#include "lld/Passes/RoundTripYAMLPass.h"
#include "lld/ReaderWriter/Simple.h"
@@ -20,6 +18,8 @@
using namespace lld;
+#define DEBUG_TYPE "RoundTripYAMLPass"
+
/// Perform the actual pass
void RoundTripYAMLPass::perform(std::unique_ptr<MutableFile> &mergedFile) {
ScopedTask task(getDefaultDomain(), "RoundTripYAMLPass");
Modified: lld/trunk/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp?rev=206851&r1=206850&r2=206851&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp Mon Apr 21 22:21:31 2014
@@ -7,8 +7,6 @@
//
//===----------------------------------------------------------------------===//
-#define DEBUG_TYPE "ReaderCOFF"
-
#include "Atoms.h"
#include "ReaderImportHeader.h"
@@ -38,6 +36,8 @@
#include <set>
#include <vector>
+#define DEBUG_TYPE "ReaderCOFF"
+
using std::vector;
using lld::pecoff::COFFAbsoluteAtom;
using lld::pecoff::COFFBSSAtom;
Modified: lld/trunk/lib/ReaderWriter/PECOFF/ReaderImportHeader.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/ReaderImportHeader.cpp?rev=206851&r1=206850&r2=206851&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/ReaderImportHeader.cpp (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/ReaderImportHeader.cpp Mon Apr 21 22:21:31 2014
@@ -118,8 +118,6 @@
///
//===----------------------------------------------------------------------===//
-#define DEBUG_TYPE "ReaderImportHeader"
-
#include "Atoms.h"
#include "lld/Core/File.h"
@@ -147,6 +145,8 @@ using namespace lld;
using namespace lld::pecoff;
using namespace llvm;
+#define DEBUG_TYPE "ReaderImportHeader"
+
namespace lld {
namespace {
Modified: lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp?rev=206851&r1=206850&r2=206851&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp Mon Apr 21 22:21:31 2014
@@ -19,8 +19,6 @@
///
//===----------------------------------------------------------------------===//
-#define DEBUG_TYPE "WriterPECOFF"
-
#include "Atoms.h"
#include "WriterImportLibrary.h"
@@ -46,6 +44,8 @@
#include <time.h>
#include <vector>
+#define DEBUG_TYPE "WriterPECOFF"
+
using llvm::COFF::DataDirectoryIndex;
using llvm::object::coff_runtime_function_x64;
using llvm::support::ulittle16_t;
More information about the llvm-commits
mailing list