diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2016-08-16 21:02:59 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2016-08-16 21:02:59 +0000 |
commit | 3ca95b020283db6244cab92ede73c969253b6a31 (patch) | |
tree | d16e791e58694facd8f68d3e2797a1eaa8018afc /contrib/llvm/lib/Target/AMDGPU/AMDGPUTargetObjectFile.cpp | |
parent | 27067774dce3388702a4cf744d7096c6fb71b688 (diff) | |
parent | c3aee98e721333f265a88d6bf348e6e468f027d4 (diff) |
Update llvm to release_39 branch r276489, and resolve conflicts.
Notes
Notes:
svn path=/projects/clang390-import/; revision=304240
Diffstat (limited to 'contrib/llvm/lib/Target/AMDGPU/AMDGPUTargetObjectFile.cpp')
-rw-r--r-- | contrib/llvm/lib/Target/AMDGPU/AMDGPUTargetObjectFile.cpp | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/contrib/llvm/lib/Target/AMDGPU/AMDGPUTargetObjectFile.cpp b/contrib/llvm/lib/Target/AMDGPU/AMDGPUTargetObjectFile.cpp index e050f21091ba..03d1e2c764de 100644 --- a/contrib/llvm/lib/Target/AMDGPU/AMDGPUTargetObjectFile.cpp +++ b/contrib/llvm/lib/Target/AMDGPU/AMDGPUTargetObjectFile.cpp @@ -29,59 +29,3 @@ MCSection *AMDGPUTargetObjectFile::SelectSectionForGlobal(const GlobalValue *GV, return TargetLoweringObjectFileELF::SelectSectionForGlobal(GV, Kind, Mang, TM); } - -//===----------------------------------------------------------------------===// -// HSA Object File -//===----------------------------------------------------------------------===// - - -void AMDGPUHSATargetObjectFile::Initialize(MCContext &Ctx, - const TargetMachine &TM){ - TargetLoweringObjectFileELF::Initialize(Ctx, TM); - InitializeELF(TM.Options.UseInitArray); - - TextSection = AMDGPU::getHSATextSection(Ctx); - - DataGlobalAgentSection = AMDGPU::getHSADataGlobalAgentSection(Ctx); - DataGlobalProgramSection = AMDGPU::getHSADataGlobalProgramSection(Ctx); - - RodataReadonlyAgentSection = AMDGPU::getHSARodataReadonlyAgentSection(Ctx); -} - -bool AMDGPUHSATargetObjectFile::isAgentAllocationSection( - const char *SectionName) const { - return cast<MCSectionELF>(DataGlobalAgentSection) - ->getSectionName() - .equals(SectionName); -} - -bool AMDGPUHSATargetObjectFile::isAgentAllocation(const GlobalValue *GV) const { - // Read-only segments can only have agent allocation. - return AMDGPU::isReadOnlySegment(GV) || - (AMDGPU::isGlobalSegment(GV) && GV->hasSection() && - isAgentAllocationSection(GV->getSection())); -} - -bool AMDGPUHSATargetObjectFile::isProgramAllocation( - const GlobalValue *GV) const { - // The default for global segments is program allocation. - return AMDGPU::isGlobalSegment(GV) && !isAgentAllocation(GV); -} - -MCSection *AMDGPUHSATargetObjectFile::SelectSectionForGlobal( - const GlobalValue *GV, SectionKind Kind, - Mangler &Mang, - const TargetMachine &TM) const { - if (Kind.isText() && !GV->hasComdat()) - return getTextSection(); - - if (AMDGPU::isGlobalSegment(GV)) { - if (isAgentAllocation(GV)) - return DataGlobalAgentSection; - - if (isProgramAllocation(GV)) - return DataGlobalProgramSection; - } - - return AMDGPUTargetObjectFile::SelectSectionForGlobal(GV, Kind, Mang, TM); -} |