[RISCV] Use a lambda to avoid having the Support library depend on Option library.
authorCraig Topper <craig.topper@sifive.com>
Mon, 18 Oct 2021 20:26:35 +0000 (13:26 -0700)
committerCraig Topper <craig.topper@sifive.com>
Mon, 18 Oct 2021 20:39:37 +0000 (13:39 -0700)
commit1053e0b27ce135ce2da63af01aa986b9425386ee
tree2a2bea97f0ce0e393134c54082f9b4de69ab3e07
parent431a5d8411952b4c9c2185303afd703123ef55cc
[RISCV] Use a lambda to avoid having the Support library depend on Option library.

RISCVISAInfo::toFeatures needs to allocate strings using
ArgList::MakeArgString, but toFeatures lives in Support and
MakeArgString lives in Option.

toFeature only has one caller, so the simple fix is to have that
caller pass a lamdba that wraps MakeArgString to break the
dependency.

Differential Revision: https://reviews.llvm.org/D112032
clang/lib/Driver/ToolChains/Arch/RISCV.cpp
llvm/include/llvm/Support/RISCVISAInfo.h
llvm/lib/Support/RISCVISAInfo.cpp