[PATCH] D60169: Proposed refactoring for lib/Target/X86 to remove layering issue

Richard Trieu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 2 18:22:57 PDT 2019


rtrieu created this revision.

Several of the targets in lib/Target have layering issues.  Specifically, headers from MCTargetDesc are used when MCTargetDesc is not a dependency.  This patch shows the cleanup required for X86 to be fixed of this issue.  X86BaseInfo.h is moved to Utils directory, and several enums are moved from X86MCTargetDesc.h into it.  This allows InstPrinter to use it without causing a dependency cycle.

The expected dependency list is:
TargetInfo, Utils
InstPrinter
MCTargetDesc
Base Directory, AsmParser, Disassembler

If this is acceptable for X86, I plan on fixing the other targets in a similar manner.


https://reviews.llvm.org/D60169

Files:
  lib/Target/X86/AsmParser/X86AsmParser.cpp
  lib/Target/X86/Disassembler/X86Disassembler.cpp
  lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp
  lib/Target/X86/InstPrinter/X86InstComments.cpp
  lib/Target/X86/InstPrinter/X86InstPrinterCommon.cpp
  lib/Target/X86/InstPrinter/X86IntelInstPrinter.cpp
  lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp
  lib/Target/X86/MCTargetDesc/X86BaseInfo.h
  lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp
  lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp
  lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h
  lib/Target/X86/TargetInfo/X86TargetInfo.cpp
  lib/Target/X86/Utils/X86BaseInfo.h
  lib/Target/X86/X86AsmPrinter.cpp
  lib/Target/X86/X86CallFrameOptimization.cpp
  lib/Target/X86/X86EvexToVex.cpp
  lib/Target/X86/X86FixupBWInsts.cpp
  lib/Target/X86/X86FixupLEAs.cpp
  lib/Target/X86/X86FrameLowering.cpp
  lib/Target/X86/X86InstrInfo.h
  lib/Target/X86/X86InstructionSelector.cpp
  lib/Target/X86/X86MCInstLower.cpp
  lib/Target/X86/X86OptimizeLEAs.cpp
  lib/Target/X86/X86RegisterInfo.cpp
  lib/Target/X86/X86Subtarget.cpp
  tools/llvm-exegesis/lib/X86/Target.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60169.193405.patch
Type: text/x-patch
Size: 47339 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190403/8fbef315/attachment.bin>


More information about the llvm-commits mailing list