Tom Stellard | e135ffd | 2015-09-25 21:41:28 +0000 | [diff] [blame] | 1 | //===-- AMDGPUHSATargetObjectFile.cpp - AMDGPU Object Files ---------------===// |
| 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 | |
Tom Stellard | c93fc11 | 2015-12-10 02:13:01 +0000 | [diff] [blame] | 10 | #include "AMDGPUTargetObjectFile.h" |
Tom Stellard | 00f2f91 | 2015-12-02 19:47:57 +0000 | [diff] [blame] | 11 | #include "AMDGPU.h" |
Tom Stellard | e135ffd | 2015-09-25 21:41:28 +0000 | [diff] [blame] | 12 | #include "Utils/AMDGPUBaseInfo.h" |
| 13 | #include "llvm/MC/MCContext.h" |
| 14 | #include "llvm/MC/MCSectionELF.h" |
| 15 | #include "llvm/Support/ELF.h" |
| 16 | |
| 17 | using namespace llvm; |
| 18 | |
Tom Stellard | c93fc11 | 2015-12-10 02:13:01 +0000 | [diff] [blame] | 19 | //===----------------------------------------------------------------------===// |
| 20 | // Generic Object File |
| 21 | //===----------------------------------------------------------------------===// |
| 22 | |
| 23 | MCSection *AMDGPUTargetObjectFile::SelectSectionForGlobal(const GlobalValue *GV, |
| 24 | SectionKind Kind, |
| 25 | Mangler &Mang, |
| 26 | const TargetMachine &TM) const { |
| 27 | if (Kind.isReadOnly() && AMDGPU::isReadOnlySegment(GV)) |
| 28 | return TextSection; |
| 29 | |
| 30 | return TargetLoweringObjectFileELF::SelectSectionForGlobal(GV, Kind, Mang, TM); |
| 31 | } |