[llvm] 96ce8ca - [NFC][Lanai][Hexagon] Define DEBUG_TYPE after including Debug.h. (#125440)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 12 06:33:03 PST 2025
Author: Jason Eckhardt
Date: 2025-02-12T08:32:59-06:00
New Revision: 96ce8cadf9181db8b155a4f4374d7fff861303b3
URL: https://github.com/llvm/llvm-project/commit/96ce8cadf9181db8b155a4f4374d7fff861303b3
DIFF: https://github.com/llvm/llvm-project/commit/96ce8cadf9181db8b155a4f4374d7fff861303b3.diff
LOG: [NFC][Lanai][Hexagon] Define DEBUG_TYPE after including Debug.h. (#125440)
This patch fixes some warnings/errors that occur with certain
compilers-- due to existing code not following the idiom mentioned in
`Debug.h`:
```
// LLVM_DEBUG() requires the DEBUG_TYPE macro to be defined. Set it 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.**
```
Added:
Modified:
llvm/lib/Target/Hexagon/HexagonLoopAlign.cpp
llvm/lib/Target/Lanai/Disassembler/LanaiDisassembler.cpp
llvm/lib/Target/Lanai/Disassembler/LanaiDisassembler.h
Removed:
################################################################################
diff --git a/llvm/lib/Target/Hexagon/HexagonLoopAlign.cpp b/llvm/lib/Target/Hexagon/HexagonLoopAlign.cpp
index 8ebead8a41c90..4a9006935917c 100644
--- a/llvm/lib/Target/Hexagon/HexagonLoopAlign.cpp
+++ b/llvm/lib/Target/Hexagon/HexagonLoopAlign.cpp
@@ -9,13 +9,13 @@
// number of instructions, set the prefLoopAlignment to 32 bytes (5).
//===----------------------------------------------------------------------===//
-#define DEBUG_TYPE "hexagon-loop-align"
-
#include "HexagonTargetMachine.h"
#include "llvm/CodeGen/MachineBlockFrequencyInfo.h"
#include "llvm/CodeGen/MachineBranchProbabilityInfo.h"
#include "llvm/Support/Debug.h"
+#define DEBUG_TYPE "hexagon-loop-align"
+
using namespace llvm;
static cl::opt<bool>
diff --git a/llvm/lib/Target/Lanai/Disassembler/LanaiDisassembler.cpp b/llvm/lib/Target/Lanai/Disassembler/LanaiDisassembler.cpp
index e9fecef4ac5b9..2720e1d9a6a64 100644
--- a/llvm/lib/Target/Lanai/Disassembler/LanaiDisassembler.cpp
+++ b/llvm/lib/Target/Lanai/Disassembler/LanaiDisassembler.cpp
@@ -20,8 +20,11 @@
#include "llvm/MC/MCInst.h"
#include "llvm/MC/MCSubtargetInfo.h"
#include "llvm/MC/TargetRegistry.h"
+#include "llvm/Support/Debug.h"
#include "llvm/Support/MathExtras.h"
+#define DEBUG_TYPE "lanai-disassembler"
+
using namespace llvm;
typedef MCDisassembler::DecodeStatus DecodeStatus;
diff --git a/llvm/lib/Target/Lanai/Disassembler/LanaiDisassembler.h b/llvm/lib/Target/Lanai/Disassembler/LanaiDisassembler.h
index 8aa28417896dc..04aeb3f27a3da 100644
--- a/llvm/lib/Target/Lanai/Disassembler/LanaiDisassembler.h
+++ b/llvm/lib/Target/Lanai/Disassembler/LanaiDisassembler.h
@@ -15,8 +15,6 @@
#include "llvm/MC/MCDisassembler/MCDisassembler.h"
-#define DEBUG_TYPE "lanai-disassembler"
-
namespace llvm {
class LanaiDisassembler : public MCDisassembler {
More information about the llvm-commits
mailing list