Skip to content

Commit

Permalink
[NFC][Lanai][Hexagon] Define DEBUG_TYPE after including Debug.h. (llv…
Browse files Browse the repository at this point in the history
…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.**
```
  • Loading branch information
nvjle authored and joaosaffran committed Feb 14, 2025
1 parent 06b3282 commit b94cb69
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions llvm/lib/Target/Hexagon/HexagonLoopAlign.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
3 changes: 3 additions & 0 deletions llvm/lib/Target/Lanai/Disassembler/LanaiDisassembler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions llvm/lib/Target/Lanai/Disassembler/LanaiDisassembler.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@

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

#define DEBUG_TYPE "lanai-disassembler"

namespace llvm {

class LanaiDisassembler : public MCDisassembler {
Expand Down

0 comments on commit b94cb69

Please sign in to comment.