LLVM: lib/MC/MCAsmInfoCOFF.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

21#include

22

23using namespace llvm;

24

25void MCAsmInfoCOFF::anchor() {}

26

28

29

36

37

40

41

44

45

47

48

49

51

52

53

54

56}

57

58bool MCAsmInfoCOFF::useCodeAlign(const MCSection &Sec) const {

60}

61

62void MCAsmInfoMicrosoft::anchor() {}

63

65

66void MCAsmInfoGNUCOFF::anchor() {}

67

77

79 if (COMDATSymbol || isUnique())

80 return false;

81

82

83 if (Name == ".text" || Name == ".data" || Name == ".bss")

84 return true;

85

86 return false;

87}

88

90 assert(Selection != 0 && "invalid COMDAT selection type");

91 this->Selection = Selection;

93}

94

95void MCAsmInfoCOFF::printSwitchToSection(const MCSection &Section, uint32_t,

98 auto &Sec = static_cast<const MCSectionCOFF &>(Section);

99

100 if (Sec.shouldOmitSectionDirective(Sec.getName())) {

101 OS << '\t' << Sec.getName() << '\n';

102 return;

103 }

104

105 OS << "\t.section\t" << Sec.getName() << ",\"";

107 OS << 'd';

109 OS << 'b';

111 OS << 'x';

113 OS << 'w';

115 OS << 'r';

116 else

117 OS << 'y';

119 OS << 'n';

121 OS << 's';

123 !Sec.isImplicitlyDiscardable(Sec.getName()))

124 OS << 'D';

126 OS << 'i';

127 OS << '"';

128

129

130 if (Sec.isUnique() && !Sec.COMDATSymbol)

131 OS << ",unique," << Sec.UniqueID;

132

134 if (Sec.COMDATSymbol)

135 OS << ",";

136 else

137 OS << "\n\t.linkonce\t";

138 switch (Sec.Selection) {

140 OS << "one_only";

141 break;

143 OS << "discard";

144 break;

146 OS << "same_size";

147 break;

149 OS << "same_contents";

150 break;

152 OS << "associative";

153 break;

155 OS << "largest";

156 break;

158 OS << "newest";

159 break;

160 default:

161 assert(false && "unsupported COFF selection type");

162 break;

163 }

164 if (Sec.COMDATSymbol) {

165 OS << ",";

166 Sec.COMDATSymbol->print(OS, this);

167 }

168 }

169

170 if (Sec.isUnique() && Sec.COMDATSymbol)

171 OS << ",unique," << Sec.UniqueID;

172

173 OS << '\n';

174}

assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")

MCAsmInfoCOFF()

Definition MCAsmInfoCOFF.cpp:27

MCAsmInfoGNUCOFF()

Definition MCAsmInfoCOFF.cpp:68

bool NeedsDwarfSectionOffsetDirective

MCSymbolAttr ProtectedVisibilityAttr

This attribute, if not MCSA_Invalid, is used to declare a symbol as having protected visibility.

bool AvoidWeakIfComdat

True if we should mark symbols as global instead of weak, for weak*‍/linkonce*, if the symbol has a c...

bool UseLogicalShr

True if the integrated assembler should interpret 'a >> b' constant expressions as logical rather tha...

LCOMM::LCOMMType LCOMMDirectiveAlignmentType

Describes if the .lcomm directive for the target supports an alignment argument and how it is interpr...

bool HasCOFFComdatConstants

True if this is a non-GNU COFF target.

const char * WeakRefDirective

This directive, if non-null, is used to declare a global as being a weak undefined symbol.

bool HasDotTypeDotSizeDirective

True if the target has .type and .size directives, this is true for most ELF targets.

bool HasCOFFAssociativeComdats

True if this is a non-GNU COFF target.

bool SupportsDebugInformation

True if target supports emission of debugging information.

MCSymbolAttr HiddenDeclarationVisibilityAttr

This attribute, if not MCSA_Invalid, is used to declare an undefined symbol as having hidden visibili...

bool HasSingleParameterDotFile

True if the target has a single parameter .file directive, this is true for ELF targets.

bool COMMDirectiveAlignmentIsInBytes

True is .comm's and .lcomms optional alignment is to be specified in bytes instead of log2(n).

MCSymbolAttr HiddenVisibilityAttr

This attribute, if not MCSA_Invalid, is used to declare a symbol as having hidden visibility.

This represents a section on Windows.

bool shouldOmitSectionDirective(StringRef Name) const

Decides whether a '.section' directive should be printed before the section name.

Definition MCAsmInfoCOFF.cpp:78

void setSelection(int Selection) const

Definition MCAsmInfoCOFF.cpp:89

Instances of this class represent a uniqued identifier for a section in the current translation unit.

StringRef getName() const

StringRef - Represent a constant reference to a string, i.e.

Triple - Helper class for working with autoconf configuration names.

This class implements an extremely fast bulk output stream that can only output to a stream.

@ IMAGE_SCN_CNT_UNINITIALIZED_DATA

@ IMAGE_SCN_MEM_DISCARDABLE

@ IMAGE_SCN_CNT_INITIALIZED_DATA

@ IMAGE_COMDAT_SELECT_NODUPLICATES

@ IMAGE_COMDAT_SELECT_LARGEST

@ IMAGE_COMDAT_SELECT_NEWEST

@ IMAGE_COMDAT_SELECT_SAME_SIZE

@ IMAGE_COMDAT_SELECT_ASSOCIATIVE

@ IMAGE_COMDAT_SELECT_EXACT_MATCH

@ IMAGE_COMDAT_SELECT_ANY

This is an optimization pass for GlobalISel generic memory operations.

@ MCSA_Invalid

Not a valid directive.