[llvm] r360718 - [ARM] Create a TargetInfo header. NFC
Richard Trieu via llvm-commits
llvm-commits at lists.llvm.org
Tue May 14 15:29:50 PDT 2019
Author: rtrieu
Date: Tue May 14 15:29:50 2019
New Revision: 360718
URL: http://llvm.org/viewvc/llvm-project?rev=360718&view=rev
Log:
[ARM] 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.
Added:
llvm/trunk/lib/Target/ARM/TargetInfo/ARMTargetInfo.h
- copied, changed from r360716, llvm/trunk/lib/Target/ARM/TargetInfo/ARMTargetInfo.cpp
Modified:
llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp
llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp
llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp
llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.h
llvm/trunk/lib/Target/ARM/TargetInfo/ARMTargetInfo.cpp
Modified: llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp?rev=360718&r1=360717&r2=360718&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp Tue May 14 15:29:50 2019
@@ -20,6 +20,7 @@
#include "MCTargetDesc/ARMAddressingModes.h"
#include "MCTargetDesc/ARMInstPrinter.h"
#include "MCTargetDesc/ARMMCExpr.h"
+#include "TargetInfo/ARMTargetInfo.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/BinaryFormat/COFF.h"
Modified: llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp?rev=360718&r1=360717&r2=360718&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp Tue May 14 15:29:50 2019
@@ -16,6 +16,7 @@
#include "ARMTargetObjectFile.h"
#include "ARMTargetTransformInfo.h"
#include "MCTargetDesc/ARMMCTargetDesc.h"
+#include "TargetInfo/ARMTargetInfo.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringRef.h"
Modified: llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp?rev=360718&r1=360717&r2=360718&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp (original)
+++ llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp Tue May 14 15:29:50 2019
@@ -13,6 +13,7 @@
#include "MCTargetDesc/ARMInstPrinter.h"
#include "MCTargetDesc/ARMMCExpr.h"
#include "MCTargetDesc/ARMMCTargetDesc.h"
+#include "TargetInfo/ARMTargetInfo.h"
#include "llvm/ADT/APFloat.h"
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/None.h"
Modified: llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassembler.cpp?rev=360718&r1=360717&r2=360718&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassembler.cpp (original)
+++ llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassembler.cpp Tue May 14 15:29:50 2019
@@ -9,6 +9,7 @@
#include "MCTargetDesc/ARMAddressingModes.h"
#include "MCTargetDesc/ARMBaseInfo.h"
#include "MCTargetDesc/ARMMCTargetDesc.h"
+#include "TargetInfo/ARMTargetInfo.h"
#include "Utils/ARMBaseInfo.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCDisassembler/MCDisassembler.h"
Modified: llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp?rev=360718&r1=360717&r2=360718&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp (original)
+++ llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp Tue May 14 15:29:50 2019
@@ -14,6 +14,7 @@
#include "ARMBaseInfo.h"
#include "ARMInstPrinter.h"
#include "ARMMCAsmInfo.h"
+#include "TargetInfo/ARMTargetInfo.h"
#include "llvm/ADT/Triple.h"
#include "llvm/MC/MCAsmBackend.h"
#include "llvm/MC/MCCodeEmitter.h"
Modified: llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.h?rev=360718&r1=360717&r2=360718&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.h (original)
+++ llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.h Tue May 14 15:29:50 2019
@@ -38,11 +38,6 @@ class Triple;
class raw_ostream;
class raw_pwrite_stream;
-Target &getTheARMLETarget();
-Target &getTheThumbLETarget();
-Target &getTheARMBETarget();
-Target &getTheThumbBETarget();
-
namespace ARM_MC {
std::string ParseARMTriple(const Triple &TT, StringRef CPU);
Modified: llvm/trunk/lib/Target/ARM/TargetInfo/ARMTargetInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/TargetInfo/ARMTargetInfo.cpp?rev=360718&r1=360717&r2=360718&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/TargetInfo/ARMTargetInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARM/TargetInfo/ARMTargetInfo.cpp Tue May 14 15:29:50 2019
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "MCTargetDesc/ARMMCTargetDesc.h"
+#include "TargetInfo/ARMTargetInfo.h"
#include "llvm/Support/TargetRegistry.h"
using namespace llvm;
Copied: llvm/trunk/lib/Target/ARM/TargetInfo/ARMTargetInfo.h (from r360716, llvm/trunk/lib/Target/ARM/TargetInfo/ARMTargetInfo.cpp)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/TargetInfo/ARMTargetInfo.h?p2=llvm/trunk/lib/Target/ARM/TargetInfo/ARMTargetInfo.h&p1=llvm/trunk/lib/Target/ARM/TargetInfo/ARMTargetInfo.cpp&r1=360716&r2=360718&rev=360718&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/TargetInfo/ARMTargetInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARM/TargetInfo/ARMTargetInfo.h Tue May 14 15:29:50 2019
@@ -1,4 +1,4 @@
-//===-- ARMTargetInfo.cpp - ARM Target Implementation ---------------------===//
+//===-- ARMTargetInfo.h - ARM 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.
@@ -6,35 +6,18 @@
//
//===----------------------------------------------------------------------===//
-#include "MCTargetDesc/ARMMCTargetDesc.h"
-#include "llvm/Support/TargetRegistry.h"
-using namespace llvm;
-
-Target &llvm::getTheARMLETarget() {
- static Target TheARMLETarget;
- return TheARMLETarget;
-}
-Target &llvm::getTheARMBETarget() {
- static Target TheARMBETarget;
- return TheARMBETarget;
-}
-Target &llvm::getTheThumbLETarget() {
- static Target TheThumbLETarget;
- return TheThumbLETarget;
-}
-Target &llvm::getTheThumbBETarget() {
- static Target TheThumbBETarget;
- return TheThumbBETarget;
-}
-
-extern "C" void LLVMInitializeARMTargetInfo() {
- RegisterTarget<Triple::arm, /*HasJIT=*/true> X(getTheARMLETarget(), "arm",
- "ARM", "ARM");
- RegisterTarget<Triple::armeb, /*HasJIT=*/true> Y(getTheARMBETarget(), "armeb",
- "ARM (big endian)", "ARM");
-
- RegisterTarget<Triple::thumb, /*HasJIT=*/true> A(getTheThumbLETarget(),
- "thumb", "Thumb", "ARM");
- RegisterTarget<Triple::thumbeb, /*HasJIT=*/true> B(
- getTheThumbBETarget(), "thumbeb", "Thumb (big endian)", "ARM");
-}
+#ifndef LLVM_LIB_TARGET_ARM_TARGETINFO_ARMTARGETINFO_H
+#define LLVM_LIB_TARGET_ARM_TARGETINFO_ARMTARGETINFO_H
+
+namespace llvm {
+
+class Target;
+
+Target &getTheARMLETarget();
+Target &getTheARMBETarget();
+Target &getTheThumbLETarget();
+Target &getTheThumbBETarget();
+
+} // namespace llvm
+
+#endif // LLVM_LIB_TARGET_ARM_TARGETINFO_ARMTARGETINFO_H
More information about the llvm-commits
mailing list