blob: 3697a96ffaf2dd84df3cde859a01ae07d8b54327 [file] [log] [blame]
Tom Stellarde135ffd2015-09-25 21:41:28 +00001//===-- AMDGPUHSATargetObjectFile.h - AMDGPU HSA Object Info ----*- C++ -*-===//
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
12/// TargetLoweringObjectFile use for targeting the HSA-runtime.
13///
14//===----------------------------------------------------------------------===//
15
16#ifndef LLVM_LIB_TARGET_AMDGPU_AMDGPUHSATARGETOBJECTFILE_H
17#define LLVM_LIB_TARGET_AMDGPU_AMDGPUHSATARGETOBJECTFILE_H
18
19#include "llvm/CodeGen/TargetLoweringObjectFileImpl.h"
20#include "llvm/Target/TargetMachine.h"
21
22namespace llvm {
23
24class AMDGPUHSATargetObjectFile final : public TargetLoweringObjectFileELF {
Tom Stellard00f2f912015-12-02 19:47:57 +000025private:
26 MCSection *DataGlobalAgentSection;
27 MCSection *DataGlobalProgramSection;
28
29 bool isAgentAllocationSection(const char *SectionName) const;
30 bool isAgentAllocation(const GlobalValue *GV) const;
31 bool isProgramAllocation(const GlobalValue *GV) const;
32
Tom Stellarde135ffd2015-09-25 21:41:28 +000033public:
Saleem Abdulrasool91746232015-09-26 04:34:52 +000034 void Initialize(MCContext &Ctx, const TargetMachine &TM) override;
Tom Stellarde135ffd2015-09-25 21:41:28 +000035
36 MCSection *SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
37 Mangler &Mang,
38 const TargetMachine &TM) const override;
39};
40
41} // end namespace llvm
42
43#endif