add_llvm_component_group(W65816)

set(LLVM_TARGET_DEFINITIONS W65816.td)

tablegen(LLVM W65816GenAsmMatcher.inc -gen-asm-matcher)
tablegen(LLVM W65816GenAsmWriter.inc -gen-asm-writer)
tablegen(LLVM W65816GenCallingConv.inc -gen-callingconv)
tablegen(LLVM W65816GenDAGISel.inc -gen-dag-isel)
tablegen(LLVM W65816GenDisassemblerTables.inc -gen-disassembler)
tablegen(LLVM W65816GenInstrInfo.inc -gen-instr-info)
tablegen(LLVM W65816GenMCCodeEmitter.inc -gen-emitter)
tablegen(LLVM W65816GenRegisterInfo.inc -gen-register-info)
tablegen(LLVM W65816GenSDNodeInfo.inc -gen-sd-node-info)
tablegen(LLVM W65816GenSubtargetInfo.inc -gen-subtarget)

add_public_tablegen_target(W65816CommonTableGen)

add_llvm_target(W65816CodeGen
  W65816ISelDAGToDAG.cpp
  W65816ISelLowering.cpp
  W65816InstrInfo.cpp
  W65816FrameLowering.cpp
  W65816MachineFunctionInfo.cpp
  W65816RegisterInfo.cpp
  W65816SelectionDAGInfo.cpp
  W65816Subtarget.cpp
  W65816StackSlotCleanup.cpp
  W65816SepRepCleanup.cpp
  W65816BranchExpand.cpp
  W65816TiedDefSpill.cpp
  W65816ABridgeViaX.cpp
  W65816WidenAcc16.cpp
  W65816SpillToX.cpp
  W65816NegYIndY.cpp
  W65816PreSpillCrossCall.cpp
  W65816SjLjFinalize.cpp
  W65816LowerWide32.cpp
  W65816I32IncFold.cpp
  W65816ImgCalleeSave.cpp
  W65816NarrowI32Mul.cpp
  W65816PromoteFiToImg.cpp
  W65816StackRelToImg.cpp
  W65816StackSlotMerge.cpp
  W65816Layer2Gate.cpp
  W65816TargetMachine.cpp
  W65816UnLSR.cpp
  W65816AsmPrinter.cpp
  W65816MCInstLower.cpp

  LINK_COMPONENTS
  AsmPrinter
  Analysis
  CodeGen
  CodeGenTypes
  Core
  MC
  SelectionDAG
  Support
  Target
  TargetParser
  W65816Desc
  W65816Info

  ADD_TO_COMPONENT
  W65816
  )

add_subdirectory(AsmParser)
add_subdirectory(Disassembler)
add_subdirectory(MCTargetDesc)
add_subdirectory(TargetInfo)
