From ad51f676a1adec912a647af4723b45786b5ca57d Mon Sep 17 00:00:00 2001 From: Richard Trieu Date: Tue, 14 May 2019 22:06:04 +0000 Subject: [PATCH] [ARC] Create a TargetInfo header. NFC Move the declarations of getTheTarget() functions into a new header in TargetInfo and make users of these functions include this new header. This fixes a layering problem. llvm-svn: 360716 --- lib/Target/ARC/ARCAsmPrinter.cpp | 1 + lib/Target/ARC/ARCTargetMachine.cpp | 1 + .../ARC/Disassembler/ARCDisassembler.cpp | 1 + .../ARC/MCTargetDesc/ARCMCTargetDesc.cpp | 1 + lib/Target/ARC/MCTargetDesc/ARCMCTargetDesc.h | 2 -- lib/Target/ARC/TargetInfo/ARCTargetInfo.cpp | 2 +- lib/Target/ARC/TargetInfo/ARCTargetInfo.h | 20 +++++++++++++++++++ 7 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 lib/Target/ARC/TargetInfo/ARCTargetInfo.h diff --git a/lib/Target/ARC/ARCAsmPrinter.cpp b/lib/Target/ARC/ARCAsmPrinter.cpp index 668f6ca7a15..d72a5003678 100644 --- a/lib/Target/ARC/ARCAsmPrinter.cpp +++ b/lib/Target/ARC/ARCAsmPrinter.cpp @@ -18,6 +18,7 @@ #include "ARCTargetMachine.h" #include "ARCTargetStreamer.h" #include "MCTargetDesc/ARCInstPrinter.h" +#include "TargetInfo/ARCTargetInfo.h" #include "llvm/ADT/SmallString.h" #include "llvm/ADT/StringExtras.h" #include "llvm/CodeGen/AsmPrinter.h" diff --git a/lib/Target/ARC/ARCTargetMachine.cpp b/lib/Target/ARC/ARCTargetMachine.cpp index ed88cf701e5..9fb45d686c2 100644 --- a/lib/Target/ARC/ARCTargetMachine.cpp +++ b/lib/Target/ARC/ARCTargetMachine.cpp @@ -12,6 +12,7 @@ #include "ARCTargetMachine.h" #include "ARC.h" #include "ARCTargetTransformInfo.h" +#include "TargetInfo/ARCTargetInfo.h" #include "llvm/CodeGen/Passes.h" #include "llvm/CodeGen/TargetLoweringObjectFileImpl.h" #include "llvm/CodeGen/TargetPassConfig.h" diff --git a/lib/Target/ARC/Disassembler/ARCDisassembler.cpp b/lib/Target/ARC/Disassembler/ARCDisassembler.cpp index deabeb69f69..82da18617b9 100644 --- a/lib/Target/ARC/Disassembler/ARCDisassembler.cpp +++ b/lib/Target/ARC/Disassembler/ARCDisassembler.cpp @@ -14,6 +14,7 @@ #include "ARC.h" #include "ARCRegisterInfo.h" #include "MCTargetDesc/ARCMCTargetDesc.h" +#include "TargetInfo/ARCTargetInfo.h" #include "llvm/MC/MCContext.h" #include "llvm/MC/MCDisassembler/MCDisassembler.h" #include "llvm/MC/MCFixedLenDisassembler.h" diff --git a/lib/Target/ARC/MCTargetDesc/ARCMCTargetDesc.cpp b/lib/Target/ARC/MCTargetDesc/ARCMCTargetDesc.cpp index 5739866993b..aa4818cd57a 100644 --- a/lib/Target/ARC/MCTargetDesc/ARCMCTargetDesc.cpp +++ b/lib/Target/ARC/MCTargetDesc/ARCMCTargetDesc.cpp @@ -14,6 +14,7 @@ #include "ARCInstPrinter.h" #include "ARCMCAsmInfo.h" #include "ARCTargetStreamer.h" +#include "TargetInfo/ARCTargetInfo.h" #include "llvm/MC/MCDwarf.h" #include "llvm/MC/MCInstrInfo.h" #include "llvm/MC/MCRegisterInfo.h" diff --git a/lib/Target/ARC/MCTargetDesc/ARCMCTargetDesc.h b/lib/Target/ARC/MCTargetDesc/ARCMCTargetDesc.h index 8d14c714831..ab06ce46d99 100644 --- a/lib/Target/ARC/MCTargetDesc/ARCMCTargetDesc.h +++ b/lib/Target/ARC/MCTargetDesc/ARCMCTargetDesc.h @@ -19,8 +19,6 @@ namespace llvm { class Target; -Target &getTheARCTarget(); - } // end namespace llvm // Defines symbolic names for ARC registers. This defines a mapping from diff --git a/lib/Target/ARC/TargetInfo/ARCTargetInfo.cpp b/lib/Target/ARC/TargetInfo/ARCTargetInfo.cpp index 8c1ec588c8e..59b9f806d59 100644 --- a/lib/Target/ARC/TargetInfo/ARCTargetInfo.cpp +++ b/lib/Target/ARC/TargetInfo/ARCTargetInfo.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -#include "ARC.h" +#include "TargetInfo/ARCTargetInfo.h" #include "llvm/Support/TargetRegistry.h" using namespace llvm; diff --git a/lib/Target/ARC/TargetInfo/ARCTargetInfo.h b/lib/Target/ARC/TargetInfo/ARCTargetInfo.h new file mode 100644 index 00000000000..6a9d2685f42 --- /dev/null +++ b/lib/Target/ARC/TargetInfo/ARCTargetInfo.h @@ -0,0 +1,20 @@ +//===- ARCTargetInfo.h - ARC Target Implementation ------------- *- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_LIB_TARGET_ARC_TARGETINFO_ARCTARGETINFO_H +#define LLVM_LIB_TARGET_ARC_TARGETINFO_ARCTARGETINFO_H + +namespace llvm { + +class Target; + +Target &getTheARCTarget(); + +} // namespace llvm + +#endif // LLVM_LIB_TARGET_ARC_TARGETINFO_ARCTARGETINFO_H