Coverage Report

Created: 2024-01-17 10:31

/src/llvm-project/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCObjectFileInfo.cpp
Line
Count
Source (jump to first uncovered line)
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.
10
//
11
//===----------------------------------------------------------------------===//
12
13
#include "RISCVMCObjectFileInfo.h"
14
#include "RISCVMCTargetDesc.h"
15
#include "llvm/MC/MCContext.h"
16
#include "llvm/MC/MCSubtargetInfo.h"
17
18
using namespace llvm;
19
20
unsigned
21
0
RISCVMCObjectFileInfo::getTextSectionAlignment(const MCSubtargetInfo &STI) {
22
0
  bool RVC = STI.hasFeature(RISCV::FeatureStdExtC) ||
23
0
             STI.hasFeature(RISCV::FeatureStdExtZca);
24
0
  return RVC ? 2 : 4;
25
0
}
26
27
0
unsigned RISCVMCObjectFileInfo::getTextSectionAlignment() const {
28
0
  return getTextSectionAlignment(*getContext().getSubtargetInfo());
29
0
}