aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Target/ELFTargetAsmInfo.h
blob: dd311c3116ddd1e7f1600a4fdd4a7a1008ceda43 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//===---- ELFTargetAsmInfo.h - ELF asm properties ---------------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file defines target asm properties related what form asm statements
// should take in general on ELF-based targets
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_ELF_TARGET_ASM_INFO_H
#define LLVM_ELF_TARGET_ASM_INFO_H

#include "llvm/Target/TargetAsmInfo.h"

namespace llvm {
  class GlobalValue;
  class GlobalVariable;
  class Type;

  struct ELFTargetAsmInfo: public TargetAsmInfo {
    explicit ELFTargetAsmInfo(const TargetMachine &TM);

    /// getSectionForMergableConstant - Given a mergable constant with the
    /// specified size and relocation information, return a section that it
    /// should be placed in.
    virtual const Section *
    getSectionForMergableConstant(uint64_t Size, unsigned ReloInfo) const;
    
    
    SectionKind::Kind SectionKindForGlobal(const GlobalValue *GV) const;
    virtual const Section* SelectSectionForGlobal(const GlobalValue *GV) const;
    virtual std::string printSectionFlags(unsigned flags) const;

    const Section* DataRelSection;
    const Section* DataRelLocalSection;
    const Section* DataRelROSection;
    const Section* DataRelROLocalSection;
    
  private:
    const Section* MergeableStringSection(const GlobalVariable *GV) const;
  };
}


#endif // LLVM_ELF_TARGET_ASM_INFO_H