mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-26 02:36:06 +00:00

This patch adds support for the atomic_abi attribute, specifid in https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-elf.adoc#tag_riscv_atomic_abi-14-uleb128version. This was previously reverted due to ld.bfd segfaulting w/ unknown riscv attributes. Attribute emission is now guarded by a backend flag `--riscv-abi-attributes`, which is off by default. Linker support in LLD for attribute merging is now in a standalone patch. Reviewers: kito-cheng, MaskRay, asb Reviewed By: MaskRay Pull Request: https://github.com/llvm/llvm-project/pull/90266
28 lines
938 B
C++
28 lines
938 B
C++
//===-- RISCVAttributes.cpp - RISCV Attributes ----------------------------===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "llvm/Support/RISCVAttributes.h"
|
|
|
|
using namespace llvm;
|
|
using namespace llvm::RISCVAttrs;
|
|
|
|
static constexpr TagNameItem tagData[] = {
|
|
{STACK_ALIGN, "Tag_stack_align"},
|
|
{ARCH, "Tag_arch"},
|
|
{UNALIGNED_ACCESS, "Tag_unaligned_access"},
|
|
{PRIV_SPEC, "Tag_priv_spec"},
|
|
{PRIV_SPEC_MINOR, "Tag_priv_spec_minor"},
|
|
{PRIV_SPEC_REVISION, "Tag_priv_spec_revision"},
|
|
{ATOMIC_ABI, "Tag_atomic_abi"},
|
|
};
|
|
|
|
constexpr TagNameMap RISCVAttributeTags{tagData};
|
|
const TagNameMap &llvm::RISCVAttrs::getRISCVAttributeTags() {
|
|
return RISCVAttributeTags;
|
|
}
|