1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 02:33:06 +01:00

[NFCI] Move DEBUG_TYPE definition below #includes

When you try to define a new DEBUG_TYPE in a header file, DEBUG_TYPE
definition defined around the #includes in files include it could
result in redefinition warnings even compile errors.

Reviewed By: tejohnson

Differential Revision: https://reviews.llvm.org/D102594
This commit is contained in:
Mindong Chen 2021-05-30 17:13:48 +08:00
parent e434a8e756
commit fee80286d7
22 changed files with 47 additions and 41 deletions

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
#define DEBUG_TYPE "assume-queries"
#include "llvm/Analysis/AssumeBundleQueries.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/AssumptionCache.h"
@ -18,6 +16,8 @@
#include "llvm/IR/PatternMatch.h"
#include "llvm/Support/DebugCounter.h"
#define DEBUG_TYPE "assume-queries"
using namespace llvm;
using namespace llvm::PatternMatch;

View File

@ -14,8 +14,6 @@
// independent, non-quadword FP/ASIMD floating-point multiply-accumulates.
//===----------------------------------------------------------------------===//
#define DEBUG_TYPE "aarch64-pbqp"
#include "AArch64PBQPRegAlloc.h"
#include "AArch64.h"
#include "AArch64RegisterInfo.h"
@ -28,6 +26,8 @@
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
#define DEBUG_TYPE "aarch64-pbqp"
using namespace llvm;
namespace {

View File

@ -10,8 +10,6 @@
// range conditional branches.
//===----------------------------------------------------------------------===//
#define DEBUG_TYPE "arc-branch-finalize"
#include "ARCInstrInfo.h"
#include "ARCTargetMachine.h"
#include "MCTargetDesc/ARCInfo.h"
@ -24,6 +22,8 @@
#include "llvm/Support/Debug.h"
#include <vector>
#define DEBUG_TYPE "arc-branch-finalize"
using namespace llvm;
namespace llvm {

View File

@ -10,14 +10,14 @@
// instructions on to the real streamer.
//
//===----------------------------------------------------------------------===//
#define DEBUG_TYPE "avrmcelfstreamer"
#include "MCTargetDesc/AVRMCELFStreamer.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCExpr.h"
#include "llvm/MC/MCSymbol.h"
#include "llvm/MC/MCObjectWriter.h"
#define DEBUG_TYPE "avrmcelfstreamer"
using namespace llvm;
void AVRMCELFStreamer::emitValueForModiferKind(

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
#define DEBUG_TYPE "mcasmparser"
#include "HexagonTargetStreamer.h"
#include "MCTargetDesc/HexagonMCChecker.h"
#include "MCTargetDesc/HexagonMCELFStreamer.h"
@ -58,6 +56,8 @@
#include <string>
#include <utility>
#define DEBUG_TYPE "mcasmparser"
using namespace llvm;
static cl::opt<bool> WarnMissingParenthesis(

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
#define DEBUG_TYPE "hexagon-disassembler"
#include "MCTargetDesc/HexagonBaseInfo.h"
#include "MCTargetDesc/HexagonMCChecker.h"
#include "MCTargetDesc/HexagonMCInstrInfo.h"
@ -32,6 +30,8 @@
#include <cstdint>
#include <memory>
#define DEBUG_TYPE "hexagon-disassembler"
using namespace llvm;
using namespace Hexagon;

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
#define DEBUG_TYPE "hexagon-brelax"
#include "Hexagon.h"
#include "HexagonInstrInfo.h"
#include "HexagonSubtarget.h"
@ -29,6 +27,8 @@
#include <cstdlib>
#include <iterator>
#define DEBUG_TYPE "hexagon-brelax"
using namespace llvm;
// Since we have no exact knowledge of code layout, allow some safety buffer

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
#define DEBUG_TYPE "hcp"
#include "HexagonInstrInfo.h"
#include "HexagonRegisterInfo.h"
#include "HexagonSubtarget.h"
@ -45,6 +43,8 @@
#include <utility>
#include <vector>
#define DEBUG_TYPE "hcp"
using namespace llvm;
namespace {

View File

@ -19,8 +19,6 @@
// the predicate register, they cannot use the .new form. In such cases it
// is better to collapse them back to a single MUX instruction.
#define DEBUG_TYPE "hexmux"
#include "HexagonInstrInfo.h"
#include "HexagonRegisterInfo.h"
#include "HexagonSubtarget.h"
@ -47,6 +45,8 @@
#include <limits>
#include <utility>
#define DEBUG_TYPE "hexmux"
using namespace llvm;
namespace llvm {

View File

@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
#define DEBUG_TYPE "hsdr"
#include "HexagonInstrInfo.h"
#include "HexagonRegisterInfo.h"
#include "HexagonSubtarget.h"
@ -42,6 +40,8 @@
#include <utility>
#include <vector>
#define DEBUG_TYPE "hsdr"
using namespace llvm;
namespace llvm {

View File

@ -10,8 +10,6 @@
//
//===----------------------------------------------------------------------===//
#define DEBUG_TYPE "hexagon-sdata"
#include "HexagonTargetObjectFile.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringRef.h"
@ -32,6 +30,8 @@
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetMachine.h"
#define DEBUG_TYPE "hexagon-sdata"
using namespace llvm;
static cl::opt<unsigned> SmallDataThreshold("hexagon-small-data-threshold",

View File

@ -10,7 +10,6 @@
// instructions on to the real streamer.
//
//===----------------------------------------------------------------------===//
#define DEBUG_TYPE "hexagonmcelfstreamer"
#include "MCTargetDesc/HexagonMCELFStreamer.h"
#include "MCTargetDesc/HexagonMCInstrInfo.h"
@ -37,6 +36,8 @@
#include <cassert>
#include <cstdint>
#define DEBUG_TYPE "hexagonmcelfstreamer"
using namespace llvm;
static cl::opt<unsigned> GPSize

View File

@ -11,8 +11,6 @@
//
//===----------------------------------------------------------------------===//
#define DEBUG_TYPE "hexagon-shuffle"
#include "MCTargetDesc/HexagonMCShuffler.h"
#include "MCTargetDesc/HexagonMCInstrInfo.h"
#include "MCTargetDesc/HexagonShuffler.h"
@ -24,6 +22,8 @@
#include "llvm/Support/raw_ostream.h"
#include <cassert>
#define DEBUG_TYPE "hexagon-shuffle"
using namespace llvm;
static cl::opt<bool>

View File

@ -11,8 +11,6 @@
//
//===----------------------------------------------------------------------===//
#define DEBUG_TYPE "hexagon-shuffle"
#include "MCTargetDesc/HexagonShuffler.h"
#include "MCTargetDesc/HexagonBaseInfo.h"
#include "MCTargetDesc/HexagonMCInstrInfo.h"
@ -33,6 +31,8 @@
#include <utility>
#include <vector>
#define DEBUG_TYPE "hexagon-shuffle"
using namespace llvm;
namespace {

View File

@ -13,10 +13,10 @@
#ifndef LLVM_LIB_TARGET_LANAI_DISASSEMBLER_LANAIDISASSEMBLER_H
#define LLVM_LIB_TARGET_LANAI_DISASSEMBLER_LANAIDISASSEMBLER_H
#define DEBUG_TYPE "lanai-disassembler"
#include "llvm/MC/MCDisassembler/MCDisassembler.h"
#define DEBUG_TYPE "lanai-disassembler"
namespace llvm {
class LanaiDisassembler : public MCDisassembler {

View File

@ -11,8 +11,6 @@
///
//===----------------------------------------------------------------------===//
#define DEBUG_TYPE "m68k-reg-info"
#include "M68kRegisterInfo.h"
#include "M68k.h"
@ -32,6 +30,8 @@
#define GET_REGINFO_TARGET_DESC
#include "M68kGenRegisterInfo.inc"
#define DEBUG_TYPE "m68k-reg-info"
using namespace llvm;
static cl::opt<bool> EnableBasePointer(

View File

@ -41,8 +41,6 @@
// *++p = c;
//===----------------------------------------------------------------------===//
#define DEBUG_TYPE "ppc-loop-instr-form-prep"
#include "PPC.h"
#include "PPCSubtarget.h"
#include "PPCTargetMachine.h"
@ -79,6 +77,8 @@
#include <iterator>
#include <utility>
#define DEBUG_TYPE "ppc-loop-instr-form-prep"
using namespace llvm;
static cl::opt<unsigned> MaxVarsPrep("ppc-formprep-max-vars",

View File

@ -17,8 +17,6 @@
#include "llvm/IR/Instructions.h"
#include "llvm/InitializePasses.h"
#define AA_NAME "alignment-from-assumptions"
#define DEBUG_TYPE AA_NAME
#include "llvm/Transforms/Scalar/AlignmentFromAssumptions.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/Statistic.h"
@ -37,6 +35,9 @@
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/Scalar.h"
#define AA_NAME "alignment-from-assumptions"
#define DEBUG_TYPE AA_NAME
using namespace llvm;
STATISTIC(NumLoadAlignChanged,

View File

@ -13,8 +13,6 @@
#include "llvm/InitializePasses.h"
#include "llvm/Support/CommandLine.h"
#define DEBUG_TYPE "float2int"
#include "llvm/Transforms/Scalar/Float2Int.h"
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/APSInt.h"
@ -31,6 +29,9 @@
#include "llvm/Transforms/Scalar.h"
#include <deque>
#include <functional> // For std::function
#define DEBUG_TYPE "float2int"
using namespace llvm;
// The algorithm is simple. Start at instructions that convert from the

View File

@ -13,7 +13,6 @@
#include "llvm/Transforms/Scalar/LoopDataPrefetch.h"
#include "llvm/InitializePasses.h"
#define DEBUG_TYPE "loop-data-prefetch"
#include "llvm/ADT/DepthFirstIterator.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/AssumptionCache.h"
@ -33,6 +32,9 @@
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include "llvm/Transforms/Utils/ScalarEvolutionExpander.h"
#include "llvm/Transforms/Utils/ValueMapper.h"
#define DEBUG_TYPE "loop-data-prefetch"
using namespace llvm;
// By default, we limit this to creating 16 PHIs (which is a little over half

View File

@ -19,7 +19,6 @@
// to the NFA.
//
//===----------------------------------------------------------------------===//
#define DEBUG_TYPE "dfa-emitter"
#include "DFAEmitter.h"
#include "CodeGenTarget.h"
@ -39,6 +38,8 @@
#include <string>
#include <vector>
#define DEBUG_TYPE "dfa-emitter"
using namespace llvm;
//===----------------------------------------------------------------------===//

View File

@ -14,8 +14,6 @@
//
//===----------------------------------------------------------------------===//
#define DEBUG_TYPE "dfa-emitter"
#include "CodeGenSchedule.h"
#include "CodeGenTarget.h"
#include "DFAEmitter.h"
@ -34,6 +32,8 @@
#include <unordered_map>
#include <vector>
#define DEBUG_TYPE "dfa-emitter"
using namespace llvm;
// We use a uint64_t to represent a resource bitmask.