[llvm-shlib] Fix the version naming style of libLLVM for Windows (#85710)
[llvm-project.git] / llvm / lib / Target / SPIRV / SPIRVTargetObjectFile.h
blob00c456971ef107e2bac4e5db9c91c9e7e52d2e40
1 //===-- SPIRVTargetObjectFile.h - SPIRV 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 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_LIB_TARGET_SPIRV_SPIRVTARGETOBJECTFILE_H
10 #define LLVM_LIB_TARGET_SPIRV_SPIRVTARGETOBJECTFILE_H
12 #include "llvm/MC/MCSection.h"
13 #include "llvm/MC/SectionKind.h"
14 #include "llvm/Target/TargetLoweringObjectFile.h"
16 namespace llvm {
18 class SPIRVTargetObjectFile : public TargetLoweringObjectFile {
19 public:
20 ~SPIRVTargetObjectFile() override;
22 void Initialize(MCContext &ctx, const TargetMachine &TM) override {
23 TargetLoweringObjectFile::Initialize(ctx, TM);
25 // All words in a SPIR-V module (excepting the first 5 ones) are a linear
26 // sequence of instructions in a specific order. We put all the instructions
27 // in the single text section.
28 MCSection *getSectionForConstant(const DataLayout &DL, SectionKind Kind,
29 const Constant *C,
30 Align &Alignment) const override {
31 return TextSection;
33 MCSection *getExplicitSectionGlobal(const GlobalObject *GO, SectionKind Kind,
34 const TargetMachine &TM) const override {
35 return TextSection;
37 MCSection *SelectSectionForGlobal(const GlobalObject *GO, SectionKind Kind,
38 const TargetMachine &TM) const override {
39 return TextSection;
43 } // end namespace llvm
45 #endif // LLVM_LIB_TARGET_SPIRV_SPIRVTARGETOBJECTFILE_H