xref: /freebsd/contrib/llvm-project/llvm/lib/Target/NVPTX/NVPTXTargetObjectFile.h (revision bdd1243df58e60e85101c09001d9812a789b6bc4)
1 //===-- NVPTXTargetObjectFile.h - NVPTX Object Info -------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLVM_LIB_TARGET_NVPTX_NVPTXTARGETOBJECTFILE_H
10 #define LLVM_LIB_TARGET_NVPTX_NVPTXTARGETOBJECTFILE_H
11 
12 #include "llvm/MC/MCSection.h"
13 #include "llvm/MC/SectionKind.h"
14 #include "llvm/Target/TargetLoweringObjectFile.h"
15 
16 namespace llvm {
17 
18 class NVPTXTargetObjectFile : public TargetLoweringObjectFile {
19 public:
20   NVPTXTargetObjectFile() = default;
21 
22   ~NVPTXTargetObjectFile() override;
23 
getSectionForConstant(const DataLayout & DL,SectionKind Kind,const Constant * C,Align & Alignment)24   MCSection *getSectionForConstant(const DataLayout &DL, SectionKind Kind,
25                                    const Constant *C,
26                                    Align &Alignment) const override {
27     return ReadOnlySection;
28   }
29 
getExplicitSectionGlobal(const GlobalObject * GO,SectionKind Kind,const TargetMachine & TM)30   MCSection *getExplicitSectionGlobal(const GlobalObject *GO, SectionKind Kind,
31                                       const TargetMachine &TM) const override {
32     return DataSection;
33   }
34 
35   MCSection *SelectSectionForGlobal(const GlobalObject *GO, SectionKind Kind,
36                                     const TargetMachine &TM) const override;
37 };
38 
39 } // end namespace llvm
40 
41 #endif // LLVM_LIB_TARGET_NVPTX_NVPTXTARGETOBJECTFILE_H
42