[PATCH] D36241: Delete Default and JITDefault code models

Rafael Ávila de Espíndola via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 2 14:12:36 PDT 2017


rafael created this revision.
Herald added subscribers: fedor.sergeev, kbarton, eraman, javed.absar, nhaehnle, nemanjai, sdardis, mehdi_amini, jyknight, arsenm, MatzeB, jholewinski.

IMHO it is an antipattern to have a enum value that is Default.

At any given piece of code it is not clear if we have to handle Default or if has already been mapped to a concrete value. In this case in particular, only the target can do the mapping and it is nice to make sure it is always done.

This deletes the two default enum values of CodeModel and uses an explicit Optional<CodeModel> when it is possible that it is unspecified.


https://reviews.llvm.org/D36241

Files:
  include/llvm/CodeGen/CommandFlags.h
  include/llvm/ExecutionEngine/ExecutionEngine.h
  include/llvm/LTO/Config.h
  include/llvm/Support/CodeGen.h
  include/llvm/Support/CodeGenCWrappers.h
  include/llvm/Support/TargetRegistry.h
  include/llvm/Target/TargetMachine.h
  lib/CodeGen/LLVMTargetMachine.cpp
  lib/ExecutionEngine/ExecutionEngine.cpp
  lib/ExecutionEngine/ExecutionEngineBindings.cpp
  lib/ExecutionEngine/TargetSelect.cpp
  lib/LTO/LTO.cpp
  lib/LTO/LTOCodeGenerator.cpp
  lib/LTO/ThinLTOCodeGenerator.cpp
  lib/Target/AArch64/AArch64TargetMachine.cpp
  lib/Target/AArch64/AArch64TargetMachine.h
  lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.cpp
  lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
  lib/Target/AMDGPU/AMDGPUTargetMachine.h
  lib/Target/ARM/ARMFrameLowering.cpp
  lib/Target/ARM/ARMISelLowering.cpp
  lib/Target/ARM/ARMTargetMachine.cpp
  lib/Target/ARM/ARMTargetMachine.h
  lib/Target/BPF/BPFTargetMachine.cpp
  lib/Target/BPF/BPFTargetMachine.h
  lib/Target/Hexagon/HexagonTargetMachine.cpp
  lib/Target/Hexagon/HexagonTargetMachine.h
  lib/Target/Lanai/LanaiTargetMachine.cpp
  lib/Target/Lanai/LanaiTargetMachine.h
  lib/Target/MSP430/MSP430TargetMachine.cpp
  lib/Target/MSP430/MSP430TargetMachine.h
  lib/Target/Mips/MipsTargetMachine.cpp
  lib/Target/Mips/MipsTargetMachine.h
  lib/Target/NVPTX/NVPTXTargetMachine.cpp
  lib/Target/NVPTX/NVPTXTargetMachine.h
  lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp
  lib/Target/PowerPC/PPCFastISel.cpp
  lib/Target/PowerPC/PPCISelLowering.cpp
  lib/Target/PowerPC/PPCTargetMachine.cpp
  lib/Target/PowerPC/PPCTargetMachine.h
  lib/Target/RISCV/RISCVTargetMachine.cpp
  lib/Target/RISCV/RISCVTargetMachine.h
  lib/Target/Sparc/MCTargetDesc/SparcMCTargetDesc.cpp
  lib/Target/Sparc/SparcTargetMachine.cpp
  lib/Target/Sparc/SparcTargetMachine.h
  lib/Target/SystemZ/MCTargetDesc/SystemZMCTargetDesc.cpp
  lib/Target/SystemZ/SystemZTargetMachine.cpp
  lib/Target/SystemZ/SystemZTargetMachine.h
  lib/Target/TargetMachineC.cpp
  lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp
  lib/Target/X86/X86TargetMachine.cpp
  lib/Target/X86/X86TargetMachine.h
  lib/Target/XCore/MCTargetDesc/XCoreMCTargetDesc.cpp
  lib/Target/XCore/XCoreTargetMachine.cpp
  lib/Target/XCore/XCoreTargetMachine.h
  test/CodeGen/ARM/legalize-unaligned-load.ll
  test/CodeGen/XCore/codemodel.ll
  tools/llc/llc.cpp
  tools/lli/lli.cpp
  tools/llvm-lto2/llvm-lto2.cpp
  tools/opt/opt.cpp
  unittests/ExecutionEngine/MCJIT/MCJITTestBase.h
  unittests/MI/LiveIntervalTest.cpp
  unittests/Target/AArch64/InstSizes.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36241.109430.patch
Type: text/x-patch
Size: 90295 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170802/5e10e3a5/attachment.bin>


More information about the llvm-commits mailing list