this is (unfortunately) several changes mixed together:
[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
20 namespace llvm {
21   class GlobalValue;
22   class GlobalVariable;
23   class Type;
24   class Mangler;
25
26   struct DarwinTargetAsmInfo : public TargetAsmInfo {
27     const Section* TextCoalSection;
28     const Section* ConstTextCoalSection;
29     const Section* ConstDataCoalSection;
30     const Section* ConstDataSection;
31     const Section* DataCoalSection;
32     const Section* FourByteConstantSection;
33     const Section* EightByteConstantSection;
34     const Section* SixteenByteConstantSection;
35
36     explicit DarwinTargetAsmInfo(const TargetMachine &TM);
37     virtual const Section* SelectSectionForGlobal(const GlobalValue *GV,
38                                                   SectionKind::Kind Kind) const;
39     virtual bool emitUsedDirectiveFor(const GlobalValue *GV,
40                                       Mangler *Mang) const;
41
42     
43     virtual const Section *
44     getSectionForMergableConstant(uint64_t Size, unsigned ReloInfo) const;
45     
46   private:
47     const Section* MergeableStringSection(const GlobalVariable *GV) const;
48   };
49 }
50
51
52 #endif // LLVM_DARWIN_TARGET_ASM_INFO_H