LLVM  10.0.0svn
AMDGPUTargetObjectFile.cpp
Go to the documentation of this file.
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 
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 
24  const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const {
25  if (Kind.isReadOnly() && AMDGPU::isReadOnlySegment(GO) &&
27  return TextSection;
28 
30 }
31 
33  const GlobalObject *GO, SectionKind SK, const TargetMachine &TM) const {
34  // Set metadata access for the explicit section
36  if (SectionName.startswith(".AMDGPU.comment."))
38 
40 }
StringRef getSection() const
Get the custom section of this global if it has one.
Definition: GlobalObject.h:89
Instances of this class represent a uniqued identifier for a section in the current translation unit...
Definition: MCSection.h:38
MCSection * getExplicitSectionGlobal(const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const override
Targets should implement this method to assign a section to globals with an explicit section specfied...
This class represents lattice values for constants.
Definition: AllocatorList.h:23
LLVM_NODISCARD bool startswith(StringRef Prefix) const
Check if this string starts with the given Prefix.
Definition: StringRef.h:256
MCSection * TextSection
Section directive for standard text.
This file declares the AMDGPU-specific subclass of TargetLoweringObjectFile.
MCSection * SelectSectionForGlobal(const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const override
MCSection * getExplicitSectionGlobal(const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const override
Targets should implement this method to assign a section to globals with an explicit section specfied...
bool isReadOnlySegment(const GlobalValue *GV)
MCSection * SelectSectionForGlobal(const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const override
SectionKind - This is a simple POD value that classifies the properties of a section.
Definition: SectionKind.h:22
const Triple & getTargetTriple() const
The AMDGPU TargetMachine interface definition for hw codgen targets.
static SectionKind getMetadata()
Definition: SectionKind.h:178
bool isReadOnly() const
Definition: SectionKind.h:122
bool shouldEmitConstantsToTextSection(const Triple &TT)
Primary interface to the complete machine description for the target machine.
Definition: TargetMachine.h:65
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:48