LLVM  8.0.1
AMDGPUTargetObjectFile.cpp
Go to the documentation of this file.
1 //===-- AMDGPUHSATargetObjectFile.cpp - AMDGPU Object Files ---------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #include "AMDGPUTargetObjectFile.h"
11 #include "AMDGPU.h"
12 #include "AMDGPUTargetMachine.h"
13 #include "Utils/AMDGPUBaseInfo.h"
14 #include "llvm/BinaryFormat/ELF.h"
15 #include "llvm/MC/MCContext.h"
16 #include "llvm/MC/MCSectionELF.h"
17 
18 using namespace llvm;
19 
20 //===----------------------------------------------------------------------===//
21 // Generic Object File
22 //===----------------------------------------------------------------------===//
23 
25  const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const {
26  if (Kind.isReadOnly() && AMDGPU::isReadOnlySegment(GO) &&
28  return TextSection;
29 
31 }
32 
34  const GlobalObject *GO, SectionKind SK, const TargetMachine &TM) const {
35  // Set metadata access for the explicit section
37  if (SectionName.startswith(".AMDGPU.comment."))
39 
41 }
StringRef getSection() const
Get the custom section of this global if it has one.
Definition: GlobalObject.h:90
Instances of this class represent a uniqued identifier for a section in the current translation unit...
Definition: MCSection.h:39
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:24
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
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool startswith(StringRef Prefix) const
Check if this string starts with the given Prefix.
Definition: StringRef.h:267
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:23
const Triple & getTargetTriple() const
The AMDGPU TargetMachine interface definition for hw codgen targets.
static SectionKind getMetadata()
Definition: SectionKind.h:179
bool isReadOnly() const
Definition: SectionKind.h:123
bool shouldEmitConstantsToTextSection(const Triple &TT)
const unsigned Kind
Primary interface to the complete machine description for the target machine.
Definition: TargetMachine.h:59
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:49