llvm-project/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCObjectFileInfo.cpp
Craig Topper dc5679df71 [RISCV] Rename FeatureExtZc* to FeatureStdExtZc*. NFC
Even for experimental extensions, I think we always include "Std"
in the feature name.

Reviewed By: asb

Differential Revision: https://reviews.llvm.org/D146997
2023-03-27 13:19:01 -07:00

27 lines
966 B
C++

//===-- RISCVMCObjectFileInfo.cpp - RISC-V object file properties ---------===//
//
// 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
//
//===----------------------------------------------------------------------===//
//
// This file contains the declarations of the RISCVMCObjectFileInfo properties.
//
//===----------------------------------------------------------------------===//
#include "RISCVMCObjectFileInfo.h"
#include "RISCVMCTargetDesc.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCSubtargetInfo.h"
using namespace llvm;
unsigned RISCVMCObjectFileInfo::getTextSectionAlignment() const {
const MCSubtargetInfo *STI = getContext().getSubtargetInfo();
return (STI->hasFeature(RISCV::FeatureStdExtC) ||
STI->hasFeature(RISCV::FeatureStdExtZca))
? 2
: 4;
}