LLVM 19.0.0git
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
12#include "llvm/MC/SectionKind.h"
14using namespace llvm;
15
16//===----------------------------------------------------------------------===//
17// Generic Object File
18//===----------------------------------------------------------------------===//
19
21 const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const {
22 if (Kind.isReadOnly() && AMDGPU::isReadOnlySegment(GO) &&
24 return TextSection;
25
27}
28
30 const GlobalObject *GO, SectionKind SK, const TargetMachine &TM) const {
31 // Set metadata access for the explicit section
33 if (SectionName.starts_with(".AMDGPU.comment."))
35
37}
This file declares the AMDGPU-specific subclass of TargetLoweringObjectFile.
const char LLVMTargetMachineRef TM
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...
StringRef getSection() const
Get the custom section of this global if it has one.
Definition: GlobalObject.h:118
MCSection * TextSection
Section directive for standard text.
Instances of this class represent a uniqued identifier for a section in the current translation unit.
Definition: MCSection.h:39
SectionKind - This is a simple POD value that classifies the properties of a section.
Definition: SectionKind.h:22
static SectionKind getMetadata()
Definition: SectionKind.h:188
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
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...
Primary interface to the complete machine description for the target machine.
Definition: TargetMachine.h:76
const Triple & getTargetTriple() const
bool shouldEmitConstantsToTextSection(const Triple &TT)
bool isReadOnlySegment(const GlobalValue *GV)
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18