Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / llvm / lib / Target / RISCV / MCTargetDesc / RISCVMCObjectFileInfo.cpp
blobac7d3b785ab1b2a5599e3742a1740de1ddcd9061
1 //===-- RISCVMCObjectFileInfo.cpp - RISC-V 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.
11 //===----------------------------------------------------------------------===//
13 #include "RISCVMCObjectFileInfo.h"
14 #include "RISCVMCTargetDesc.h"
15 #include "llvm/MC/MCContext.h"
16 #include "llvm/MC/MCSubtargetInfo.h"
18 using namespace llvm;
20 unsigned
21 RISCVMCObjectFileInfo::getTextSectionAlignment(const MCSubtargetInfo &STI) {
22 bool RVC = STI.hasFeature(RISCV::FeatureStdExtC) ||
23 STI.hasFeature(RISCV::FeatureStdExtZca);
24 return RVC ? 2 : 4;
27 unsigned RISCVMCObjectFileInfo::getTextSectionAlignment() const {
28 return getTextSectionAlignment(*getContext().getSubtargetInfo());