It's not legal to output a GV in a coalesced section if it's used in an ARM PIC relat...
[oota-llvm.git] / include / llvm / Target / DarwinTargetAsmInfo.h
1 //===---- DarwinTargetAsmInfo.h - Darwin asm properties ---------*- 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 // This file defines target asm properties related what form asm statements
11 // should take in general on Darwin-based targets
12 //
13 //===----------------------------------------------------------------------===//
14
15 #ifndef LLVM_DARWIN_TARGET_ASM_INFO_H
16 #define LLVM_DARWIN_TARGET_ASM_INFO_H
17
18 #include "llvm/Target/TargetAsmInfo.h"
19 #include "llvm/Target/TargetMachine.h"
20
21 namespace llvm {
22   class GlobalValue;
23   class GlobalVariable;
24   class Type;
25
26   struct DarwinTargetAsmInfo: public virtual TargetAsmInfo {
27     const Section* TextCoalSection;
28     const Section* ConstDataCoalSection;
29     const Section* ConstDataSection;
30     const Section* DataCoalSection;
31
32     explicit DarwinTargetAsmInfo(const TargetMachine &TM);
33     virtual const Section* SelectSectionForGlobal(const GlobalValue *GV,
34                                                  bool NoCoalesce = false) const;
35     virtual std::string UniqueSectionForGlobal(const GlobalValue* GV,
36                                                SectionKind::Kind kind) const;
37     const Section* MergeableConstSection(const GlobalVariable *GV) const;
38     const Section* MergeableConstSection(const Type *Ty) const;
39     const Section* MergeableStringSection(const GlobalVariable *GV) const;
40     const Section* SelectSectionForMachineConst(const Type *Ty) const;
41   protected:
42     const TargetMachine* DTM;
43   };
44 }
45
46
47 #endif // LLVM_DARWIN_TARGET_ASM_INFO_H