blob: b5382340a6168c998104ceecea5a6f3946840039 [file] [log] [blame]
Dan Gohman10e730a2015-06-29 23:51:55 +00001//===-- WebAssemblyTargetObjectFile.h - WebAssembly Object Info -*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9///
10/// \file
11/// \brief This file declares the WebAssembly-specific subclass of
12/// TargetLoweringObjectFile.
13///
14//===----------------------------------------------------------------------===//
15
16#ifndef LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYTARGETOBJECTFILE_H
17#define LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYTARGETOBJECTFILE_H
18
19#include "llvm/Target/TargetLoweringObjectFile.h"
20
21namespace llvm {
22
23class GlobalVariable;
24
25class WebAssemblyTargetObjectFile final : public TargetLoweringObjectFile {
26public:
27 WebAssemblyTargetObjectFile() {
28 TextSection = nullptr;
29 DataSection = nullptr;
30 BSSSection = nullptr;
31 ReadOnlySection = nullptr;
32
33 StaticCtorSection = nullptr;
34 StaticDtorSection = nullptr;
35 LSDASection = nullptr;
36 EHFrameSection = nullptr;
37 DwarfAbbrevSection = nullptr;
38 DwarfInfoSection = nullptr;
39 DwarfLineSection = nullptr;
40 DwarfFrameSection = nullptr;
41 DwarfPubTypesSection = nullptr;
42 DwarfDebugInlineSection = nullptr;
43 DwarfStrSection = nullptr;
44 DwarfLocSection = nullptr;
45 DwarfARangesSection = nullptr;
46 DwarfRangesSection = nullptr;
47 }
48
Mehdi Amini5c0fa582015-07-16 06:04:17 +000049 MCSection *getSectionForConstant(const DataLayout &DL, SectionKind Kind,
Dan Gohman10e730a2015-06-29 23:51:55 +000050 const Constant *C) const override {
51 return ReadOnlySection;
52 }
53
54 MCSection *getExplicitSectionGlobal(const GlobalValue *GV, SectionKind Kind,
55 Mangler &Mang,
56 const TargetMachine &TM) const override {
57 return DataSection;
58 }
59
60 MCSection *SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
61 Mangler &Mang,
62 const TargetMachine &TM) const override;
63};
64
65} // end namespace llvm
66
67#endif