NVPTXTargetObjectFile.h 1.5 KB

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