diff --git a/lib/Target/ARM64/ARM64.h b/lib/Target/ARM64/ARM64.h index f2c5e609986..debb9002eb4 100644 --- a/lib/Target/ARM64/ARM64.h +++ b/lib/Target/ARM64/ARM64.h @@ -15,7 +15,7 @@ #ifndef TARGET_ARM64_H #define TARGET_ARM64_H -#include "MCTargetDesc/ARM64BaseInfo.h" +#include "Utils/ARM64BaseInfo.h" #include "MCTargetDesc/ARM64MCTargetDesc.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Support/DataTypes.h" diff --git a/lib/Target/ARM64/ARM64MCInstLower.cpp b/lib/Target/ARM64/ARM64MCInstLower.cpp index 01dc22903d1..525f484ca4c 100644 --- a/lib/Target/ARM64/ARM64MCInstLower.cpp +++ b/lib/Target/ARM64/ARM64MCInstLower.cpp @@ -13,8 +13,8 @@ //===----------------------------------------------------------------------===// #include "ARM64MCInstLower.h" -#include "MCTargetDesc/ARM64BaseInfo.h" #include "MCTargetDesc/ARM64MCExpr.h" +#include "Utils/ARM64BaseInfo.h" #include "llvm/CodeGen/AsmPrinter.h" #include "llvm/CodeGen/MachineBasicBlock.h" #include "llvm/CodeGen/MachineInstr.h" diff --git a/lib/Target/ARM64/AsmParser/ARM64AsmParser.cpp b/lib/Target/ARM64/AsmParser/ARM64AsmParser.cpp index 524dd12e280..96abadea8a3 100644 --- a/lib/Target/ARM64/AsmParser/ARM64AsmParser.cpp +++ b/lib/Target/ARM64/AsmParser/ARM64AsmParser.cpp @@ -8,8 +8,8 @@ //===----------------------------------------------------------------------===// #include "MCTargetDesc/ARM64AddressingModes.h" -#include "MCTargetDesc/ARM64BaseInfo.h" #include "MCTargetDesc/ARM64MCExpr.h" +#include "Utils/ARM64BaseInfo.h" #include "llvm/MC/MCParser/MCAsmLexer.h" #include "llvm/MC/MCParser/MCAsmParser.h" #include "llvm/MC/MCParser/MCParsedAsmOperand.h" diff --git a/lib/Target/ARM64/CMakeLists.txt b/lib/Target/ARM64/CMakeLists.txt index 6de861cc76c..56ba3b73294 100644 --- a/lib/Target/ARM64/CMakeLists.txt +++ b/lib/Target/ARM64/CMakeLists.txt @@ -48,3 +48,4 @@ add_subdirectory(AsmParser) add_subdirectory(Disassembler) add_subdirectory(InstPrinter) add_subdirectory(MCTargetDesc) +add_subdirectory(Utils) diff --git a/lib/Target/ARM64/Disassembler/ARM64Disassembler.cpp b/lib/Target/ARM64/Disassembler/ARM64Disassembler.cpp index 225c06f9aee..35aa804ccd6 100644 --- a/lib/Target/ARM64/Disassembler/ARM64Disassembler.cpp +++ b/lib/Target/ARM64/Disassembler/ARM64Disassembler.cpp @@ -14,8 +14,8 @@ #include "ARM64Disassembler.h" #include "ARM64Subtarget.h" -#include "MCTargetDesc/ARM64BaseInfo.h" #include "MCTargetDesc/ARM64AddressingModes.h" +#include "Utils/ARM64BaseInfo.h" #include "llvm/MC/MCInst.h" #include "llvm/MC/MCExpr.h" #include "llvm/MC/MCContext.h" diff --git a/lib/Target/ARM64/Disassembler/LLVMBuild.txt b/lib/Target/ARM64/Disassembler/LLVMBuild.txt index 5935ee670d4..293e1be58a7 100644 --- a/lib/Target/ARM64/Disassembler/LLVMBuild.txt +++ b/lib/Target/ARM64/Disassembler/LLVMBuild.txt @@ -19,6 +19,6 @@ type = Library name = ARM64Disassembler parent = ARM64 -required_libraries = ARM64Desc ARM64Info MC Support +required_libraries = ARM64Desc ARM64Info ARM64Utils MC Support add_to_library_groups = ARM64 diff --git a/lib/Target/ARM64/InstPrinter/ARM64InstPrinter.cpp b/lib/Target/ARM64/InstPrinter/ARM64InstPrinter.cpp index bb9070798a8..38baf36beb4 100644 --- a/lib/Target/ARM64/InstPrinter/ARM64InstPrinter.cpp +++ b/lib/Target/ARM64/InstPrinter/ARM64InstPrinter.cpp @@ -14,7 +14,7 @@ #define DEBUG_TYPE "asm-printer" #include "ARM64InstPrinter.h" #include "MCTargetDesc/ARM64AddressingModes.h" -#include "MCTargetDesc/ARM64BaseInfo.h" +#include "Utils/ARM64BaseInfo.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/StringExtras.h" #include "llvm/MC/MCInst.h" diff --git a/lib/Target/ARM64/InstPrinter/LLVMBuild.txt b/lib/Target/ARM64/InstPrinter/LLVMBuild.txt index 2ec83d2f8d3..7ab43924921 100644 --- a/lib/Target/ARM64/InstPrinter/LLVMBuild.txt +++ b/lib/Target/ARM64/InstPrinter/LLVMBuild.txt @@ -19,6 +19,6 @@ type = Library name = ARM64AsmPrinter parent = ARM64 -required_libraries = MC Support +required_libraries = ARM64Utils MC Support add_to_library_groups = ARM64 diff --git a/lib/Target/ARM64/LLVMBuild.txt b/lib/Target/ARM64/LLVMBuild.txt index 45b0628f22b..0f4f8655cba 100644 --- a/lib/Target/ARM64/LLVMBuild.txt +++ b/lib/Target/ARM64/LLVMBuild.txt @@ -16,7 +16,7 @@ ;===------------------------------------------------------------------------===; [common] -subdirectories = AsmParser Disassembler InstPrinter MCTargetDesc TargetInfo +subdirectories = AsmParser Disassembler InstPrinter MCTargetDesc TargetInfo Utils [component_0] type = TargetGroup @@ -31,6 +31,6 @@ has_jit = 1 type = Library name = ARM64CodeGen parent = ARM64 -required_libraries = ARM64AsmPrinter ARM64Desc ARM64Info Analysis AsmPrinter CodeGen Core MC SelectionDAG Support Target +required_libraries = ARM64AsmPrinter ARM64Desc ARM64Info ARM64Utils Analysis AsmPrinter CodeGen Core MC SelectionDAG Support Target add_to_library_groups = ARM64 diff --git a/lib/Target/ARM64/MCTargetDesc/ARM64MCCodeEmitter.cpp b/lib/Target/ARM64/MCTargetDesc/ARM64MCCodeEmitter.cpp index 19559f87543..ce96d8e3833 100644 --- a/lib/Target/ARM64/MCTargetDesc/ARM64MCCodeEmitter.cpp +++ b/lib/Target/ARM64/MCTargetDesc/ARM64MCCodeEmitter.cpp @@ -13,9 +13,9 @@ #define DEBUG_TYPE "mccodeemitter" #include "MCTargetDesc/ARM64AddressingModes.h" -#include "MCTargetDesc/ARM64BaseInfo.h" #include "MCTargetDesc/ARM64FixupKinds.h" #include "MCTargetDesc/ARM64MCExpr.h" +#include "Utils/ARM64BaseInfo.h" #include "llvm/MC/MCCodeEmitter.h" #include "llvm/MC/MCContext.h" #include "llvm/MC/MCInst.h" diff --git a/lib/Target/ARM64/MCTargetDesc/CMakeLists.txt b/lib/Target/ARM64/MCTargetDesc/CMakeLists.txt index 9b9cf471f29..f8665bcfe94 100644 --- a/lib/Target/ARM64/MCTargetDesc/CMakeLists.txt +++ b/lib/Target/ARM64/MCTargetDesc/CMakeLists.txt @@ -1,6 +1,5 @@ add_llvm_library(LLVMARM64Desc ARM64AsmBackend.cpp - ARM64BaseInfo.cpp ARM64ELFObjectWriter.cpp ARM64ELFStreamer.cpp ARM64MCAsmInfo.cpp diff --git a/lib/Target/ARM64/Makefile b/lib/Target/ARM64/Makefile index 5f0f3071ba0..cfb05d2a87b 100644 --- a/lib/Target/ARM64/Makefile +++ b/lib/Target/ARM64/Makefile @@ -20,6 +20,6 @@ BUILT_SOURCES = ARM64GenRegisterInfo.inc ARM64GenInstrInfo.inc \ ARM64GenFastISel.inc ARM64GenDisassemblerTables.inc \ ARM64GenMCPseudoLowering.inc -DIRS = TargetInfo InstPrinter AsmParser Disassembler MCTargetDesc +DIRS = TargetInfo InstPrinter AsmParser Disassembler MCTargetDesc Utils include $(LEVEL)/Makefile.common diff --git a/lib/Target/ARM64/MCTargetDesc/ARM64BaseInfo.cpp b/lib/Target/ARM64/Utils/ARM64BaseInfo.cpp similarity index 100% rename from lib/Target/ARM64/MCTargetDesc/ARM64BaseInfo.cpp rename to lib/Target/ARM64/Utils/ARM64BaseInfo.cpp diff --git a/lib/Target/ARM64/MCTargetDesc/ARM64BaseInfo.h b/lib/Target/ARM64/Utils/ARM64BaseInfo.h similarity index 99% rename from lib/Target/ARM64/MCTargetDesc/ARM64BaseInfo.h rename to lib/Target/ARM64/Utils/ARM64BaseInfo.h index f7d841915eb..27cab2ea26d 100644 --- a/lib/Target/ARM64/MCTargetDesc/ARM64BaseInfo.h +++ b/lib/Target/ARM64/Utils/ARM64BaseInfo.h @@ -17,7 +17,9 @@ #ifndef ARM64BASEINFO_H #define ARM64BASEINFO_H -#include "ARM64MCTargetDesc.h" +// FIXME: Is it easiest to fix this layering violation by moving the .inc +// #includes from ARM64MCTargetDesc.h to here? +#include "MCTargetDesc/ARM64MCTargetDesc.h" // For ARM64::X0 and friends. #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/StringSwitch.h" #include "llvm/Support/ErrorHandling.h" diff --git a/lib/Target/ARM64/Utils/CMakeLists.txt b/lib/Target/ARM64/Utils/CMakeLists.txt new file mode 100644 index 00000000000..f69076f4ef6 --- /dev/null +++ b/lib/Target/ARM64/Utils/CMakeLists.txt @@ -0,0 +1,3 @@ +add_llvm_library(LLVMARM64Utils + ARM64BaseInfo.cpp + ) diff --git a/lib/Target/ARM64/Utils/LLVMBuild.txt b/lib/Target/ARM64/Utils/LLVMBuild.txt new file mode 100644 index 00000000000..232dca29f40 --- /dev/null +++ b/lib/Target/ARM64/Utils/LLVMBuild.txt @@ -0,0 +1,23 @@ +;===- ./lib/Target/ARM64/Utils/LLVMBuild.txt ----------------*- Conf -*--===; +; +; The LLVM Compiler Infrastructure +; +; This file is distributed under the University of Illinois Open Source +; License. See LICENSE.TXT for details. +; +;===------------------------------------------------------------------------===; +; +; 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 = ARM64Utils +parent = ARM64 +required_libraries = Support +add_to_library_groups = ARM64 diff --git a/lib/Target/ARM64/Utils/Makefile b/lib/Target/ARM64/Utils/Makefile new file mode 100644 index 00000000000..4bae80b37e1 --- /dev/null +++ b/lib/Target/ARM64/Utils/Makefile @@ -0,0 +1,15 @@ +##===- lib/Target/ARM64/Utils/Makefile -------------------*- Makefile -*-===## +# +# The LLVM Compiler Infrastructure +# +# This file is distributed under the University of Illinois Open Source +# License. See LICENSE.TXT for details. +# +##===----------------------------------------------------------------------===## +LEVEL = ../../../.. +LIBRARYNAME = LLVMARM64Utils + +# Hack: we need to include 'main' ARM64 target directory to grab private headers +#CPP.Flags += -I$(PROJ_OBJ_DIR)/.. -I$(PROJ_SRC_DIR)/.. + +include $(LEVEL)/Makefile.common