[llvm] r360721 - [AVR] Create a TargetInfo header. NFC
Richard Trieu via llvm-commits
llvm-commits at lists.llvm.org
Tue May 14 15:41:58 PDT 2019
Author: rtrieu
Date: Tue May 14 15:41:58 2019
New Revision: 360721
URL: http://llvm.org/viewvc/llvm-project?rev=360721&view=rev
Log:
[AVR] 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/AVR/TargetInfo/AVRTargetInfo.h
- copied, changed from r360718, llvm/trunk/lib/Target/AVR/TargetInfo/AVRTargetInfo.cpp
Modified:
llvm/trunk/lib/Target/AVR/AVRAsmPrinter.cpp
llvm/trunk/lib/Target/AVR/AVRTargetMachine.cpp
llvm/trunk/lib/Target/AVR/AsmParser/AVRAsmParser.cpp
llvm/trunk/lib/Target/AVR/Disassembler/AVRDisassembler.cpp
llvm/trunk/lib/Target/AVR/MCTargetDesc/AVRMCTargetDesc.cpp
llvm/trunk/lib/Target/AVR/MCTargetDesc/AVRMCTargetDesc.h
llvm/trunk/lib/Target/AVR/TargetInfo/AVRTargetInfo.cpp
Modified: llvm/trunk/lib/Target/AVR/AVRAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AVR/AVRAsmPrinter.cpp?rev=360721&r1=360720&r2=360721&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AVR/AVRAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/AVR/AVRAsmPrinter.cpp Tue May 14 15:41:58 2019
@@ -15,6 +15,7 @@
#include "AVRMCInstLower.h"
#include "AVRSubtarget.h"
#include "MCTargetDesc/AVRInstPrinter.h"
+#include "TargetInfo/AVRTargetInfo.h"
#include "llvm/CodeGen/AsmPrinter.h"
#include "llvm/CodeGen/MachineFunction.h"
Modified: llvm/trunk/lib/Target/AVR/AVRTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AVR/AVRTargetMachine.cpp?rev=360721&r1=360720&r2=360721&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AVR/AVRTargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/AVR/AVRTargetMachine.cpp Tue May 14 15:41:58 2019
@@ -21,6 +21,7 @@
#include "AVR.h"
#include "AVRTargetObjectFile.h"
#include "MCTargetDesc/AVRMCTargetDesc.h"
+#include "TargetInfo/AVRTargetInfo.h"
namespace llvm {
Modified: llvm/trunk/lib/Target/AVR/AsmParser/AVRAsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AVR/AsmParser/AVRAsmParser.cpp?rev=360721&r1=360720&r2=360721&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AVR/AsmParser/AVRAsmParser.cpp (original)
+++ llvm/trunk/lib/Target/AVR/AsmParser/AVRAsmParser.cpp Tue May 14 15:41:58 2019
@@ -11,6 +11,7 @@
#include "MCTargetDesc/AVRMCELFStreamer.h"
#include "MCTargetDesc/AVRMCExpr.h"
#include "MCTargetDesc/AVRMCTargetDesc.h"
+#include "TargetInfo/AVRTargetInfo.h"
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/StringSwitch.h"
Modified: llvm/trunk/lib/Target/AVR/Disassembler/AVRDisassembler.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AVR/Disassembler/AVRDisassembler.cpp?rev=360721&r1=360720&r2=360721&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AVR/Disassembler/AVRDisassembler.cpp (original)
+++ llvm/trunk/lib/Target/AVR/Disassembler/AVRDisassembler.cpp Tue May 14 15:41:58 2019
@@ -14,6 +14,7 @@
#include "AVRRegisterInfo.h"
#include "AVRSubtarget.h"
#include "MCTargetDesc/AVRMCTargetDesc.h"
+#include "TargetInfo/AVRTargetInfo.h"
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCContext.h"
Modified: llvm/trunk/lib/Target/AVR/MCTargetDesc/AVRMCTargetDesc.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AVR/MCTargetDesc/AVRMCTargetDesc.cpp?rev=360721&r1=360720&r2=360721&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AVR/MCTargetDesc/AVRMCTargetDesc.cpp (original)
+++ llvm/trunk/lib/Target/AVR/MCTargetDesc/AVRMCTargetDesc.cpp Tue May 14 15:41:58 2019
@@ -16,6 +16,7 @@
#include "AVRMCELFStreamer.h"
#include "AVRMCTargetDesc.h"
#include "AVRTargetStreamer.h"
+#include "TargetInfo/AVRTargetInfo.h"
#include "llvm/MC/MCAsmBackend.h"
#include "llvm/MC/MCELFStreamer.h"
Modified: llvm/trunk/lib/Target/AVR/MCTargetDesc/AVRMCTargetDesc.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AVR/MCTargetDesc/AVRMCTargetDesc.h?rev=360721&r1=360720&r2=360721&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AVR/MCTargetDesc/AVRMCTargetDesc.h (original)
+++ llvm/trunk/lib/Target/AVR/MCTargetDesc/AVRMCTargetDesc.h Tue May 14 15:41:58 2019
@@ -32,8 +32,6 @@ class Target;
class Triple;
class raw_pwrite_stream;
-Target &getTheAVRTarget();
-
MCInstrInfo *createAVRMCInstrInfo();
/// Creates a machine code emitter for AVR.
Modified: llvm/trunk/lib/Target/AVR/TargetInfo/AVRTargetInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AVR/TargetInfo/AVRTargetInfo.cpp?rev=360721&r1=360720&r2=360721&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AVR/TargetInfo/AVRTargetInfo.cpp (original)
+++ llvm/trunk/lib/Target/AVR/TargetInfo/AVRTargetInfo.cpp Tue May 14 15:41:58 2019
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "llvm/IR/Module.h"
+#include "TargetInfo/AVRTargetInfo.h"
#include "llvm/Support/TargetRegistry.h"
namespace llvm {
Target &getTheAVRTarget() {
Copied: llvm/trunk/lib/Target/AVR/TargetInfo/AVRTargetInfo.h (from r360718, llvm/trunk/lib/Target/AVR/TargetInfo/AVRTargetInfo.cpp)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AVR/TargetInfo/AVRTargetInfo.h?p2=llvm/trunk/lib/Target/AVR/TargetInfo/AVRTargetInfo.h&p1=llvm/trunk/lib/Target/AVR/TargetInfo/AVRTargetInfo.cpp&r1=360718&r2=360721&rev=360721&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AVR/TargetInfo/AVRTargetInfo.cpp (original)
+++ llvm/trunk/lib/Target/AVR/TargetInfo/AVRTargetInfo.h Tue May 14 15:41:58 2019
@@ -1,4 +1,4 @@
-//===-- AVRTargetInfo.cpp - AVR Target Implementation ---------------------===//
+//===-- AVRTargetInfo.h - AVR 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,17 +6,13 @@
//
//===----------------------------------------------------------------------===//
-#include "llvm/IR/Module.h"
-#include "llvm/Support/TargetRegistry.h"
+#ifndef LLVM_AVR_TARGET_INFO_H
+#define LLVM_AVR_TARGET_INFO_H
+
namespace llvm {
-Target &getTheAVRTarget() {
- static Target TheAVRTarget;
- return TheAVRTarget;
-}
-}
+class Target;
-extern "C" void LLVMInitializeAVRTargetInfo() {
- llvm::RegisterTarget<llvm::Triple::avr> X(llvm::getTheAVRTarget(), "avr",
- "Atmel AVR Microcontroller", "AVR");
-}
+Target &getTheAVRTarget();
+} // namespace llvm
+#endif // LLVM_AVR_TARGET_INFO_H
More information about the llvm-commits
mailing list