xref: /freebsd/contrib/llvm-project/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCObjectFileInfo.cpp (revision 924226fba12cc9a228c73b956e1b7fa24c60b055)
1 //===-- RISCVMCObjectFileInfo.cpp - RISCV object file properties ----------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains the declarations of the RISCVMCObjectFileInfo properties.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #include "RISCVMCObjectFileInfo.h"
14 #include "RISCVMCTargetDesc.h"
15 #include "llvm/MC/MCContext.h"
16 
17 using namespace llvm;
18 
19 unsigned RISCVMCObjectFileInfo::getTextSectionAlignment() const {
20   const MCSubtargetInfo *STI = getContext().getSubtargetInfo();
21   return STI->hasFeature(RISCV::FeatureStdExtC) ? 2 : 4;
22 }
23