LLVM  10.0.0svn
RISCVTargetObjectFile.h
Go to the documentation of this file.
1 //===-- RISCVTargetObjectFile.h - RISCV 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_RISCV_RISCVTARGETOBJECTFILE_H
10 #define LLVM_LIB_TARGET_RISCV_RISCVTARGETOBJECTFILE_H
11 
13 
14 namespace llvm {
15 class RISCVTargetMachine;
16 
17 /// This implementation is used for RISCV ELF targets.
19  MCSection *SmallDataSection;
20  MCSection *SmallBSSSection;
21  unsigned SSThreshold = 8;
22 
23 public:
24  void Initialize(MCContext &Ctx, const TargetMachine &TM) override;
25 
26  /// Return true if this global address should be placed into small data/bss
27  /// section.
28  bool isGlobalInSmallSection(const GlobalObject *GO,
29  const TargetMachine &TM) const;
30 
32  const TargetMachine &TM) const override;
33 
34  /// Return true if this constant should be placed into small data section.
35  bool isConstantInSmallSection(const DataLayout &DL, const Constant *CN) const;
36 
38  const Constant *C,
39  unsigned &Align) const override;
40 
41  void getModuleMetadata(Module &M) override;
42 
43  bool isInSmallSection(uint64_t Size) const;
44 };
45 
46 } // end namespace llvm
47 
48 #endif
uint64_t CallInst * C
Instances of this class represent a uniqued identifier for a section in the current translation unit...
Definition: MCSection.h:38
A parsed version of the target data layout string in and methods for querying it. ...
Definition: DataLayout.h:110
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
This class represents lattice values for constants.
Definition: AllocatorList.h:23
A Module instance is used to store all the information related to an LLVM module. ...
Definition: Module.h:65
MCSection * getSectionForConstant(const DataLayout &DL, SectionKind Kind, const Constant *C, unsigned &Align) const override
Given a constant with the SectionKind, return a section that it should be placed in.
bool isGlobalInSmallSection(const GlobalObject *GO, const TargetMachine &TM) const
Return true if this global address should be placed into small data/bss section.
Context object for machine code objects.
Definition: MCContext.h:64
void getModuleMetadata(Module &M) override
Get the module-level metadata that the platform cares about.
bool isConstantInSmallSection(const DataLayout &DL, const Constant *CN) const
Return true if this constant should be placed into small data section.
MCSection * SelectSectionForGlobal(const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const override
This is an important base class in LLVM.
Definition: Constant.h:41
SectionKind - This is a simple POD value that classifies the properties of a section.
Definition: SectionKind.h:22
uint32_t Size
Definition: Profile.cpp:46
Primary interface to the complete machine description for the target machine.
Definition: TargetMachine.h:65
This implementation is used for RISCV ELF targets.
bool isInSmallSection(uint64_t Size) const
void Initialize(MCContext &Ctx, const TargetMachine &TM) override
This method must be called before any actual lowering is done.