[llvm] [RISCV][NFC] Add a newline when using --print-enabled-extensions (PR #98425)
Shao-Ce SUN via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 10 20:10:05 PDT 2024
https://github.com/sunshaoce created https://github.com/llvm/llvm-project/pull/98425
The `--print-enabled-extensions` has been introduced in the https://github.com/llvm/llvm-project/pull/98207 , but it seems to be missing a newline in the end.
```shell
$ bin/clang --target=riscv64 --print-enabled-extensions
clang version 19.0.0git (https://github.com/sunshaoce/ssc-llvm.git 1b3e376ec0a77f7d7d20d0d32047678dafa142ae)
Target: riscv64
Thread model: posix
InstalledDir: /sw/sunshaoce/ssc-llvm/build/bin
Build config: +unoptimized, +assertions
Extensions enabled for the given RISC-V target
Name Version Description
i 2.1 'I' (Base Integer Instruction Set)
m 2.0 'M' (Integer Multiplication and Division)
a 2.1 'A' (Atomic Instructions)
c 2.0 'C' (Compressed Instructions)
zmmul 1.0 'Zmmul' (Integer Multiplication)
Experimental extensions
ISA String: rv64i2p1_m2p0_a2p1_c2p0_zmmul1p0$
$
```
>From 05fe32ed7909e9ce0735f273add640b13df7a90a Mon Sep 17 00:00:00 2001
From: Shao-Ce SUN <sunshaoce at outlook.com>
Date: Thu, 11 Jul 2024 11:05:36 +0800
Subject: [PATCH] [RISCV][NFC] Add a newline when using
--print-enabled-extensions
---
llvm/lib/TargetParser/RISCVISAInfo.cpp | 2 +-
llvm/unittests/TargetParser/RISCVISAInfoTest.cpp | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/llvm/lib/TargetParser/RISCVISAInfo.cpp b/llvm/lib/TargetParser/RISCVISAInfo.cpp
index 254a3f8aa95e0..59d5a6a4b2200 100644
--- a/llvm/lib/TargetParser/RISCVISAInfo.cpp
+++ b/llvm/lib/TargetParser/RISCVISAInfo.cpp
@@ -151,7 +151,7 @@ void RISCVISAInfo::printEnabledExtensions(
unsigned XLen = IsRV64 ? 64 : 32;
if (auto ISAString = RISCVISAInfo::createFromExtMap(XLen, FullExtMap))
- outs() << "\nISA String: " << ISAString.get()->toString();
+ outs() << "\nISA String: " << ISAString.get()->toString() << "\n";
}
static bool stripExperimentalPrefix(StringRef &Ext) {
diff --git a/llvm/unittests/TargetParser/RISCVISAInfoTest.cpp b/llvm/unittests/TargetParser/RISCVISAInfoTest.cpp
index 889fbec6c6008..26ff8fdcabcf9 100644
--- a/llvm/unittests/TargetParser/RISCVISAInfoTest.cpp
+++ b/llvm/unittests/TargetParser/RISCVISAInfoTest.cpp
@@ -1080,7 +1080,8 @@ R"(Extensions enabled for the given RISC-V target
Experimental extensions
zicfilp 0.4 'Zicfilp' (Landing pad)
-ISA String: rv64i2p1_zicfilp0p4_zicsr2p0)";
+ISA String: rv64i2p1_zicfilp0p4_zicsr2p0
+)";
// clang-format on
StringMap<StringRef> DescMap;
More information about the llvm-commits
mailing list