From: Richard Trieu Date: Tue, 14 May 2019 23:45:18 +0000 (+0000) Subject: [MSP430] Create a TargetInfo header. NFC X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=037fc2be884dd8b4217ae61c479f3950be41a442;p=llvm [MSP430] 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@360728 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/MSP430/AsmParser/MSP430AsmParser.cpp b/lib/Target/MSP430/AsmParser/MSP430AsmParser.cpp index 0c296317240..a0ec14ae238 100644 --- a/lib/Target/MSP430/AsmParser/MSP430AsmParser.cpp +++ b/lib/Target/MSP430/AsmParser/MSP430AsmParser.cpp @@ -9,6 +9,7 @@ #include "MSP430.h" #include "MSP430RegisterInfo.h" #include "MCTargetDesc/MSP430MCTargetDesc.h" +#include "TargetInfo/MSP430TargetInfo.h" #include "llvm/ADT/APInt.h" #include "llvm/ADT/StringSwitch.h" diff --git a/lib/Target/MSP430/Disassembler/MSP430Disassembler.cpp b/lib/Target/MSP430/Disassembler/MSP430Disassembler.cpp index 37e3cb6ebf5..59c12e24e8b 100644 --- a/lib/Target/MSP430/Disassembler/MSP430Disassembler.cpp +++ b/lib/Target/MSP430/Disassembler/MSP430Disassembler.cpp @@ -12,6 +12,7 @@ #include "MSP430.h" #include "MCTargetDesc/MSP430MCTargetDesc.h" +#include "TargetInfo/MSP430TargetInfo.h" #include "llvm/MC/MCContext.h" #include "llvm/MC/MCDisassembler/MCDisassembler.h" #include "llvm/MC/MCFixedLenDisassembler.h" diff --git a/lib/Target/MSP430/MCTargetDesc/MSP430MCTargetDesc.cpp b/lib/Target/MSP430/MCTargetDesc/MSP430MCTargetDesc.cpp index 76eb03988a5..da928733015 100644 --- a/lib/Target/MSP430/MCTargetDesc/MSP430MCTargetDesc.cpp +++ b/lib/Target/MSP430/MCTargetDesc/MSP430MCTargetDesc.cpp @@ -13,6 +13,7 @@ #include "MSP430MCTargetDesc.h" #include "MSP430InstPrinter.h" #include "MSP430MCAsmInfo.h" +#include "TargetInfo/MSP430TargetInfo.h" #include "llvm/MC/MCInstrInfo.h" #include "llvm/MC/MCRegisterInfo.h" #include "llvm/MC/MCSubtargetInfo.h" diff --git a/lib/Target/MSP430/MCTargetDesc/MSP430MCTargetDesc.h b/lib/Target/MSP430/MCTargetDesc/MSP430MCTargetDesc.h index d5af8075c17..02bfbe40c6b 100644 --- a/lib/Target/MSP430/MCTargetDesc/MSP430MCTargetDesc.h +++ b/lib/Target/MSP430/MCTargetDesc/MSP430MCTargetDesc.h @@ -29,8 +29,6 @@ class MCObjectTargetWriter; class MCStreamer; class MCTargetStreamer; -Target &getTheMSP430Target(); - /// Creates a machine code emitter for MSP430. MCCodeEmitter *createMSP430MCCodeEmitter(const MCInstrInfo &MCII, const MCRegisterInfo &MRI, diff --git a/lib/Target/MSP430/MSP430AsmPrinter.cpp b/lib/Target/MSP430/MSP430AsmPrinter.cpp index 786ff5f8525..3a71a084d1a 100644 --- a/lib/Target/MSP430/MSP430AsmPrinter.cpp +++ b/lib/Target/MSP430/MSP430AsmPrinter.cpp @@ -16,6 +16,7 @@ #include "MSP430InstrInfo.h" #include "MSP430MCInstLower.h" #include "MSP430TargetMachine.h" +#include "TargetInfo/MSP430TargetInfo.h" #include "llvm/BinaryFormat/ELF.h" #include "llvm/CodeGen/AsmPrinter.h" #include "llvm/CodeGen/MachineConstantPool.h" diff --git a/lib/Target/MSP430/MSP430TargetMachine.cpp b/lib/Target/MSP430/MSP430TargetMachine.cpp index 757dab2f59e..8c4ca982c96 100644 --- a/lib/Target/MSP430/MSP430TargetMachine.cpp +++ b/lib/Target/MSP430/MSP430TargetMachine.cpp @@ -12,6 +12,7 @@ #include "MSP430TargetMachine.h" #include "MSP430.h" +#include "TargetInfo/MSP430TargetInfo.h" #include "llvm/CodeGen/Passes.h" #include "llvm/CodeGen/TargetLoweringObjectFileImpl.h" #include "llvm/CodeGen/TargetPassConfig.h" diff --git a/lib/Target/MSP430/TargetInfo/MSP430TargetInfo.cpp b/lib/Target/MSP430/TargetInfo/MSP430TargetInfo.cpp index 045a8b9a50f..5da7d588079 100644 --- a/lib/Target/MSP430/TargetInfo/MSP430TargetInfo.cpp +++ b/lib/Target/MSP430/TargetInfo/MSP430TargetInfo.cpp @@ -6,8 +6,7 @@ // //===----------------------------------------------------------------------===// -#include "MSP430.h" -#include "llvm/IR/Module.h" +#include "TargetInfo/MSP430TargetInfo.h" #include "llvm/Support/TargetRegistry.h" using namespace llvm; diff --git a/lib/Target/MSP430/TargetInfo/MSP430TargetInfo.h b/lib/Target/MSP430/TargetInfo/MSP430TargetInfo.h new file mode 100644 index 00000000000..17854244f28 --- /dev/null +++ b/lib/Target/MSP430/TargetInfo/MSP430TargetInfo.h @@ -0,0 +1,20 @@ +//===-- MSP430TargetInfo.h - MSP430 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_MSP430_TARGETINFO_MSP430TARGETINFO_H +#define LLVM_LIB_TARGET_MSP430_TARGETINFO_MSP430TARGETINFO_H + +namespace llvm { + +class Target; + +Target &getTheMSP430Target(); + +} // namespace llvm + +#endif // LLVM_LIB_TARGET_MSP430_TARGETINFO_MSP430TARGETINFO_H