1 //===-- AMDGPUTargetObjectFile.h - AMDGPU Object Info ----*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
11 /// \brief This file declares the AMDGPU-specific subclass of
12 /// TargetLoweringObjectFile.
14 //===----------------------------------------------------------------------===//
16 #ifndef LLVM_LIB_TARGET_AMDGPU_AMDGPUTARGETOBJECTFILE_H
17 #define LLVM_LIB_TARGET_AMDGPU_AMDGPUTARGETOBJECTFILE_H
19 #include "llvm/CodeGen/TargetLoweringObjectFileImpl.h"
20 #include "llvm/Target/TargetMachine.h"
24 class AMDGPUTargetObjectFile : public TargetLoweringObjectFileELF {
26 MCSection *SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
28 const TargetMachine &TM) const override;
31 class AMDGPUHSATargetObjectFile final : public AMDGPUTargetObjectFile {
33 MCSection *DataGlobalAgentSection;
34 MCSection *DataGlobalProgramSection;
35 MCSection *RodataReadonlyAgentSection;
37 bool isAgentAllocationSection(const char *SectionName) const;
38 bool isAgentAllocation(const GlobalValue *GV) const;
39 bool isProgramAllocation(const GlobalValue *GV) const;
42 void Initialize(MCContext &Ctx, const TargetMachine &TM) override;
44 MCSection *SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
46 const TargetMachine &TM) const override;
49 } // end namespace llvm