From 5b735062bb7a9dba869330c9bae14423e2a35332 Mon Sep 17 00:00:00 2001 From: Jason Eckhardt Date: Sun, 2 Feb 2025 16:59:41 -0600 Subject: [PATCH 1/2] [NFC][Lanai][Hexagon] Define DEBUG_TYPE after including Debug.h. This fixes some warnings/errors that occur with certain compilers. --- llvm/lib/Target/Hexagon/HexagonLoopAlign.cpp | 4 ++-- llvm/lib/Target/Lanai/Disassembler/LanaiDisassembler.cpp | 3 +++ llvm/lib/Target/Lanai/Disassembler/LanaiDisassembler.h | 2 -- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/llvm/lib/Target/Hexagon/HexagonLoopAlign.cpp b/llvm/lib/Target/Hexagon/HexagonLoopAlign.cpp index 7d4c9eacbabfb..4a6e8a165457e 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 diff --git a/llvm/lib/Target/Lanai/Disassembler/LanaiDisassembler.cpp b/llvm/lib/Target/Lanai/Disassembler/LanaiDisassembler.cpp index e9fecef4ac5b9..d5f64e22d8346 100644 --- a/llvm/lib/Target/Lanai/Disassembler/LanaiDisassembler.cpp +++ b/llvm/lib/Target/Lanai/Disassembler/LanaiDisassembler.cpp @@ -21,6 +21,9 @@ #include "llvm/MC/MCSubtargetInfo.h" #include "llvm/MC/TargetRegistry.h" #include "llvm/Support/MathExtras.h" +#include "llvm/Support/Debug.h" + +#define DEBUG_TYPE "lanai-disassembler" using namespace llvm; 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 { From a063826a5fbfcf6113ae2176cce3aab086c16dd8 Mon Sep 17 00:00:00 2001 From: Jason Eckhardt Date: Sun, 2 Feb 2025 17:11:01 -0600 Subject: [PATCH 2/2] clang-format --- llvm/lib/Target/Lanai/Disassembler/LanaiDisassembler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Target/Lanai/Disassembler/LanaiDisassembler.cpp b/llvm/lib/Target/Lanai/Disassembler/LanaiDisassembler.cpp index d5f64e22d8346..2720e1d9a6a64 100644 --- a/llvm/lib/Target/Lanai/Disassembler/LanaiDisassembler.cpp +++ b/llvm/lib/Target/Lanai/Disassembler/LanaiDisassembler.cpp @@ -20,8 +20,8 @@ #include "llvm/MC/MCInst.h" #include "llvm/MC/MCSubtargetInfo.h" #include "llvm/MC/TargetRegistry.h" -#include "llvm/Support/MathExtras.h" #include "llvm/Support/Debug.h" +#include "llvm/Support/MathExtras.h" #define DEBUG_TYPE "lanai-disassembler"