Tom Stellard | c93fc11 | 2015-12-10 02:13:01 +0000 | [diff] [blame] | 1 | //===-- AMDGPUTargetObjectFile.h - AMDGPU Object Info ----*- C++ -*-===// |
Tom Stellard | e135ffd | 2015-09-25 21:41:28 +0000 | [diff] [blame] | 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 | /// \file |
| 11 | /// \brief This file declares the AMDGPU-specific subclass of |
Tom Stellard | c93fc11 | 2015-12-10 02:13:01 +0000 | [diff] [blame] | 12 | /// TargetLoweringObjectFile. |
Tom Stellard | e135ffd | 2015-09-25 21:41:28 +0000 | [diff] [blame] | 13 | /// |
| 14 | //===----------------------------------------------------------------------===// |
| 15 | |
Tom Stellard | c93fc11 | 2015-12-10 02:13:01 +0000 | [diff] [blame] | 16 | #ifndef LLVM_LIB_TARGET_AMDGPU_AMDGPUTARGETOBJECTFILE_H |
| 17 | #define LLVM_LIB_TARGET_AMDGPU_AMDGPUTARGETOBJECTFILE_H |
Tom Stellard | e135ffd | 2015-09-25 21:41:28 +0000 | [diff] [blame] | 18 | |
| 19 | #include "llvm/CodeGen/TargetLoweringObjectFileImpl.h" |
| 20 | #include "llvm/Target/TargetMachine.h" |
| 21 | |
| 22 | namespace llvm { |
| 23 | |
Tom Stellard | c93fc11 | 2015-12-10 02:13:01 +0000 | [diff] [blame] | 24 | class AMDGPUTargetObjectFile : public TargetLoweringObjectFileELF { |
| 25 | public: |
| 26 | MCSection *SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind, |
| 27 | Mangler &Mang, |
| 28 | const TargetMachine &TM) const override; |
| 29 | }; |
| 30 | |
| 31 | class AMDGPUHSATargetObjectFile final : public AMDGPUTargetObjectFile { |
Tom Stellard | 00f2f91 | 2015-12-02 19:47:57 +0000 | [diff] [blame] | 32 | private: |
| 33 | MCSection *DataGlobalAgentSection; |
| 34 | MCSection *DataGlobalProgramSection; |
Tom Stellard | 9760f03 | 2015-12-03 03:34:32 +0000 | [diff] [blame] | 35 | MCSection *RodataReadonlyAgentSection; |
Tom Stellard | 00f2f91 | 2015-12-02 19:47:57 +0000 | [diff] [blame] | 36 | |
| 37 | bool isAgentAllocationSection(const char *SectionName) const; |
| 38 | bool isAgentAllocation(const GlobalValue *GV) const; |
| 39 | bool isProgramAllocation(const GlobalValue *GV) const; |
| 40 | |
Tom Stellard | e135ffd | 2015-09-25 21:41:28 +0000 | [diff] [blame] | 41 | public: |
Saleem Abdulrasool | 9174623 | 2015-09-26 04:34:52 +0000 | [diff] [blame] | 42 | void Initialize(MCContext &Ctx, const TargetMachine &TM) override; |
Tom Stellard | e135ffd | 2015-09-25 21:41:28 +0000 | [diff] [blame] | 43 | |
| 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 |