Skip to content

Commit 96ce8ca

Browse files
authored
[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.** ```
1 parent f085261 commit 96ce8ca

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

llvm/lib/Target/Hexagon/HexagonLoopAlign.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
// number of instructions, set the prefLoopAlignment to 32 bytes (5).
1010
//===----------------------------------------------------------------------===//
1111

12-
#define DEBUG_TYPE "hexagon-loop-align"
13-
1412
#include "HexagonTargetMachine.h"
1513
#include "llvm/CodeGen/MachineBlockFrequencyInfo.h"
1614
#include "llvm/CodeGen/MachineBranchProbabilityInfo.h"
1715
#include "llvm/Support/Debug.h"
1816

17+
#define DEBUG_TYPE "hexagon-loop-align"
18+
1919
using namespace llvm;
2020

2121
static cl::opt<bool>

llvm/lib/Target/Lanai/Disassembler/LanaiDisassembler.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@
2020
#include "llvm/MC/MCInst.h"
2121
#include "llvm/MC/MCSubtargetInfo.h"
2222
#include "llvm/MC/TargetRegistry.h"
23+
#include "llvm/Support/Debug.h"
2324
#include "llvm/Support/MathExtras.h"
2425

26+
#define DEBUG_TYPE "lanai-disassembler"
27+
2528
using namespace llvm;
2629

2730
typedef MCDisassembler::DecodeStatus DecodeStatus;

llvm/lib/Target/Lanai/Disassembler/LanaiDisassembler.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515

1616
#include "llvm/MC/MCDisassembler/MCDisassembler.h"
1717

18-
#define DEBUG_TYPE "lanai-disassembler"
19-
2018
namespace llvm {
2119

2220
class LanaiDisassembler : public MCDisassembler {

0 commit comments

Comments
 (0)