Path: blob/main/contrib/llvm-project/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCObjectFileInfo.cpp
35293 views
//===-- RISCVMCObjectFileInfo.cpp - RISC-V object file properties ---------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7//8// This file contains the declarations of the RISCVMCObjectFileInfo properties.9//10//===----------------------------------------------------------------------===//1112#include "RISCVMCObjectFileInfo.h"13#include "RISCVMCTargetDesc.h"14#include "llvm/MC/MCContext.h"15#include "llvm/MC/MCSubtargetInfo.h"1617using namespace llvm;1819unsigned20RISCVMCObjectFileInfo::getTextSectionAlignment(const MCSubtargetInfo &STI) {21bool RVC = STI.hasFeature(RISCV::FeatureStdExtC) ||22STI.hasFeature(RISCV::FeatureStdExtZca);23return RVC ? 2 : 4;24}2526unsigned RISCVMCObjectFileInfo::getTextSectionAlignment() const {27return getTextSectionAlignment(*getContext().getSubtargetInfo());28}293031