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

1

2

3

4

5

6

7

8

16#include

17

18using namespace llvm;

19

20

21

25 return false;

26

28}

29

31 if (Name.find_first_not_of("0123456789_."

32 "abcdefghijklmnopqrstuvwxyz"

33 "ABCDEFGHIJKLMNOPQRSTUVWXYZ") == Name.npos) {

35 return;

36 }

37 OS << '"';

38 for (const char *B = Name.begin(), *E = Name.end(); B < E; ++B) {

39 if (*B == '"')

40 OS << "\\\"";

41 else if (*B != '\\')

43 else if (B + 1 == E)

44 OS << "\\\\";

45 else {

46 OS << B[0] << B[1];

47 ++B;

48 }

49 }

50 OS << '"';

51}

52

58 if (Subsection)

59 OS << '\t' << Subsection;

60 OS << '\n';

61 return;

62 }

63

64 OS << "\t.section\t";

66

67

71 OS << ",#alloc";

73 OS << ",#execinstr";

75 OS << ",#write";

77 OS << ",#exclude";

79 OS << ",#tls";

80 OS << '\n';

81 return;

82 }

83

84 OS << ",\"";

86 OS << 'a';

88 OS << 'e';

90 OS << 'x';

92 OS << 'w';

94 OS << 'M';

96 OS << 'S';

98 OS << 'T';

100 OS << 'o';

102 OS << 'G';

104 OS << 'R';

105

106

107 if (T.isOSSolaris())

109 OS << 'R';

110

111

115 OS << 'c';

117 OS << 'd';

118 } else if (T.isARM() || T.isThumb()) {

120 OS << 'y';

123 OS << 's';

126 OS << 'l';

127 }

128

129 OS << '"';

130

131 OS << ',';

132

133

135 OS << '%';

136 else

137 OS << '@';

138

140 OS << "init_array";

142 OS << "fini_array";

144 OS << "preinit_array";

146 OS << "nobits";

148 OS << "note";

150 OS << "progbits";

152 OS << "unwind";

154

155

156 OS << "0x7000001e";

158 OS << "llvm_odrtab";

160 OS << "llvm_linker_options";

162 OS << "llvm_call_graph_profile";

164 OS << "llvm_dependent_libraries";

166 OS << "llvm_sympart";

168 OS << "llvm_bb_addr_map";

170 OS << "llvm_bb_addr_map_v0";

172 OS << "llvm_offloading";

174 OS << "llvm_lto";

176 OS << "llvm_jt_sizes";

177 else

179

180 if (EntrySize) {

182 OS << "," << EntrySize;

183 }

184

186 OS << ",";

187 if (LinkedToSym)

189 else

190 OS << '0';

191 }

192

194 OS << ",";

195 printName(OS, Group.getPointer()->getName());

197 OS << ",comdat";

198 }

199

201 OS << ",unique," << UniqueID;

202

203 OS << '\n';

204

205 if (Subsection) {

206 OS << "\t.subsection\t" << Subsection;

207 OS << '\n';

208 }

209}

210

213}

214

static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")

static void printName(raw_ostream &OS, StringRef Name)

assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())

This class is intended to be used as a base class for asm properties and features specific to the tar...

bool usesSunStyleELFSectionSwitchSyntax() const

StringRef getCommentString() const

virtual bool shouldOmitSectionDirective(StringRef SectionName) const

Return true if the .section directive should be omitted when emitting SectionName.

unsigned getFlags() const

void printSwitchToSection(const MCAsmInfo &MAI, const Triple &T, raw_ostream &OS, uint32_t Subsection) const override

StringRef getVirtualSectionKind() const override

bool shouldOmitSectionDirective(StringRef Name, const MCAsmInfo &MAI) const

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

bool useCodeAlign() const override

Return true if a .align directive should use "optimized nops" to fill instead of 0s.

StringRef getName() const

StringRef getName() const

getName - Get the symbol name.

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

Triple - Helper class for working with autoconf configuration names.

static Twine utohexstr(const uint64_t &Val)

The instances of the Type class are immutable: once they are created, they are never changed.

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

@ SHT_LLVM_BB_ADDR_MAP_V0

@ SHT_LLVM_DEPENDENT_LIBRARIES

@ SHT_LLVM_LINKER_OPTIONS

@ SHT_LLVM_CALL_GRAPH_PROFILE

@ XCORE_SHF_DP_SECTION

All sections with the "d" flag are grouped together by the linker to form the data section and the dp...

@ XCORE_SHF_CP_SECTION

All sections with the "c" flag are grouped together by the linker to form the constant pool and the c...

This is an optimization pass for GlobalISel generic memory operations.