[PATCH] D63105: Add --print-supported-cpus flag for clang.

Ziang Wan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 10 16:11:05 PDT 2019


ziangwan created this revision.
ziangwan added reviewers: srhines, pirama, kongyi, jlebar.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.

This patch allows clang users to print out a list of supported CPU models using

  clang [--target=<target triple>] --print-supported-cpus
  ```. 
  Then, users can select the CPU model to compile to using 

clang --target=<triple> -mcpu=<model> a.c

  .
  It is a handy feature to help cross compilation.
  
  While the flag seems to be a front-end option, the supported CPU models are stored in each target machine in the back-end. This patch attempts to create a short cut to directly retrieve information from the back-end target machines at the front-end.


Repository:
  rL LLVM

https://reviews.llvm.org/D63105

Files:
  clang/docs/ClangCommandLineReference.rst
  clang/docs/CommandGuide/clang.rst
  clang/include/clang/Driver/Options.td
  clang/include/clang/Frontend/FrontendOptions.h
  clang/lib/Driver/Driver.cpp
  clang/lib/Frontend/CompilerInvocation.cpp
  clang/test/Driver/print-supported-cpus.c
  clang/tools/driver/cc1_main.cpp
  llvm/lib/MC/MCSubtargetInfo.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63105.203923.patch
Type: text/x-patch
Size: 8825 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190610/342c960d/attachment.bin>


More information about the llvm-commits mailing list