forked from OSchip/llvm-project
[RISCV] 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: 360732
This commit is contained in:
parent
ee6ced196d
commit
51fc56d603
|
@ -10,6 +10,7 @@
|
|||
#include "MCTargetDesc/RISCVMCExpr.h"
|
||||
#include "MCTargetDesc/RISCVMCTargetDesc.h"
|
||||
#include "MCTargetDesc/RISCVTargetStreamer.h"
|
||||
#include "TargetInfo/RISCVTargetInfo.h"
|
||||
#include "Utils/RISCVBaseInfo.h"
|
||||
#include "Utils/RISCVMatInt.h"
|
||||
#include "llvm/ADT/STLExtras.h"
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "MCTargetDesc/RISCVMCTargetDesc.h"
|
||||
#include "TargetInfo/RISCVTargetInfo.h"
|
||||
#include "Utils/RISCVBaseInfo.h"
|
||||
#include "llvm/MC/MCContext.h"
|
||||
#include "llvm/MC/MCDisassembler/MCDisassembler.h"
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#include "RISCVInstPrinter.h"
|
||||
#include "RISCVMCAsmInfo.h"
|
||||
#include "RISCVTargetStreamer.h"
|
||||
#include "TargetInfo/RISCVTargetInfo.h"
|
||||
#include "llvm/ADT/STLExtras.h"
|
||||
#include "llvm/MC/MCAsmInfo.h"
|
||||
#include "llvm/MC/MCInstrInfo.h"
|
||||
|
|
|
@ -32,9 +32,6 @@ class Triple;
|
|||
class raw_ostream;
|
||||
class raw_pwrite_stream;
|
||||
|
||||
Target &getTheRISCV32Target();
|
||||
Target &getTheRISCV64Target();
|
||||
|
||||
MCCodeEmitter *createRISCVMCCodeEmitter(const MCInstrInfo &MCII,
|
||||
const MCRegisterInfo &MRI,
|
||||
MCContext &Ctx);
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#include "MCTargetDesc/RISCVInstPrinter.h"
|
||||
#include "MCTargetDesc/RISCVMCExpr.h"
|
||||
#include "RISCVTargetMachine.h"
|
||||
#include "TargetInfo/RISCVTargetInfo.h"
|
||||
#include "llvm/CodeGen/AsmPrinter.h"
|
||||
#include "llvm/CodeGen/MachineConstantPool.h"
|
||||
#include "llvm/CodeGen/MachineFunctionPass.h"
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#include "RISCV.h"
|
||||
#include "RISCVTargetMachine.h"
|
||||
#include "RISCVTargetObjectFile.h"
|
||||
#include "TargetInfo/RISCVTargetInfo.h"
|
||||
#include "llvm/ADT/STLExtras.h"
|
||||
#include "llvm/CodeGen/Passes.h"
|
||||
#include "llvm/CodeGen/TargetLoweringObjectFileImpl.h"
|
||||
|
|
|
@ -6,20 +6,19 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "TargetInfo/RISCVTargetInfo.h"
|
||||
#include "llvm/Support/TargetRegistry.h"
|
||||
using namespace llvm;
|
||||
|
||||
namespace llvm {
|
||||
Target &getTheRISCV32Target() {
|
||||
Target &llvm::getTheRISCV32Target() {
|
||||
static Target TheRISCV32Target;
|
||||
return TheRISCV32Target;
|
||||
}
|
||||
|
||||
Target &getTheRISCV64Target() {
|
||||
Target &llvm::getTheRISCV64Target() {
|
||||
static Target TheRISCV64Target;
|
||||
return TheRISCV64Target;
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" void LLVMInitializeRISCVTargetInfo() {
|
||||
RegisterTarget<Triple::riscv32> X(getTheRISCV32Target(), "riscv32",
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
//===-- RISCVTargetInfo.h - RISCV 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_RISCV_TARGETINFO_RISCVTARGETINFO_H
|
||||
#define LLVM_LIB_TARGET_RISCV_TARGETINFO_RISCVTARGETINFO_H
|
||||
|
||||
namespace llvm {
|
||||
|
||||
class Target;
|
||||
|
||||
Target &getTheRISCV32Target();
|
||||
Target &getTheRISCV64Target();
|
||||
|
||||
} // namespace llvm
|
||||
|
||||
#endif // LLVM_LIB_TARGET_RISCV_TARGETINFO_RISCVTARGETINFO_H
|
Loading…
Reference in New Issue