[llvm] r360716 - [ARC] Create a TargetInfo header. NFC
Richard Trieu via llvm-commits
llvm-commits at lists.llvm.org
Tue May 14 15:06:05 PDT 2019
Author: rtrieu
Date: Tue May 14 15:06:04 2019
New Revision: 360716
URL: http://llvm.org/viewvc/llvm-project?rev=360716&view=rev
Log:
[ARC] 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/ARC/TargetInfo/ARCTargetInfo.h
- copied, changed from r360713, llvm/trunk/lib/Target/ARC/TargetInfo/ARCTargetInfo.cpp
Modified:
llvm/trunk/lib/Target/ARC/ARCAsmPrinter.cpp
llvm/trunk/lib/Target/ARC/ARCTargetMachine.cpp
llvm/trunk/lib/Target/ARC/Disassembler/ARCDisassembler.cpp
llvm/trunk/lib/Target/ARC/MCTargetDesc/ARCMCTargetDesc.cpp
llvm/trunk/lib/Target/ARC/MCTargetDesc/ARCMCTargetDesc.h
llvm/trunk/lib/Target/ARC/TargetInfo/ARCTargetInfo.cpp
Modified: llvm/trunk/lib/Target/ARC/ARCAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARC/ARCAsmPrinter.cpp?rev=360716&r1=360715&r2=360716&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARC/ARCAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/ARC/ARCAsmPrinter.cpp Tue May 14 15:06:04 2019
@@ -18,6 +18,7 @@
#include "ARCTargetMachine.h"
#include "ARCTargetStreamer.h"
#include "MCTargetDesc/ARCInstPrinter.h"
+#include "TargetInfo/ARCTargetInfo.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/CodeGen/AsmPrinter.h"
Modified: llvm/trunk/lib/Target/ARC/ARCTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARC/ARCTargetMachine.cpp?rev=360716&r1=360715&r2=360716&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARC/ARCTargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/ARC/ARCTargetMachine.cpp Tue May 14 15:06:04 2019
@@ -12,6 +12,7 @@
#include "ARCTargetMachine.h"
#include "ARC.h"
#include "ARCTargetTransformInfo.h"
+#include "TargetInfo/ARCTargetInfo.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/CodeGen/TargetLoweringObjectFileImpl.h"
#include "llvm/CodeGen/TargetPassConfig.h"
Modified: llvm/trunk/lib/Target/ARC/Disassembler/ARCDisassembler.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARC/Disassembler/ARCDisassembler.cpp?rev=360716&r1=360715&r2=360716&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARC/Disassembler/ARCDisassembler.cpp (original)
+++ llvm/trunk/lib/Target/ARC/Disassembler/ARCDisassembler.cpp Tue May 14 15:06:04 2019
@@ -14,6 +14,7 @@
#include "ARC.h"
#include "ARCRegisterInfo.h"
#include "MCTargetDesc/ARCMCTargetDesc.h"
+#include "TargetInfo/ARCTargetInfo.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCDisassembler/MCDisassembler.h"
#include "llvm/MC/MCFixedLenDisassembler.h"
Modified: llvm/trunk/lib/Target/ARC/MCTargetDesc/ARCMCTargetDesc.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARC/MCTargetDesc/ARCMCTargetDesc.cpp?rev=360716&r1=360715&r2=360716&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARC/MCTargetDesc/ARCMCTargetDesc.cpp (original)
+++ llvm/trunk/lib/Target/ARC/MCTargetDesc/ARCMCTargetDesc.cpp Tue May 14 15:06:04 2019
@@ -14,6 +14,7 @@
#include "ARCInstPrinter.h"
#include "ARCMCAsmInfo.h"
#include "ARCTargetStreamer.h"
+#include "TargetInfo/ARCTargetInfo.h"
#include "llvm/MC/MCDwarf.h"
#include "llvm/MC/MCInstrInfo.h"
#include "llvm/MC/MCRegisterInfo.h"
Modified: llvm/trunk/lib/Target/ARC/MCTargetDesc/ARCMCTargetDesc.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARC/MCTargetDesc/ARCMCTargetDesc.h?rev=360716&r1=360715&r2=360716&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARC/MCTargetDesc/ARCMCTargetDesc.h (original)
+++ llvm/trunk/lib/Target/ARC/MCTargetDesc/ARCMCTargetDesc.h Tue May 14 15:06:04 2019
@@ -19,8 +19,6 @@ namespace llvm {
class Target;
-Target &getTheARCTarget();
-
} // end namespace llvm
// Defines symbolic names for ARC registers. This defines a mapping from
Modified: llvm/trunk/lib/Target/ARC/TargetInfo/ARCTargetInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARC/TargetInfo/ARCTargetInfo.cpp?rev=360716&r1=360715&r2=360716&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARC/TargetInfo/ARCTargetInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARC/TargetInfo/ARCTargetInfo.cpp Tue May 14 15:06:04 2019
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "ARC.h"
+#include "TargetInfo/ARCTargetInfo.h"
#include "llvm/Support/TargetRegistry.h"
using namespace llvm;
Copied: llvm/trunk/lib/Target/ARC/TargetInfo/ARCTargetInfo.h (from r360713, llvm/trunk/lib/Target/ARC/TargetInfo/ARCTargetInfo.cpp)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARC/TargetInfo/ARCTargetInfo.h?p2=llvm/trunk/lib/Target/ARC/TargetInfo/ARCTargetInfo.h&p1=llvm/trunk/lib/Target/ARC/TargetInfo/ARCTargetInfo.cpp&r1=360713&r2=360716&rev=360716&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARC/TargetInfo/ARCTargetInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARC/TargetInfo/ARCTargetInfo.h Tue May 14 15:06:04 2019
@@ -1,4 +1,4 @@
-//===- ARCTargetInfo.cpp - ARC Target Implementation ----------- *- C++ -*-===//
+//===- ARCTargetInfo.h - ARC 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,16 +6,15 @@
//
//===----------------------------------------------------------------------===//
-#include "ARC.h"
-#include "llvm/Support/TargetRegistry.h"
+#ifndef LLVM_LIB_TARGET_ARC_TARGETINFO_ARCTARGETINFO_H
+#define LLVM_LIB_TARGET_ARC_TARGETINFO_ARCTARGETINFO_H
-using namespace llvm;
+namespace llvm {
-Target &llvm::getTheARCTarget() {
- static Target TheARCTarget;
- return TheARCTarget;
-}
-
-extern "C" void LLVMInitializeARCTargetInfo() {
- RegisterTarget<Triple::arc> X(getTheARCTarget(), "arc", "ARC", "ARC");
-}
+class Target;
+
+Target &getTheARCTarget();
+
+} // namespace llvm
+
+#endif // LLVM_LIB_TARGET_ARC_TARGETINFO_ARCTARGETINFO_H
More information about the llvm-commits
mailing list