[PATCH] D81439: [X86] Move CPUKind enum from clang to llvm/lib/Support. NFCI

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 8 17:12:32 PDT 2020


craig.topper created this revision.
craig.topper added reviewers: erichkeane, echristo, RKSimon, spatel, LuoYuanke.
Herald added subscribers: hiraditya, mgorny.
Herald added projects: clang, LLVM.

Similar to what some other targets have done. This information
could be reused by other frontends so doesn't make sense to live
in clang.

-Rename CK_Generic to CK_None to better reflect its illegalness.
-Move function for translating from string to enum into llvm.
-Call checkCPUKind directly from the string to enum translation
 and update CPU kind to CK_None accordinly. Caller will use CK_None
 as sentinel for bad CPU.

I'm planning to move all the CPU to feature mapping out next. As
part of that I want to devise a better way to express CPUs inheriting
features from an earlier CPU. Allowing this to be expressed in a
less rigid way than just falling through a switch. Or using gotos
as we've had to do lately.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D81439

Files:
  clang/include/clang/Basic/X86Target.def
  clang/lib/Basic/Targets/X86.cpp
  clang/lib/Basic/Targets/X86.h
  llvm/include/llvm/Support/X86TargetParser.def
  llvm/include/llvm/Support/X86TargetParser.h
  llvm/lib/Support/CMakeLists.txt
  llvm/lib/Support/X86TargetParser.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D81439.269379.patch
Type: text/x-patch
Size: 25496 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200609/3f198406/attachment-0001.bin>


More information about the llvm-commits mailing list