[lld] [ELF,RISCV] Fix code style after #169273 (PR #178365)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 27 21:19:15 PST 2026


https://github.com/MaskRay created https://github.com/llvm/llvm-project/pull/178365

None

>From fab556c3755934900a27720dc747dd0a798eacdf Mon Sep 17 00:00:00 2001
From: Fangrui Song <i at maskray.me>
Date: Tue, 27 Jan 2026 21:12:32 -0800
Subject: [PATCH] [ELF,RISCV] Fix code style after #169273

---
 lld/ELF/Arch/RISCV.cpp                  | 7 ++-----
 lld/test/ELF/riscv-vendor-relocations.s | 2 +-
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/lld/ELF/Arch/RISCV.cpp b/lld/ELF/Arch/RISCV.cpp
index 7ec75b0d61fce..2678837c5a4c9 100644
--- a/lld/ELF/Arch/RISCV.cpp
+++ b/lld/ELF/Arch/RISCV.cpp
@@ -1549,20 +1549,17 @@ void RISCV::scanSection(InputSectionBase &sec) {
   invokeELFT(scanSection1, sec);
 }
 
-namespace lld::elf {
-uint32_t getRISCVVendorRelMarker(StringRef rvVendor) {
+uint32_t elf::getRISCVVendorRelMarker(StringRef rvVendor) {
   return StringSwitch<uint32_t>(rvVendor)
       .Case("QUALCOMM", INTERNAL_RISCV_VENDOR_QUALCOMM)
       .Case("ANDES", INTERNAL_RISCV_VENDOR_ANDES)
       .Default(0);
 }
 
-std::optional<StringRef> getRISCVVendorString(RelType ty) {
+std::optional<StringRef> elf::getRISCVVendorString(RelType ty) {
   if ((ty.v & INTERNAL_RISCV_VENDOR_MASK) == INTERNAL_RISCV_VENDOR_QUALCOMM)
     return "QUALCOMM";
   if ((ty.v & INTERNAL_RISCV_VENDOR_MASK) == INTERNAL_RISCV_VENDOR_ANDES)
     return "ANDES";
   return std::nullopt;
 }
-
-} // namespace lld::elf
diff --git a/lld/test/ELF/riscv-vendor-relocations.s b/lld/test/ELF/riscv-vendor-relocations.s
index f121adec95cd0..88825756797b7 100644
--- a/lld/test/ELF/riscv-vendor-relocations.s
+++ b/lld/test/ELF/riscv-vendor-relocations.s
@@ -1,6 +1,6 @@
 # REQUIRES: riscv
 # RUN: llvm-mc -triple riscv32 %s -filetype=obj -o %t.o
-# RUN: not ld.lld -pie %t.o -o /dev/null 2>&1 | FileCheck %s
+# RUN: not ld.lld -pie %t.o -o /dev/null 2>&1 | FileCheck %s --implicit-check-not=error:
 
   .option exact
 



More information about the llvm-commits mailing list