NVPTXTargetObjectFile.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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() = default;
  17. ~NVPTXTargetObjectFile() override;
  18. MCSection *getSectionForConstant(const DataLayout &DL, SectionKind Kind,
  19. const Constant *C,
  20. Align &Alignment) const override {
  21. return ReadOnlySection;
  22. }
  23. MCSection *getExplicitSectionGlobal(const GlobalObject *GO, SectionKind Kind,
  24. const TargetMachine &TM) const override {
  25. return DataSection;
  26. }
  27. MCSection *SelectSectionForGlobal(const GlobalObject *GO, SectionKind Kind,
  28. const TargetMachine &TM) const override;
  29. };
  30. } // end namespace llvm
  31. #endif // LLVM_LIB_TARGET_NVPTX_NVPTXTARGETOBJECTFILE_H