[Sparc] Create a TargetInfo header. NFC

Move the declarations of getThe<Name>Target() functions into a new header in
TargetInfo and make users of these functions include this new header.
This fixes a layering problem.

llvm-svn: 360733
This commit is contained in:
Richard Trieu 2019-05-15 00:35:37 +00:00
parent 51fc56d603
commit cf82d4a483
8 changed files with 28 additions and 12 deletions

View File

@ -8,6 +8,7 @@
#include "MCTargetDesc/SparcMCExpr.h"
#include "MCTargetDesc/SparcMCTargetDesc.h"
#include "TargetInfo/SparcTargetInfo.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"

View File

@ -11,6 +11,7 @@
//===----------------------------------------------------------------------===//
#include "MCTargetDesc/SparcMCTargetDesc.h"
#include "TargetInfo/SparcTargetInfo.h"
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCDisassembler/MCDisassembler.h"
@ -40,12 +41,6 @@ public:
};
}
namespace llvm {
Target &getTheSparcTarget();
Target &getTheSparcV9Target();
Target &getTheSparcelTarget();
}
static MCDisassembler *createSparcDisassembler(const Target &T,
const MCSubtargetInfo &STI,
MCContext &Ctx) {

View File

@ -14,6 +14,7 @@
#include "SparcInstPrinter.h"
#include "SparcMCAsmInfo.h"
#include "SparcTargetStreamer.h"
#include "TargetInfo/SparcTargetInfo.h"
#include "llvm/MC/MCInstrInfo.h"
#include "llvm/MC/MCRegisterInfo.h"
#include "llvm/MC/MCSubtargetInfo.h"

View File

@ -32,10 +32,6 @@ class StringRef;
class raw_pwrite_stream;
class raw_ostream;
Target &getTheSparcTarget();
Target &getTheSparcV9Target();
Target &getTheSparcelTarget();
MCCodeEmitter *createSparcMCCodeEmitter(const MCInstrInfo &MCII,
const MCRegisterInfo &MRI,
MCContext &Ctx);

View File

@ -17,6 +17,7 @@
#include "Sparc.h"
#include "SparcInstrInfo.h"
#include "SparcTargetMachine.h"
#include "TargetInfo/SparcTargetInfo.h"
#include "llvm/CodeGen/AsmPrinter.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineModuleInfoImpls.h"

View File

@ -13,6 +13,7 @@
#include "LeonPasses.h"
#include "Sparc.h"
#include "SparcTargetObjectFile.h"
#include "TargetInfo/SparcTargetInfo.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/CodeGen/TargetPassConfig.h"
#include "llvm/IR/LegacyPassManager.h"

View File

@ -6,8 +6,7 @@
//
//===----------------------------------------------------------------------===//
#include "Sparc.h"
#include "llvm/IR/Module.h"
#include "TargetInfo/SparcTargetInfo.h"
#include "llvm/Support/TargetRegistry.h"
using namespace llvm;

View File

@ -0,0 +1,22 @@
//===-- SparcTargetInfo.h - Sparc 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_SPARC_TARGETINFO_SPARCTARGETINFO_H
#define LLVM_LIB_TARGET_SPARC_TARGETINFO_SPARCTARGETINFO_H
namespace llvm {
class Target;
Target &getTheSparcTarget();
Target &getTheSparcV9Target();
Target &getTheSparcelTarget();
} // namespace llvm
#endif // LLVM_LIB_TARGET_SPARC_TARGETINFO_SPARCTARGETINFO_H