LLVM 19.0.0git
SPIRVTargetObjectFile.h
Go to the documentation of this file.
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//===----------------------------------------------------------------------===//
8
9#ifndef LLVM_LIB_TARGET_SPIRV_SPIRVTARGETOBJECTFILE_H
10#define LLVM_LIB_TARGET_SPIRV_SPIRVTARGETOBJECTFILE_H
11
12#include "llvm/MC/MCSection.h"
13#include "llvm/MC/SectionKind.h"
15
16namespace llvm {
17
19public:
20 ~SPIRVTargetObjectFile() override;
21
22 void Initialize(MCContext &ctx, const TargetMachine &TM) override {
24 }
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.
29 const Constant *C,
30 Align &Alignment) const override {
31 return TextSection;
32 }
34 const TargetMachine &TM) const override {
35 return TextSection;
36 }
38 const TargetMachine &TM) const override {
39 return TextSection;
40 }
41};
42
43} // end namespace llvm
44
45#endif // LLVM_LIB_TARGET_SPIRV_SPIRVTARGETOBJECTFILE_H
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
This is an important base class in LLVM.
Definition: Constant.h:41
A parsed version of the target data layout string in and methods for querying it.
Definition: DataLayout.h:110
Context object for machine code objects.
Definition: MCContext.h:76
MCSection * TextSection
Section directive for standard text.
Instances of this class represent a uniqued identifier for a section in the current translation unit.
Definition: MCSection.h:39
MCSection * getExplicitSectionGlobal(const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const override
Targets should implement this method to assign a section to globals with an explicit section specfied...
MCSection * SelectSectionForGlobal(const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const override
void Initialize(MCContext &ctx, const TargetMachine &TM) override
This method must be called before any actual lowering is done.
MCSection * getSectionForConstant(const DataLayout &DL, SectionKind Kind, const Constant *C, Align &Alignment) const override
Given a constant with the SectionKind, return a section that it should be placed in.
SectionKind - This is a simple POD value that classifies the properties of a section.
Definition: SectionKind.h:22
virtual void Initialize(MCContext &ctx, const TargetMachine &TM)
This method must be called before any actual lowering is done.
Primary interface to the complete machine description for the target machine.
Definition: TargetMachine.h:76
@ C
The default llvm calling convention, compatible with C.
Definition: CallingConv.h:34
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
This struct is a compact representation of a valid (non-zero power of two) alignment.
Definition: Alignment.h:39