154e8cae5SPhilipp Krones //===-- RISCVMCObjectFileInfo.cpp - RISCV object file properties ----------===// 254e8cae5SPhilipp Krones // 354e8cae5SPhilipp Krones // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 454e8cae5SPhilipp Krones // See https://llvm.org/LICENSE.txt for license information. 554e8cae5SPhilipp Krones // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 654e8cae5SPhilipp Krones // 754e8cae5SPhilipp Krones //===----------------------------------------------------------------------===// 854e8cae5SPhilipp Krones // 954e8cae5SPhilipp Krones // This file contains the declarations of the RISCVMCObjectFileInfo properties. 1054e8cae5SPhilipp Krones // 1154e8cae5SPhilipp Krones //===----------------------------------------------------------------------===// 1254e8cae5SPhilipp Krones 1354e8cae5SPhilipp Krones #include "RISCVMCObjectFileInfo.h" 1454e8cae5SPhilipp Krones #include "RISCVMCTargetDesc.h" 1554e8cae5SPhilipp Krones #include "llvm/MC/MCContext.h" 16*ef736a1cSserge-sans-paille #include "llvm/MC/MCSubtargetInfo.h" 1754e8cae5SPhilipp Krones 1854e8cae5SPhilipp Krones using namespace llvm; 1954e8cae5SPhilipp Krones getTextSectionAlignment() const2054e8cae5SPhilipp Kronesunsigned RISCVMCObjectFileInfo::getTextSectionAlignment() const { 2154e8cae5SPhilipp Krones const MCSubtargetInfo *STI = getContext().getSubtargetInfo(); 2254e8cae5SPhilipp Krones return STI->hasFeature(RISCV::FeatureStdExtC) ? 2 : 4; 2354e8cae5SPhilipp Krones } 24