[lld] [llvm] [RISCV] Fix alignment when mixing rvc/norvc relax/norelax code (PR #150159)

Kito Cheng via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 31 07:42:45 PDT 2025


================
@@ -33,11 +35,23 @@ class RISCVAsmBackend : public MCAsmBackend {
 
   StringMap<MCSymbol *> VendorSymbols;
 
+  SmallPtrSet<MCSection *, 8> RelaxEverSections;
+  SmallPtrSet<MCSection *, 8> RVCEverSections;
+
 public:
   RISCVAsmBackend(const MCSubtargetInfo &STI, uint8_t OSABI, bool Is64Bit,
                   const MCTargetOptions &Options);
   ~RISCVAsmBackend() override = default;
 
+  void setRVCEver(MCSection *Sec) { RVCEverSections.insert(Sec); }
+  bool hasRVCEver(MCSection *Sec) const {
----------------
kito-cheng wrote:

Fixed..I should call that in RISCVAsmBackend::relaxAlign but I called wrong one

https://github.com/llvm/llvm-project/pull/150159


More information about the llvm-commits mailing list