blob: 921341ebb8976c98f302229099c0e8c5cc261858 [file] [log] [blame]
Tom Stellardc93fc112015-12-10 02:13:01 +00001//===-- AMDGPUTargetObjectFile.h - AMDGPU Object Info ----*- C++ -*-===//
Tom Stellarde135ffd2015-09-25 21:41:28 +00002//
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/// \file
11/// \brief This file declares the AMDGPU-specific subclass of
Tom Stellardc93fc112015-12-10 02:13:01 +000012/// TargetLoweringObjectFile.
Tom Stellarde135ffd2015-09-25 21:41:28 +000013///
14//===----------------------------------------------------------------------===//
15
Tom Stellardc93fc112015-12-10 02:13:01 +000016#ifndef LLVM_LIB_TARGET_AMDGPU_AMDGPUTARGETOBJECTFILE_H
17#define LLVM_LIB_TARGET_AMDGPU_AMDGPUTARGETOBJECTFILE_H
Tom Stellarde135ffd2015-09-25 21:41:28 +000018
19#include "llvm/CodeGen/TargetLoweringObjectFileImpl.h"
20#include "llvm/Target/TargetMachine.h"
21
22namespace llvm {
23
Tom Stellardc93fc112015-12-10 02:13:01 +000024class AMDGPUTargetObjectFile : public TargetLoweringObjectFileELF {
25 public:
26 MCSection *SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
27 Mangler &Mang,
28 const TargetMachine &TM) const override;
29};
30
31class AMDGPUHSATargetObjectFile final : public AMDGPUTargetObjectFile {
Tom Stellard00f2f912015-12-02 19:47:57 +000032private:
33 MCSection *DataGlobalAgentSection;
34 MCSection *DataGlobalProgramSection;
Tom Stellard9760f032015-12-03 03:34:32 +000035 MCSection *RodataReadonlyAgentSection;
Tom Stellard00f2f912015-12-02 19:47:57 +000036
37 bool isAgentAllocationSection(const char *SectionName) const;
38 bool isAgentAllocation(const GlobalValue *GV) const;
39 bool isProgramAllocation(const GlobalValue *GV) const;
40
Tom Stellarde135ffd2015-09-25 21:41:28 +000041public:
Saleem Abdulrasool91746232015-09-26 04:34:52 +000042 void Initialize(MCContext &Ctx, const TargetMachine &TM) override;
Tom Stellarde135ffd2015-09-25 21:41:28 +000043
44 MCSection *SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
45 Mangler &Mang,
46 const TargetMachine &TM) const override;
47};
48
49} // end namespace llvm
50
51#endif