[lld] [llvm] Reapply "[RISCV] Support RISCV Atomics ABI attributes (#84597)" (PR #90266)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 29 13:59:10 PDT 2024


================
@@ -1134,6 +1186,17 @@ mergeAttributesSection(const SmallVector<InputSectionBase *, 0> &sections) {
       case RISCVAttrs::PRIV_SPEC_MINOR:
       case RISCVAttrs::PRIV_SPEC_REVISION:
         break;
+
+      case llvm::RISCVAttrs::AttrType::ATOMIC_ABI:
+        if (auto i = parser.getAttributeValue(tag.attr)) {
+          auto r = merged.intAttr.try_emplace(tag.attr, *i);
+          if (r.second) {
+            firstAtomicAbi = sec;
----------------
MaskRay wrote:

no braces for one-line single statements

see other comments in #84597

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


More information about the llvm-commits mailing list