2016-04-21 20:56:45 +02:00
|
|
|
//===-- HexagonTargetObjectFile.h -----------------------------------------===//
|
2011-12-12 22:14:40 +01:00
|
|
|
//
|
2019-01-19 09:50:56 +01:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2011-12-12 22:14:40 +01:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2014-08-13 18:26:38 +02:00
|
|
|
#ifndef LLVM_LIB_TARGET_HEXAGON_HEXAGONTARGETOBJECTFILE_H
|
|
|
|
#define LLVM_LIB_TARGET_HEXAGON_HEXAGONTARGETOBJECTFILE_H
|
2011-12-12 22:14:40 +01:00
|
|
|
|
|
|
|
#include "llvm/CodeGen/TargetLoweringObjectFileImpl.h"
|
|
|
|
#include "llvm/MC/MCSectionELF.h"
|
|
|
|
|
|
|
|
namespace llvm {
|
2020-05-18 17:56:53 +02:00
|
|
|
class Type;
|
2011-12-12 22:14:40 +01:00
|
|
|
|
|
|
|
class HexagonTargetObjectFile : public TargetLoweringObjectFileELF {
|
|
|
|
public:
|
2014-03-02 10:09:27 +01:00
|
|
|
void Initialize(MCContext &Ctx, const TargetMachine &TM) override;
|
2011-12-12 22:14:40 +01:00
|
|
|
|
2016-10-24 21:23:39 +02:00
|
|
|
MCSection *SelectSectionForGlobal(const GlobalObject *GO, SectionKind Kind,
|
2016-09-16 09:33:15 +02:00
|
|
|
const TargetMachine &TM) const override;
|
2016-04-21 20:56:45 +02:00
|
|
|
|
2016-10-24 21:23:39 +02:00
|
|
|
MCSection *getExplicitSectionGlobal(const GlobalObject *GO,
|
|
|
|
SectionKind Kind,
|
2016-09-16 09:33:15 +02:00
|
|
|
const TargetMachine &TM) const override;
|
2016-04-21 20:56:45 +02:00
|
|
|
|
2016-10-24 21:23:39 +02:00
|
|
|
bool isGlobalInSmallSection(const GlobalObject *GO,
|
|
|
|
const TargetMachine &TM) const;
|
2016-04-21 20:56:45 +02:00
|
|
|
|
2018-10-31 16:54:31 +01:00
|
|
|
bool isSmallDataEnabled(const TargetMachine &TM) const;
|
2016-04-21 20:56:45 +02:00
|
|
|
|
|
|
|
unsigned getSmallDataSize() const;
|
|
|
|
|
2017-06-30 22:21:48 +02:00
|
|
|
bool shouldPutJumpTableInFunctionSection(bool UsesLabelDifference,
|
|
|
|
const Function &F) const override;
|
|
|
|
|
2017-07-18 17:31:37 +02:00
|
|
|
const Function *getLutUsedFunction(const GlobalObject *GO) const;
|
|
|
|
|
2016-04-21 20:56:45 +02:00
|
|
|
private:
|
|
|
|
MCSectionELF *SmallDataSection;
|
|
|
|
MCSectionELF *SmallBSSSection;
|
|
|
|
|
|
|
|
unsigned getSmallestAddressableSize(const Type *Ty, const GlobalValue *GV,
|
|
|
|
const TargetMachine &TM) const;
|
|
|
|
|
2016-10-24 21:23:39 +02:00
|
|
|
MCSection *selectSmallSectionForGlobal(const GlobalObject *GO,
|
2016-09-16 09:33:15 +02:00
|
|
|
SectionKind Kind,
|
|
|
|
const TargetMachine &TM) const;
|
2017-07-18 17:31:37 +02:00
|
|
|
|
|
|
|
MCSection *selectSectionForLookupTable(const GlobalObject *GO,
|
|
|
|
const TargetMachine &TM,
|
|
|
|
const Function *Fn) const;
|
2011-12-12 22:14:40 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace llvm
|
|
|
|
|
|
|
|
#endif
|