-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[NFC][Lanai][Hexagon] Define DEBUG_TYPE after including Debug.h. #125440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This fixes some warnings/errors that occur with certain compilers.
✅ With the latest revision this PR passed the C/C++ code formatter. |
@llvm/pr-subscribers-backend-hexagon Author: Jason Eckhardt (nvjle) ChangesThis fixes some warnings/errors that occur with certain compilers. Full diff: https://github.com/llvm/llvm-project/pull/125440.diff 3 Files Affected:
diff --git a/llvm/lib/Target/Hexagon/HexagonLoopAlign.cpp b/llvm/lib/Target/Hexagon/HexagonLoopAlign.cpp
index 7d4c9eacbabfbf5..4a6e8a165457e1c 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 e9fecef4ac5b915..2720e1d9a6a6440 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 8aa28417896dc1b..04aeb3f27a3da98 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 {
|
Could you elaborate on what kinds of warnings and errors your PR fixes? |
Yes, with gcc13 on linux:
The change is LLVM-idiomatic (excerpt from
|
Any other comment? This is NFC, but I still prefer to get the rubber-stamp before merging... |
…m#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.** ```
…m#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.** ```
…m#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.** ```
This patch fixes some warnings/errors that occur with certain compilers-- due to existing code not following the idiom mentioned in
Debug.h
: