Coverage Report

Created: 2019-07-24 05:18

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/lib/Target/AMDGPU/AMDGPUTargetObjectFile.cpp
Line
Count
Source
1
//===-- AMDGPUHSATargetObjectFile.cpp - AMDGPU Object Files ---------------===//
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
#include "AMDGPUTargetObjectFile.h"
10
#include "AMDGPU.h"
11
#include "AMDGPUTargetMachine.h"
12
#include "Utils/AMDGPUBaseInfo.h"
13
#include "llvm/BinaryFormat/ELF.h"
14
#include "llvm/MC/MCContext.h"
15
#include "llvm/MC/MCSectionELF.h"
16
17
using namespace llvm;
18
19
//===----------------------------------------------------------------------===//
20
// Generic Object File
21
//===----------------------------------------------------------------------===//
22
23
MCSection *AMDGPUTargetObjectFile::SelectSectionForGlobal(
24
27.8k
    const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const {
25
27.8k
  if (Kind.isReadOnly() && 
AMDGPU::isReadOnlySegment(GO)39
&&
26
27.8k
      
AMDGPU::shouldEmitConstantsToTextSection(TM.getTargetTriple())37
)
27
33
    return TextSection;
28
27.8k
29
27.8k
  return TargetLoweringObjectFileELF::SelectSectionForGlobal(GO, Kind, TM);
30
27.8k
}
31
32
MCSection *AMDGPUTargetObjectFile::getExplicitSectionGlobal(
33
3
    const GlobalObject *GO, SectionKind SK, const TargetMachine &TM) const {
34
3
  // Set metadata access for the explicit section
35
3
  StringRef SectionName = GO->getSection();
36
3
  if (SectionName.startswith(".AMDGPU.comment."))
37
3
    SK = SectionKind::getMetadata();
38
3
39
3
  return TargetLoweringObjectFileELF::getExplicitSectionGlobal(GO, SK, TM);
40
3
}