Skip to content

Commit aab0d37

Browse files
fixup! format and use RISCV namespace
1 parent 9db0919 commit aab0d37

File tree

4 files changed

+15
-12
lines changed

4 files changed

+15
-12
lines changed

clang/tools/driver/cc1_main.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ static int PrintSupportedExtensions(std::string TargetStr) {
147147
DescMap.insert({feature.Key, feature.Desc});
148148

149149
if (MachineTriple.isRISCV())
150-
llvm::printSupportedExtensions(DescMap);
150+
llvm::RISCVISAInfo::printSupportedExtensions(DescMap);
151151
else if (MachineTriple.isAArch64())
152152
llvm::AArch64::PrintSupportedExtensions();
153153
else if (MachineTriple.isARM())
@@ -196,7 +196,8 @@ static int PrintEnabledExtensions(const TargetOptions& TargetOpts) {
196196
llvm::StringMap<llvm::StringRef> DescMap;
197197
for (const llvm::SubtargetFeatureKV &feature : Features)
198198
DescMap.insert({feature.Key, feature.Desc});
199-
llvm::printEnabledExtensions(MachineTriple.isArch64Bit(), EnabledFeatureNames, DescMap);
199+
llvm::RISCVISAInfo::printEnabledExtensions(MachineTriple.isArch64Bit(),
200+
EnabledFeatureNames, DescMap);
200201
} else {
201202
// The option was already checked in Driver::HandleImmediateArgs,
202203
// so we do not expect to get here if we are not a supported architecture.

llvm/include/llvm/TargetParser/RISCVISAInfo.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@
2020
#include <vector>
2121

2222
namespace llvm {
23-
void printSupportedExtensions(StringMap<StringRef> &DescMap);
24-
void printEnabledExtensions(bool IsRV64,
25-
std::set<StringRef> &EnabledFeatureNames,
26-
StringMap<StringRef> &DescMap);
2723

2824
class RISCVISAInfo {
2925
public:
@@ -79,6 +75,11 @@ class RISCVISAInfo {
7975
unsigned MinorVersion);
8076
static std::string getTargetFeatureForExtension(StringRef Ext);
8177

78+
static void printSupportedExtensions(StringMap<StringRef> &DescMap);
79+
static void printEnabledExtensions(bool IsRV64,
80+
std::set<StringRef> &EnabledFeatureNames,
81+
StringMap<StringRef> &DescMap);
82+
8283
private:
8384
RISCVISAInfo(unsigned XLen) : XLen(XLen) {}
8485

llvm/lib/TargetParser/RISCVISAInfo.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ static void PrintExtension(StringRef Name, StringRef Version,
8080
<< Description << "\n";
8181
}
8282

83-
void llvm::printSupportedExtensions(StringMap<StringRef> &DescMap) {
83+
void RISCVISAInfo::printSupportedExtensions(StringMap<StringRef> &DescMap) {
8484
outs() << "All available -march extensions for RISC-V\n\n";
8585
PrintExtension("Name", "Version", (DescMap.empty() ? "" : "Description"));
8686

@@ -115,9 +115,9 @@ void llvm::printSupportedExtensions(StringMap<StringRef> &DescMap) {
115115
"For example, clang -march=rv32i_v1p0\n";
116116
}
117117

118-
void llvm::printEnabledExtensions(bool IsRV64,
119-
std::set<StringRef> &EnabledFeatureNames,
120-
StringMap<StringRef> &DescMap) {
118+
void RISCVISAInfo::printEnabledExtensions(
119+
bool IsRV64, std::set<StringRef> &EnabledFeatureNames,
120+
StringMap<StringRef> &DescMap) {
121121
outs() << "Extensions enabled for the given RISC-V target\n\n";
122122
PrintExtension("Name", "Version", (DescMap.empty() ? "" : "Description"));
123123

llvm/unittests/TargetParser/RISCVISAInfoTest.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,7 +1060,7 @@ For example, clang -march=rv32i_v1p0)";
10601060

10611061
outs().flush();
10621062
testing::internal::CaptureStdout();
1063-
printSupportedExtensions(DummyMap);
1063+
RISCVISAInfo::printSupportedExtensions(DummyMap);
10641064
outs().flush();
10651065

10661066
std::string CapturedOutput = testing::internal::GetCapturedStdout();
@@ -1090,7 +1090,8 @@ ISA String: rv64i2p1_ztso0p1)";
10901090

10911091
outs().flush();
10921092
testing::internal::CaptureStdout();
1093-
llvm::printEnabledExtensions(/*IsRV64=*/true, EnabledExtensions, DescMap);
1093+
RISCVISAInfo::printEnabledExtensions(/*IsRV64=*/true, EnabledExtensions,
1094+
DescMap);
10941095
outs().flush();
10951096
std::string CapturedOutput = testing::internal::GetCapturedStdout();
10961097

0 commit comments

Comments
 (0)