[AArch64] 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: 360709
This commit is contained in:
Richard Trieu 2019-05-14 21:33:53 +00:00
parent 9b234b388d
commit b26592e04d
8 changed files with 36 additions and 14 deletions

View File

@ -22,6 +22,7 @@
#include "MCTargetDesc/AArch64MCExpr.h"
#include "MCTargetDesc/AArch64MCTargetDesc.h"
#include "MCTargetDesc/AArch64TargetStreamer.h"
#include "TargetInfo/AArch64TargetInfo.h"
#include "Utils/AArch64BaseInfo.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/SmallVector.h"

View File

@ -16,6 +16,7 @@
#include "AArch64TargetObjectFile.h"
#include "AArch64TargetTransformInfo.h"
#include "MCTargetDesc/AArch64MCTargetDesc.h"
#include "TargetInfo/AArch64TargetInfo.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/Triple.h"
#include "llvm/Analysis/TargetTransformInfo.h"

View File

@ -10,6 +10,7 @@
#include "MCTargetDesc/AArch64MCExpr.h"
#include "MCTargetDesc/AArch64MCTargetDesc.h"
#include "MCTargetDesc/AArch64TargetStreamer.h"
#include "TargetInfo/AArch64TargetInfo.h"
#include "AArch64InstrInfo.h"
#include "Utils/AArch64BaseInfo.h"
#include "llvm/ADT/APFloat.h"

View File

@ -13,6 +13,7 @@
#include "AArch64ExternalSymbolizer.h"
#include "MCTargetDesc/AArch64AddressingModes.h"
#include "MCTargetDesc/AArch64MCTargetDesc.h"
#include "TargetInfo/AArch64TargetInfo.h"
#include "Utils/AArch64BaseInfo.h"
#include "llvm-c/Disassembler.h"
#include "llvm/MC/MCDisassembler/MCRelocationInfo.h"

View File

@ -16,6 +16,7 @@
#include "AArch64WinCOFFStreamer.h"
#include "MCTargetDesc/AArch64AddressingModes.h"
#include "MCTargetDesc/AArch64InstPrinter.h"
#include "TargetInfo/AArch64TargetInfo.h"
#include "llvm/MC/MCAsmBackend.h"
#include "llvm/MC/MCCodeEmitter.h"
#include "llvm/MC/MCInstrAnalysis.h"

View File

@ -36,12 +36,6 @@ class Triple;
class raw_ostream;
class raw_pwrite_stream;
Target &getTheAArch64leTarget();
Target &getTheAArch64beTarget();
Target &getTheAArch64_32Target();
Target &getTheARM64Target();
Target &getTheARM64_32Target();
MCCodeEmitter *createAArch64MCCodeEmitter(const MCInstrInfo &MCII,
const MCRegisterInfo &MRI,
MCContext &Ctx);

View File

@ -6,31 +6,30 @@
//
//===----------------------------------------------------------------------===//
#include "llvm/ADT/Triple.h"
#include "TargetInfo/AArch64TargetInfo.h"
#include "llvm/Support/TargetRegistry.h"
using namespace llvm;
namespace llvm {
Target &getTheAArch64leTarget() {
Target &llvm::getTheAArch64leTarget() {
static Target TheAArch64leTarget;
return TheAArch64leTarget;
}
Target &getTheAArch64beTarget() {
Target &llvm::getTheAArch64beTarget() {
static Target TheAArch64beTarget;
return TheAArch64beTarget;
}
Target &getTheAArch64_32Target() {
Target &llvm::getTheAArch64_32Target() {
static Target TheAArch64leTarget;
return TheAArch64leTarget;
}
Target &getTheARM64Target() {
Target &llvm::getTheARM64Target() {
static Target TheARM64Target;
return TheARM64Target;
}
Target &getTheARM64_32Target() {
Target &llvm::getTheARM64_32Target() {
static Target TheARM64_32Target;
return TheARM64_32Target;
}
} // namespace llvm
extern "C" void LLVMInitializeAArch64TargetInfo() {
// Now register the "arm64" name for use with "-march". We don't want it to

View File

@ -0,0 +1,24 @@
//===-- AArch64TargetInfo.h - AArch64 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_AARCH64_TARGETINFO_AARCH64TARGETINFO_H
#define LLVM_LIB_TARGET_AARCH64_TARGETINFO_AARCH64TARGETINFO_H
namespace llvm {
class Target;
Target &getTheAArch64leTarget();
Target &getTheAArch64beTarget();
Target &getTheAArch64_32Target();
Target &getTheARM64Target();
Target &getTheARM64_32Target();
} // namespace llvm
#endif // LLVM_LIB_TARGET_AARCH64_TARGETINFO_AARCH64TARGETINFO_H