From b28b8b7724ef03cadae3e6ac8eda3f6be7f7ffe6 Mon Sep 17 00:00:00 2001 From: Richard Trieu Date: Fri, 10 May 2019 23:24:38 +0000 Subject: [PATCH] [X86] Move InstPrinter files to MCTargetDesc. NFC For some targets, there is a circular dependency between InstPrinter and MCTargetDesc. Merging them together will fix this. For the other targets, the merging is to maintain consistency so all targets will have the same structure. llvm-svn: 360484 --- llvm/lib/Target/X86/AsmParser/LLVMBuild.txt | 2 +- .../lib/Target/X86/AsmParser/X86AsmParser.cpp | 2 +- llvm/lib/Target/X86/AsmParser/X86Operand.h | 2 +- llvm/lib/Target/X86/CMakeLists.txt | 1 - .../lib/Target/X86/InstPrinter/CMakeLists.txt | 6 ----- llvm/lib/Target/X86/InstPrinter/LLVMBuild.txt | 22 ------------------- llvm/lib/Target/X86/LLVMBuild.txt | 4 ++-- .../Target/X86/MCTargetDesc/CMakeLists.txt | 4 ++++ .../lib/Target/X86/MCTargetDesc/LLVMBuild.txt | 2 +- .../X86ATTInstPrinter.cpp | 2 +- .../X86ATTInstPrinter.h | 6 ++--- .../X86InstComments.cpp | 4 ++-- .../X86InstComments.h | 4 ++-- .../X86InstPrinterCommon.cpp | 2 +- .../X86InstPrinterCommon.h | 6 ++--- .../X86IntelInstPrinter.cpp | 2 +- .../X86IntelInstPrinter.h | 6 ++--- llvm/lib/Target/X86/MCTargetDesc/X86MCExpr.h | 2 +- .../X86/MCTargetDesc/X86MCTargetDesc.cpp | 4 ++-- llvm/lib/Target/X86/X86AsmPrinter.cpp | 2 +- llvm/lib/Target/X86/X86EvexToVex.cpp | 2 +- llvm/lib/Target/X86/X86MCInstLower.cpp | 4 ++-- 22 files changed, 33 insertions(+), 58 deletions(-) delete mode 100644 llvm/lib/Target/X86/InstPrinter/CMakeLists.txt delete mode 100644 llvm/lib/Target/X86/InstPrinter/LLVMBuild.txt rename llvm/lib/Target/X86/{InstPrinter => MCTargetDesc}/X86ATTInstPrinter.cpp (99%) rename llvm/lib/Target/X86/{InstPrinter => MCTargetDesc}/X86ATTInstPrinter.h (96%) rename llvm/lib/Target/X86/{InstPrinter => MCTargetDesc}/X86InstComments.cpp (99%) rename llvm/lib/Target/X86/{InstPrinter => MCTargetDesc}/X86InstComments.h (86%) rename llvm/lib/Target/X86/{InstPrinter => MCTargetDesc}/X86InstPrinterCommon.cpp (99%) rename llvm/lib/Target/X86/{InstPrinter => MCTargetDesc}/X86InstPrinterCommon.h (88%) rename llvm/lib/Target/X86/{InstPrinter => MCTargetDesc}/X86IntelInstPrinter.cpp (99%) rename llvm/lib/Target/X86/{InstPrinter => MCTargetDesc}/X86IntelInstPrinter.h (96%) diff --git a/llvm/lib/Target/X86/AsmParser/LLVMBuild.txt b/llvm/lib/Target/X86/AsmParser/LLVMBuild.txt index e80d48cb54a0..8a7fb5b717be 100644 --- a/llvm/lib/Target/X86/AsmParser/LLVMBuild.txt +++ b/llvm/lib/Target/X86/AsmParser/LLVMBuild.txt @@ -18,5 +18,5 @@ type = Library name = X86AsmParser parent = X86 -required_libraries = MC MCParser Support X86Desc X86Info X86AsmPrinter +required_libraries = MC MCParser Support X86Desc X86Info add_to_library_groups = X86 diff --git a/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp b/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp index 30411a232ef3..52f2e08f687f 100644 --- a/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp +++ b/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp @@ -6,8 +6,8 @@ // //===----------------------------------------------------------------------===// -#include "InstPrinter/X86IntelInstPrinter.h" #include "MCTargetDesc/X86BaseInfo.h" +#include "MCTargetDesc/X86IntelInstPrinter.h" #include "MCTargetDesc/X86MCExpr.h" #include "MCTargetDesc/X86TargetStreamer.h" #include "X86AsmParserCommon.h" diff --git a/llvm/lib/Target/X86/AsmParser/X86Operand.h b/llvm/lib/Target/X86/AsmParser/X86Operand.h index 0f489e444974..24715f7070d2 100644 --- a/llvm/lib/Target/X86/AsmParser/X86Operand.h +++ b/llvm/lib/Target/X86/AsmParser/X86Operand.h @@ -9,7 +9,7 @@ #ifndef LLVM_LIB_TARGET_X86_ASMPARSER_X86OPERAND_H #define LLVM_LIB_TARGET_X86_ASMPARSER_X86OPERAND_H -#include "InstPrinter/X86IntelInstPrinter.h" +#include "MCTargetDesc/X86IntelInstPrinter.h" #include "MCTargetDesc/X86MCTargetDesc.h" #include "X86AsmParserCommon.h" #include "llvm/ADT/STLExtras.h" diff --git a/llvm/lib/Target/X86/CMakeLists.txt b/llvm/lib/Target/X86/CMakeLists.txt index c76c711e616d..ed34a59df4ad 100644 --- a/llvm/lib/Target/X86/CMakeLists.txt +++ b/llvm/lib/Target/X86/CMakeLists.txt @@ -74,7 +74,6 @@ add_llvm_target(X86CodeGen ${sources}) add_subdirectory(AsmParser) add_subdirectory(Disassembler) -add_subdirectory(InstPrinter) add_subdirectory(MCTargetDesc) add_subdirectory(TargetInfo) add_subdirectory(Utils) diff --git a/llvm/lib/Target/X86/InstPrinter/CMakeLists.txt b/llvm/lib/Target/X86/InstPrinter/CMakeLists.txt deleted file mode 100644 index a61efaed33a5..000000000000 --- a/llvm/lib/Target/X86/InstPrinter/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -add_llvm_library(LLVMX86AsmPrinter - X86ATTInstPrinter.cpp - X86IntelInstPrinter.cpp - X86InstComments.cpp - X86InstPrinterCommon.cpp - ) diff --git a/llvm/lib/Target/X86/InstPrinter/LLVMBuild.txt b/llvm/lib/Target/X86/InstPrinter/LLVMBuild.txt deleted file mode 100644 index 48676d4893a7..000000000000 --- a/llvm/lib/Target/X86/InstPrinter/LLVMBuild.txt +++ /dev/null @@ -1,22 +0,0 @@ -;===- ./lib/Target/X86/InstPrinter/LLVMBuild.txt ---------------*- Conf -*--===; -; -; 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 -; -;===------------------------------------------------------------------------===; -; -; This is an LLVMBuild description file for the components in this subdirectory. -; -; For more information on the LLVMBuild system, please see: -; -; http://llvm.org/docs/LLVMBuild.html -; -;===------------------------------------------------------------------------===; - -[component_0] -type = Library -name = X86AsmPrinter -parent = X86 -required_libraries = MC Support X86Utils -add_to_library_groups = X86 diff --git a/llvm/lib/Target/X86/LLVMBuild.txt b/llvm/lib/Target/X86/LLVMBuild.txt index f65dde68db0e..bfc0eda21faf 100644 --- a/llvm/lib/Target/X86/LLVMBuild.txt +++ b/llvm/lib/Target/X86/LLVMBuild.txt @@ -15,7 +15,7 @@ ;===------------------------------------------------------------------------===; [common] -subdirectories = AsmParser Disassembler InstPrinter MCTargetDesc TargetInfo Utils +subdirectories = AsmParser Disassembler MCTargetDesc TargetInfo Utils [component_0] type = TargetGroup @@ -30,5 +30,5 @@ has_jit = 1 type = Library name = X86CodeGen parent = X86 -required_libraries = Analysis AsmPrinter CodeGen Core MC SelectionDAG Support Target X86AsmPrinter X86Desc X86Info X86Utils GlobalISel ProfileData +required_libraries = Analysis AsmPrinter CodeGen Core MC SelectionDAG Support Target X86Desc X86Info X86Utils GlobalISel ProfileData add_to_library_groups = X86 diff --git a/llvm/lib/Target/X86/MCTargetDesc/CMakeLists.txt b/llvm/lib/Target/X86/MCTargetDesc/CMakeLists.txt index 8d0d9fa1215c..18b6d0030ad6 100644 --- a/llvm/lib/Target/X86/MCTargetDesc/CMakeLists.txt +++ b/llvm/lib/Target/X86/MCTargetDesc/CMakeLists.txt @@ -1,4 +1,8 @@ add_llvm_library(LLVMX86Desc + X86ATTInstPrinter.cpp + X86IntelInstPrinter.cpp + X86InstComments.cpp + X86InstPrinterCommon.cpp X86AsmBackend.cpp X86MCTargetDesc.cpp X86MCAsmInfo.cpp diff --git a/llvm/lib/Target/X86/MCTargetDesc/LLVMBuild.txt b/llvm/lib/Target/X86/MCTargetDesc/LLVMBuild.txt index 7bcf75e89d7a..51548bd344bf 100644 --- a/llvm/lib/Target/X86/MCTargetDesc/LLVMBuild.txt +++ b/llvm/lib/Target/X86/MCTargetDesc/LLVMBuild.txt @@ -18,5 +18,5 @@ type = Library name = X86Desc parent = X86 -required_libraries = MC MCDisassembler Object Support X86AsmPrinter X86Info +required_libraries = MC MCDisassembler Object Support X86Info X86Utils add_to_library_groups = X86 diff --git a/llvm/lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp b/llvm/lib/Target/X86/MCTargetDesc/X86ATTInstPrinter.cpp similarity index 99% rename from llvm/lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp rename to llvm/lib/Target/X86/MCTargetDesc/X86ATTInstPrinter.cpp index ea36013681a0..ed2ee55ff2a5 100644 --- a/llvm/lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp +++ b/llvm/lib/Target/X86/MCTargetDesc/X86ATTInstPrinter.cpp @@ -12,7 +12,7 @@ //===----------------------------------------------------------------------===// #include "X86ATTInstPrinter.h" -#include "MCTargetDesc/X86BaseInfo.h" +#include "X86BaseInfo.h" #include "X86InstComments.h" #include "llvm/MC/MCExpr.h" #include "llvm/MC/MCInst.h" diff --git a/llvm/lib/Target/X86/InstPrinter/X86ATTInstPrinter.h b/llvm/lib/Target/X86/MCTargetDesc/X86ATTInstPrinter.h similarity index 96% rename from llvm/lib/Target/X86/InstPrinter/X86ATTInstPrinter.h rename to llvm/lib/Target/X86/MCTargetDesc/X86ATTInstPrinter.h index ff4e8babc570..747ddd30a2d9 100644 --- a/llvm/lib/Target/X86/InstPrinter/X86ATTInstPrinter.h +++ b/llvm/lib/Target/X86/MCTargetDesc/X86ATTInstPrinter.h @@ -10,8 +10,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_LIB_TARGET_X86_INSTPRINTER_X86ATTINSTPRINTER_H -#define LLVM_LIB_TARGET_X86_INSTPRINTER_X86ATTINSTPRINTER_H +#ifndef LLVM_LIB_TARGET_X86_MCTARGETDESC_X86ATTINSTPRINTER_H +#define LLVM_LIB_TARGET_X86_MCTARGETDESC_X86ATTINSTPRINTER_H #include "X86InstPrinterCommon.h" @@ -121,4 +121,4 @@ private: } // end namespace llvm -#endif // LLVM_LIB_TARGET_X86_INSTPRINTER_X86ATTINSTPRINTER_H +#endif // LLVM_LIB_TARGET_X86_MCTARGETDESC_X86ATTINSTPRINTER_H diff --git a/llvm/lib/Target/X86/InstPrinter/X86InstComments.cpp b/llvm/lib/Target/X86/MCTargetDesc/X86InstComments.cpp similarity index 99% rename from llvm/lib/Target/X86/InstPrinter/X86InstComments.cpp rename to llvm/lib/Target/X86/MCTargetDesc/X86InstComments.cpp index a6d07c1c5be8..b1af31067ae0 100644 --- a/llvm/lib/Target/X86/InstPrinter/X86InstComments.cpp +++ b/llvm/lib/Target/X86/MCTargetDesc/X86InstComments.cpp @@ -13,8 +13,8 @@ #include "X86InstComments.h" #include "X86ATTInstPrinter.h" -#include "MCTargetDesc/X86BaseInfo.h" -#include "MCTargetDesc/X86MCTargetDesc.h" +#include "X86BaseInfo.h" +#include "X86MCTargetDesc.h" #include "Utils/X86ShuffleDecode.h" #include "llvm/MC/MCInst.h" #include "llvm/MC/MCInstrInfo.h" diff --git a/llvm/lib/Target/X86/InstPrinter/X86InstComments.h b/llvm/lib/Target/X86/MCTargetDesc/X86InstComments.h similarity index 86% rename from llvm/lib/Target/X86/InstPrinter/X86InstComments.h rename to llvm/lib/Target/X86/MCTargetDesc/X86InstComments.h index 05f1683848a8..96760664012a 100644 --- a/llvm/lib/Target/X86/InstPrinter/X86InstComments.h +++ b/llvm/lib/Target/X86/MCTargetDesc/X86InstComments.h @@ -11,8 +11,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_LIB_TARGET_X86_INSTPRINTER_X86INSTCOMMENTS_H -#define LLVM_LIB_TARGET_X86_INSTPRINTER_X86INSTCOMMENTS_H +#ifndef LLVM_LIB_TARGET_X86_MCTARGETDESC_X86INSTCOMMENTS_H +#define LLVM_LIB_TARGET_X86_MCTARGETDESC_X86INSTCOMMENTS_H namespace llvm { diff --git a/llvm/lib/Target/X86/InstPrinter/X86InstPrinterCommon.cpp b/llvm/lib/Target/X86/MCTargetDesc/X86InstPrinterCommon.cpp similarity index 99% rename from llvm/lib/Target/X86/InstPrinter/X86InstPrinterCommon.cpp rename to llvm/lib/Target/X86/MCTargetDesc/X86InstPrinterCommon.cpp index 85d0675154ea..878ce590550b 100644 --- a/llvm/lib/Target/X86/InstPrinter/X86InstPrinterCommon.cpp +++ b/llvm/lib/Target/X86/MCTargetDesc/X86InstPrinterCommon.cpp @@ -12,7 +12,7 @@ //===----------------------------------------------------------------------===// #include "X86InstPrinterCommon.h" -#include "MCTargetDesc/X86BaseInfo.h" +#include "X86BaseInfo.h" #include "llvm/MC/MCExpr.h" #include "llvm/MC/MCInst.h" #include "llvm/MC/MCInstrDesc.h" diff --git a/llvm/lib/Target/X86/InstPrinter/X86InstPrinterCommon.h b/llvm/lib/Target/X86/MCTargetDesc/X86InstPrinterCommon.h similarity index 88% rename from llvm/lib/Target/X86/InstPrinter/X86InstPrinterCommon.h rename to llvm/lib/Target/X86/MCTargetDesc/X86InstPrinterCommon.h index c00d320a8f0d..03c761dbcb74 100644 --- a/llvm/lib/Target/X86/InstPrinter/X86InstPrinterCommon.h +++ b/llvm/lib/Target/X86/MCTargetDesc/X86InstPrinterCommon.h @@ -11,8 +11,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_LIB_TARGET_X86_INSTPRINTER_X86INSTPRINTERCOMMON_H -#define LLVM_LIB_TARGET_X86_INSTPRINTER_X86INSTPRINTERCOMMON_H +#ifndef LLVM_LIB_TARGET_X86_MCTARGETDESC_X86INSTPRINTERCOMMON_H +#define LLVM_LIB_TARGET_X86_MCTARGETDESC_X86INSTPRINTERCOMMON_H #include "llvm/MC/MCInstPrinter.h" @@ -37,4 +37,4 @@ protected: } // end namespace llvm -#endif // LLVM_LIB_TARGET_X86_INSTPRINTER_X86ATTINSTPRINTER_H +#endif // LLVM_LIB_TARGET_X86_MCTARGETDESC_X86ATTINSTPRINTER_H diff --git a/llvm/lib/Target/X86/InstPrinter/X86IntelInstPrinter.cpp b/llvm/lib/Target/X86/MCTargetDesc/X86IntelInstPrinter.cpp similarity index 99% rename from llvm/lib/Target/X86/InstPrinter/X86IntelInstPrinter.cpp rename to llvm/lib/Target/X86/MCTargetDesc/X86IntelInstPrinter.cpp index ba40e13f5928..ea28bef42569 100644 --- a/llvm/lib/Target/X86/InstPrinter/X86IntelInstPrinter.cpp +++ b/llvm/lib/Target/X86/MCTargetDesc/X86IntelInstPrinter.cpp @@ -12,7 +12,7 @@ //===----------------------------------------------------------------------===// #include "X86IntelInstPrinter.h" -#include "MCTargetDesc/X86BaseInfo.h" +#include "X86BaseInfo.h" #include "X86InstComments.h" #include "llvm/MC/MCExpr.h" #include "llvm/MC/MCInst.h" diff --git a/llvm/lib/Target/X86/InstPrinter/X86IntelInstPrinter.h b/llvm/lib/Target/X86/MCTargetDesc/X86IntelInstPrinter.h similarity index 96% rename from llvm/lib/Target/X86/InstPrinter/X86IntelInstPrinter.h rename to llvm/lib/Target/X86/MCTargetDesc/X86IntelInstPrinter.h index 1227bafffd06..f32f49f7c417 100644 --- a/llvm/lib/Target/X86/InstPrinter/X86IntelInstPrinter.h +++ b/llvm/lib/Target/X86/MCTargetDesc/X86IntelInstPrinter.h @@ -10,8 +10,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_LIB_TARGET_X86_INSTPRINTER_X86INTELINSTPRINTER_H -#define LLVM_LIB_TARGET_X86_INSTPRINTER_X86INTELINSTPRINTER_H +#ifndef LLVM_LIB_TARGET_X86_MCTARGETDESC_X86INTELINSTPRINTER_H +#define LLVM_LIB_TARGET_X86_MCTARGETDESC_X86INTELINSTPRINTER_H #include "X86InstPrinterCommon.h" #include "llvm/Support/raw_ostream.h" @@ -141,4 +141,4 @@ public: } // end namespace llvm -#endif // LLVM_LIB_TARGET_X86_INSTPRINTER_X86INTELINSTPRINTER_H +#endif // LLVM_LIB_TARGET_X86_MCTARGETDESC_X86INTELINSTPRINTER_H diff --git a/llvm/lib/Target/X86/MCTargetDesc/X86MCExpr.h b/llvm/lib/Target/X86/MCTargetDesc/X86MCExpr.h index cbda873e92ad..532fecd9951b 100644 --- a/llvm/lib/Target/X86/MCTargetDesc/X86MCExpr.h +++ b/llvm/lib/Target/X86/MCTargetDesc/X86MCExpr.h @@ -14,7 +14,7 @@ #ifndef LLVM_LIB_TARGET_X86_MCTARGETDESC_X86MCEXPR_H #define LLVM_LIB_TARGET_X86_MCTARGETDESC_X86MCEXPR_H -#include "InstPrinter/X86ATTInstPrinter.h" +#include "X86ATTInstPrinter.h" #include "llvm/MC/MCAsmInfo.h" #include "llvm/MC/MCContext.h" #include "llvm/MC/MCExpr.h" diff --git a/llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp b/llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp index 54d3c2555d1a..e6c698c23b35 100644 --- a/llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp +++ b/llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp @@ -11,9 +11,9 @@ //===----------------------------------------------------------------------===// #include "X86MCTargetDesc.h" -#include "InstPrinter/X86ATTInstPrinter.h" -#include "InstPrinter/X86IntelInstPrinter.h" +#include "X86ATTInstPrinter.h" #include "X86BaseInfo.h" +#include "X86IntelInstPrinter.h" #include "X86MCAsmInfo.h" #include "llvm/ADT/APInt.h" #include "llvm/ADT/Triple.h" diff --git a/llvm/lib/Target/X86/X86AsmPrinter.cpp b/llvm/lib/Target/X86/X86AsmPrinter.cpp index 114c09bc27f5..0c04f32fec18 100644 --- a/llvm/lib/Target/X86/X86AsmPrinter.cpp +++ b/llvm/lib/Target/X86/X86AsmPrinter.cpp @@ -12,7 +12,7 @@ //===----------------------------------------------------------------------===// #include "X86AsmPrinter.h" -#include "InstPrinter/X86ATTInstPrinter.h" +#include "MCTargetDesc/X86ATTInstPrinter.h" #include "MCTargetDesc/X86BaseInfo.h" #include "MCTargetDesc/X86TargetStreamer.h" #include "X86InstrInfo.h" diff --git a/llvm/lib/Target/X86/X86EvexToVex.cpp b/llvm/lib/Target/X86/X86EvexToVex.cpp index a7c5bab67f94..ec470889b6c9 100644 --- a/llvm/lib/Target/X86/X86EvexToVex.cpp +++ b/llvm/lib/Target/X86/X86EvexToVex.cpp @@ -19,8 +19,8 @@ // //===----------------------------------------------------------------------===// -#include "InstPrinter/X86InstComments.h" #include "MCTargetDesc/X86BaseInfo.h" +#include "MCTargetDesc/X86InstComments.h" #include "X86.h" #include "X86InstrInfo.h" #include "X86Subtarget.h" diff --git a/llvm/lib/Target/X86/X86MCInstLower.cpp b/llvm/lib/Target/X86/X86MCInstLower.cpp index 1c124dbb5570..17a5650b96bb 100644 --- a/llvm/lib/Target/X86/X86MCInstLower.cpp +++ b/llvm/lib/Target/X86/X86MCInstLower.cpp @@ -11,9 +11,9 @@ // //===----------------------------------------------------------------------===// -#include "InstPrinter/X86ATTInstPrinter.h" -#include "InstPrinter/X86InstComments.h" +#include "MCTargetDesc/X86ATTInstPrinter.h" #include "MCTargetDesc/X86BaseInfo.h" +#include "MCTargetDesc/X86InstComments.h" #include "MCTargetDesc/X86TargetStreamer.h" #include "Utils/X86ShuffleDecode.h" #include "X86AsmPrinter.h"