We may need hosted Clang/LLVM to compile and getHostCpuName
can be used for native detection.
Tests are added in riscv-cpus.c just like what AArch64/PPC
have done.
| Paths 
 |  Differential  D136930  
[RISCV] Support -mcpu/mtune=native ClosedPublic Authored by • pcwang-thead on Oct 28 2022, 2:35 AM. 
Details 
 Summary We may need hosted Clang/LLVM to compile and getHostCpuName Tests are added in riscv-cpus.c just like what AArch64/PPC 
Diff Detail 
 Event Timeline
 
 Comment Actions Maybe we could add test like aarch64? https://github.com/llvm/llvm-project/blob/main/clang/test/Driver/aarch64-mcpu.c#L20 
 
 Comment Actions 
 This revision is now accepted and ready to land.Nov 4 2022, 9:57 AM Closed by commit rG7c50bcb44170: [RISCV] Support -mcpu/mtune=native (authored by • pcwang-thead).  ·  Explain WhyNov 6 2022, 6:44 PM This revision was automatically updated to reflect the committed changes. 
Revision Contents 
 
 
Diff 473535 clang/docs/ReleaseNotes.rst
 clang/lib/Driver/ToolChains/Arch/RISCV.h
 clang/lib/Driver/ToolChains/Arch/RISCV.cpp
 clang/lib/Driver/ToolChains/Clang.cpp
 
 clang/lib/Driver/ToolChains/CommonArgs.cpp
 clang/test/Driver/riscv-cpus.c
 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Why can't we use A->getValue() == "native" here?