From ca462efaa83aab6d5a31547edfa40d6ad62f437e Mon Sep 17 00:00:00 2001 From: Richard Trieu Date: Wed, 15 May 2019 00:46:18 +0000 Subject: [PATCH] [SystemZ] 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360734 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../SystemZ/AsmParser/SystemZAsmParser.cpp | 1 + .../Disassembler/SystemZDisassembler.cpp | 1 + .../MCTargetDesc/SystemZMCTargetDesc.cpp | 1 + .../MCTargetDesc/SystemZMCTargetDesc.h | 2 -- lib/Target/SystemZ/SystemZAsmPrinter.cpp | 1 + lib/Target/SystemZ/SystemZTargetMachine.cpp | 1 + .../SystemZ/TargetInfo/SystemZTargetInfo.cpp | 2 +- .../SystemZ/TargetInfo/SystemZTargetInfo.h | 20 +++++++++++++++++++ 8 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 lib/Target/SystemZ/TargetInfo/SystemZTargetInfo.h diff --git a/lib/Target/SystemZ/AsmParser/SystemZAsmParser.cpp b/lib/Target/SystemZ/AsmParser/SystemZAsmParser.cpp index 36c9e6aa6db..a259ba3433d 100644 --- a/lib/Target/SystemZ/AsmParser/SystemZAsmParser.cpp +++ b/lib/Target/SystemZ/AsmParser/SystemZAsmParser.cpp @@ -8,6 +8,7 @@ #include "MCTargetDesc/SystemZInstPrinter.h" #include "MCTargetDesc/SystemZMCTargetDesc.h" +#include "TargetInfo/SystemZTargetInfo.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringRef.h" diff --git a/lib/Target/SystemZ/Disassembler/SystemZDisassembler.cpp b/lib/Target/SystemZ/Disassembler/SystemZDisassembler.cpp index 7b50b9ce807..70c26db33ce 100644 --- a/lib/Target/SystemZ/Disassembler/SystemZDisassembler.cpp +++ b/lib/Target/SystemZ/Disassembler/SystemZDisassembler.cpp @@ -8,6 +8,7 @@ #include "MCTargetDesc/SystemZMCTargetDesc.h" #include "SystemZ.h" +#include "TargetInfo/SystemZTargetInfo.h" #include "llvm/MC/MCDisassembler/MCDisassembler.h" #include "llvm/MC/MCFixedLenDisassembler.h" #include "llvm/MC/MCInst.h" diff --git a/lib/Target/SystemZ/MCTargetDesc/SystemZMCTargetDesc.cpp b/lib/Target/SystemZ/MCTargetDesc/SystemZMCTargetDesc.cpp index ba5767a8dc4..3c0300cfd8f 100644 --- a/lib/Target/SystemZ/MCTargetDesc/SystemZMCTargetDesc.cpp +++ b/lib/Target/SystemZ/MCTargetDesc/SystemZMCTargetDesc.cpp @@ -9,6 +9,7 @@ #include "SystemZMCTargetDesc.h" #include "SystemZInstPrinter.h" #include "SystemZMCAsmInfo.h" +#include "TargetInfo/SystemZTargetInfo.h" #include "llvm/MC/MCDwarf.h" #include "llvm/MC/MCInstrInfo.h" #include "llvm/MC/MCRegisterInfo.h" diff --git a/lib/Target/SystemZ/MCTargetDesc/SystemZMCTargetDesc.h b/lib/Target/SystemZ/MCTargetDesc/SystemZMCTargetDesc.h index 53fa3582933..8f720c5abb3 100644 --- a/lib/Target/SystemZ/MCTargetDesc/SystemZMCTargetDesc.h +++ b/lib/Target/SystemZ/MCTargetDesc/SystemZMCTargetDesc.h @@ -29,8 +29,6 @@ class Triple; class raw_pwrite_stream; class raw_ostream; -Target &getTheSystemZTarget(); - namespace SystemZMC { // How many bytes are in the ABI-defined, caller-allocated part of // a stack frame. diff --git a/lib/Target/SystemZ/SystemZAsmPrinter.cpp b/lib/Target/SystemZ/SystemZAsmPrinter.cpp index d37310cfea7..f3d7d3e1fd1 100644 --- a/lib/Target/SystemZ/SystemZAsmPrinter.cpp +++ b/lib/Target/SystemZ/SystemZAsmPrinter.cpp @@ -15,6 +15,7 @@ #include "MCTargetDesc/SystemZInstPrinter.h" #include "SystemZConstantPoolValue.h" #include "SystemZMCInstLower.h" +#include "TargetInfo/SystemZTargetInfo.h" #include "llvm/CodeGen/MachineModuleInfoImpls.h" #include "llvm/CodeGen/TargetLoweringObjectFileImpl.h" #include "llvm/IR/Mangler.h" diff --git a/lib/Target/SystemZ/SystemZTargetMachine.cpp b/lib/Target/SystemZ/SystemZTargetMachine.cpp index 10ca9b649ec..f3ec32a68ef 100644 --- a/lib/Target/SystemZ/SystemZTargetMachine.cpp +++ b/lib/Target/SystemZ/SystemZTargetMachine.cpp @@ -11,6 +11,7 @@ #include "SystemZ.h" #include "SystemZMachineScheduler.h" #include "SystemZTargetTransformInfo.h" +#include "TargetInfo/SystemZTargetInfo.h" #include "llvm/ADT/Optional.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SmallVector.h" diff --git a/lib/Target/SystemZ/TargetInfo/SystemZTargetInfo.cpp b/lib/Target/SystemZ/TargetInfo/SystemZTargetInfo.cpp index 07093dcf9f3..713a55ee840 100644 --- a/lib/Target/SystemZ/TargetInfo/SystemZTargetInfo.cpp +++ b/lib/Target/SystemZ/TargetInfo/SystemZTargetInfo.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -#include "SystemZ.h" +#include "TargetInfo/SystemZTargetInfo.h" #include "llvm/Support/TargetRegistry.h" using namespace llvm; diff --git a/lib/Target/SystemZ/TargetInfo/SystemZTargetInfo.h b/lib/Target/SystemZ/TargetInfo/SystemZTargetInfo.h new file mode 100644 index 00000000000..cad141c81e6 --- /dev/null +++ b/lib/Target/SystemZ/TargetInfo/SystemZTargetInfo.h @@ -0,0 +1,20 @@ +//===-- SystemZTargetInfo.h - SystemZ 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_SYSTEMZ_TARGETINFO_SYSTEMZTARGETINFO_H +#define LLVM_LIB_TARGET_SYSTEMZ_TARGETINFO_SYSTEMZTARGETINFO_H + +namespace llvm { + +class Target; + +Target &getTheSystemZTarget(); + +} // namespace llvm + +#endif // LLVM_LIB_TARGET_SYSTEMZ_TARGETINFO_SYSTEMZTARGETINFO_H -- 2.40.0