1 //===-- NVPTXTargetObjectFile.h - NVPTX 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 #ifndef LLVM_LIB_TARGET_NVPTX_NVPTXTARGETOBJECTFILE_H 11 #define LLVM_LIB_TARGET_NVPTX_NVPTXTARGETOBJECTFILE_H 12 13 #include "llvm/MC/MCSection.h" 14 #include "llvm/MC/SectionKind.h" 15 #include "llvm/Target/TargetLoweringObjectFile.h" 16 17 namespace llvm { 18 19 class NVPTXTargetObjectFile : public TargetLoweringObjectFile { 20 public: NVPTXTargetObjectFile()21 NVPTXTargetObjectFile() : TargetLoweringObjectFile() {} 22 23 ~NVPTXTargetObjectFile() override; 24 Initialize(MCContext & ctx,const TargetMachine & TM)25 void Initialize(MCContext &ctx, const TargetMachine &TM) override { 26 TargetLoweringObjectFile::Initialize(ctx, TM); 27 } 28 getSectionForConstant(const DataLayout & DL,SectionKind Kind,const Constant * C,unsigned & Align)29 MCSection *getSectionForConstant(const DataLayout &DL, SectionKind Kind, 30 const Constant *C, 31 unsigned &Align) const override { 32 return ReadOnlySection; 33 } 34 getExplicitSectionGlobal(const GlobalObject * GO,SectionKind Kind,const TargetMachine & TM)35 MCSection *getExplicitSectionGlobal(const GlobalObject *GO, SectionKind Kind, 36 const TargetMachine &TM) const override { 37 return DataSection; 38 } 39 40 MCSection *SelectSectionForGlobal(const GlobalObject *GO, SectionKind Kind, 41 const TargetMachine &TM) const override; 42 }; 43 44 } // end namespace llvm 45 46 #endif // LLVM_LIB_TARGET_NVPTX_NVPTXTARGETOBJECTFILE_H 47