LLVM  8.0.1
HexagonTargetObjectFile.cpp
Go to the documentation of this file.
1 //===-- HexagonTargetObjectFile.cpp ---------------------------------------===//
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 contains the declarations of the HexagonTargetAsmInfo properties.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #define DEBUG_TYPE "hexagon-sdata"
15 
17 #include "llvm/ADT/SmallString.h"
18 #include "llvm/ADT/StringRef.h"
19 #include "llvm/ADT/Twine.h"
20 #include "llvm/BinaryFormat/ELF.h"
21 #include "llvm/IR/DataLayout.h"
22 #include "llvm/IR/DerivedTypes.h"
23 #include "llvm/IR/GlobalObject.h"
24 #include "llvm/IR/GlobalValue.h"
25 #include "llvm/IR/GlobalVariable.h"
26 #include "llvm/IR/Type.h"
27 #include "llvm/MC/MCContext.h"
28 #include "llvm/MC/SectionKind.h"
29 #include "llvm/Support/Casting.h"
31 #include "llvm/Support/Debug.h"
34 
35 using namespace llvm;
36 
37 static cl::opt<unsigned> SmallDataThreshold("hexagon-small-data-threshold",
38  cl::init(8), cl::Hidden,
39  cl::desc("The maximum size of an object in the sdata section"));
40 
41 static cl::opt<bool> NoSmallDataSorting("mno-sort-sda", cl::init(false),
42  cl::Hidden, cl::desc("Disable small data sections sorting"));
43 
44 static cl::opt<bool> StaticsInSData("hexagon-statics-in-small-data",
46  cl::desc("Allow static variables in .sdata"));
47 
48 static cl::opt<bool> TraceGVPlacement("trace-gv-placement",
49  cl::Hidden, cl::init(false),
50  cl::desc("Trace global value placement"));
51 
52 static cl::opt<bool>
53  EmitJtInText("hexagon-emit-jt-text", cl::Hidden, cl::init(false),
54  cl::desc("Emit hexagon jump tables in function section"));
55 
56 static cl::opt<bool>
57  EmitLutInText("hexagon-emit-lut-text", cl::Hidden, cl::init(false),
58  cl::desc("Emit hexagon lookup tables in function section"));
59 
60 // TraceGVPlacement controls messages for all builds. For builds with assertions
61 // (debug or release), messages are also controlled by the usual debug flags
62 // (e.g. -debug and -debug-only=globallayout)
63 #define TRACE_TO(s, X) s << X
64 #ifdef NDEBUG
65 #define TRACE(X) \
66  do { \
67  if (TraceGVPlacement) { \
68  TRACE_TO(errs(), X); \
69  } \
70  } while (false)
71 #else
72 #define TRACE(X) \
73  do { \
74  if (TraceGVPlacement) { \
75  TRACE_TO(errs(), X); \
76  } else { \
77  LLVM_DEBUG(TRACE_TO(dbgs(), X)); \
78  } \
79  } while (false)
80 #endif
81 
82 // Returns true if the section name is such that the symbol will be put
83 // in a small data section.
84 // For instance, global variables with section attributes such as ".sdata"
85 // ".sdata.*", ".sbss", and ".sbss.*" will go into small data.
86 static bool isSmallDataSection(StringRef Sec) {
87  // sectionName is either ".sdata" or ".sbss". Looking for an exact match
88  // obviates the need for checks for section names such as ".sdatafoo".
89  if (Sec.equals(".sdata") || Sec.equals(".sbss") || Sec.equals(".scommon"))
90  return true;
91  // If either ".sdata." or ".sbss." is a substring of the section name
92  // then put the symbol in small data.
93  return Sec.find(".sdata.") != StringRef::npos ||
94  Sec.find(".sbss.") != StringRef::npos ||
95  Sec.find(".scommon.") != StringRef::npos;
96 }
97 
98 static const char *getSectionSuffixForSize(unsigned Size) {
99  switch (Size) {
100  default:
101  return "";
102  case 1:
103  return ".1";
104  case 2:
105  return ".2";
106  case 4:
107  return ".4";
108  case 8:
109  return ".8";
110  }
111 }
112 
114  const TargetMachine &TM) {
117 
118  SmallDataSection =
122  SmallBSSSection =
126 }
127 
129  const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const {
130  TRACE("[SelectSectionForGlobal] GO(" << GO->getName() << ") ");
131  TRACE("input section(" << GO->getSection() << ") ");
132 
133  TRACE((GO->hasPrivateLinkage() ? "private_linkage " : "")
134  << (GO->hasLocalLinkage() ? "local_linkage " : "")
135  << (GO->hasInternalLinkage() ? "internal " : "")
136  << (GO->hasExternalLinkage() ? "external " : "")
137  << (GO->hasCommonLinkage() ? "common_linkage " : "")
138  << (GO->hasCommonLinkage() ? "common " : "" )
139  << (Kind.isCommon() ? "kind_common " : "" )
140  << (Kind.isBSS() ? "kind_bss " : "" )
141  << (Kind.isBSSLocal() ? "kind_bss_local " : "" ));
142 
143  // If the lookup table is used by more than one function, do not place
144  // it in text section.
145  if (EmitLutInText && GO->getName().startswith("switch.table")) {
146  if (const Function *Fn = getLutUsedFunction(GO))
147  return selectSectionForLookupTable(GO, TM, Fn);
148  }
149 
150  if (isGlobalInSmallSection(GO, TM))
151  return selectSmallSectionForGlobal(GO, Kind, TM);
152 
153  if (Kind.isCommon()) {
154  // This is purely for LTO+Linker Script because commons don't really have a
155  // section. However, the BitcodeSectionWriter pass will query for the
156  // sections of commons (and the linker expects us to know their section) so
157  // we'll return one here.
158  return BSSSection;
159  }
160 
161  TRACE("default_ELF_section\n");
162  // Otherwise, we work the same as ELF.
164 }
165 
167  const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const {
168  TRACE("[getExplicitSectionGlobal] GO(" << GO->getName() << ") from("
169  << GO->getSection() << ") ");
170  TRACE((GO->hasPrivateLinkage() ? "private_linkage " : "")
171  << (GO->hasLocalLinkage() ? "local_linkage " : "")
172  << (GO->hasInternalLinkage() ? "internal " : "")
173  << (GO->hasExternalLinkage() ? "external " : "")
174  << (GO->hasCommonLinkage() ? "common_linkage " : "")
175  << (GO->hasCommonLinkage() ? "common " : "" )
176  << (Kind.isCommon() ? "kind_common " : "" )
177  << (Kind.isBSS() ? "kind_bss " : "" )
178  << (Kind.isBSSLocal() ? "kind_bss_local " : "" ));
179 
180  if (GO->hasSection()) {
181  StringRef Section = GO->getSection();
182  if (Section.find(".access.text.group") != StringRef::npos)
185  if (Section.find(".access.data.group") != StringRef::npos)
188  }
189 
190  if (isGlobalInSmallSection(GO, TM))
191  return selectSmallSectionForGlobal(GO, Kind, TM);
192 
193  // Otherwise, we work the same as ELF.
194  TRACE("default_ELF_section\n");
196 }
197 
198 /// Return true if this global value should be placed into small data/bss
199 /// section.
201  const TargetMachine &TM) const {
202  bool HaveSData = isSmallDataEnabled(TM);
203  if (!HaveSData)
204  LLVM_DEBUG(dbgs() << "Small-data allocation is disabled, but symbols "
205  "may have explicit section assignments...\n");
206  // Only global variables, not functions.
207  LLVM_DEBUG(dbgs() << "Checking if value is in small-data, -G"
208  << SmallDataThreshold << ": \"" << GO->getName() << "\": ");
209  const GlobalVariable *GVar = dyn_cast<GlobalVariable>(GO);
210  if (!GVar) {
211  LLVM_DEBUG(dbgs() << "no, not a global variable\n");
212  return false;
213  }
214 
215  // Globals with external linkage that have an original section set must be
216  // emitted to that section, regardless of whether we would put them into
217  // small data or not. This is how we can support mixing -G0/-G8 in LTO.
218  if (GVar->hasSection()) {
219  bool IsSmall = isSmallDataSection(GVar->getSection());
220  LLVM_DEBUG(dbgs() << (IsSmall ? "yes" : "no")
221  << ", has section: " << GVar->getSection() << '\n');
222  return IsSmall;
223  }
224 
225  // If sdata is disabled, stop the checks here.
226  if (!HaveSData) {
227  LLVM_DEBUG(dbgs() << "no, small-data allocation is disabled\n");
228  return false;
229  }
230 
231  if (GVar->isConstant()) {
232  LLVM_DEBUG(dbgs() << "no, is a constant\n");
233  return false;
234  }
235 
236  bool IsLocal = GVar->hasLocalLinkage();
237  if (!StaticsInSData && IsLocal) {
238  LLVM_DEBUG(dbgs() << "no, is static\n");
239  return false;
240  }
241 
242  Type *GType = GVar->getType();
243  if (PointerType *PT = dyn_cast<PointerType>(GType))
244  GType = PT->getElementType();
245 
246  if (isa<ArrayType>(GType)) {
247  LLVM_DEBUG(dbgs() << "no, is an array\n");
248  return false;
249  }
250 
251  // If the type is a struct with no body provided, treat is conservatively.
252  // There cannot be actual definitions of object of such a type in this CU
253  // (only references), so assuming that they are not in sdata is safe. If
254  // these objects end up in the sdata, the references will still be valid.
255  if (StructType *ST = dyn_cast<StructType>(GType)) {
256  if (ST->isOpaque()) {
257  LLVM_DEBUG(dbgs() << "no, has opaque type\n");
258  return false;
259  }
260  }
261 
262  unsigned Size = GVar->getParent()->getDataLayout().getTypeAllocSize(GType);
263  if (Size == 0) {
264  LLVM_DEBUG(dbgs() << "no, has size 0\n");
265  return false;
266  }
267  if (Size > SmallDataThreshold) {
268  LLVM_DEBUG(dbgs() << "no, size exceeds sdata threshold: " << Size << '\n');
269  return false;
270  }
271 
272  LLVM_DEBUG(dbgs() << "yes\n");
273  return true;
274 }
275 
277  const {
278  return SmallDataThreshold > 0 && !TM.isPositionIndependent();
279 }
280 
282  return SmallDataThreshold;
283 }
284 
286  bool UsesLabelDifference, const Function &F) const {
287  return EmitJtInText;
288 }
289 
290 /// Descends any type down to "elementary" components,
291 /// discovering the smallest addressable one.
292 /// If zero is returned, declaration will not be modified.
293 unsigned HexagonTargetObjectFile::getSmallestAddressableSize(const Type *Ty,
294  const GlobalValue *GV, const TargetMachine &TM) const {
295  // Assign the smallest element access size to the highest
296  // value which assembler can handle.
297  unsigned SmallestElement = 8;
298 
299  if (!Ty)
300  return 0;
301  switch (Ty->getTypeID()) {
302  case Type::StructTyID: {
303  const StructType *STy = cast<const StructType>(Ty);
304  for (auto &E : STy->elements()) {
305  unsigned AtomicSize = getSmallestAddressableSize(E, GV, TM);
306  if (AtomicSize < SmallestElement)
307  SmallestElement = AtomicSize;
308  }
309  return (STy->getNumElements() == 0) ? 0 : SmallestElement;
310  }
311  case Type::ArrayTyID: {
312  const ArrayType *ATy = cast<const ArrayType>(Ty);
313  return getSmallestAddressableSize(ATy->getElementType(), GV, TM);
314  }
315  case Type::VectorTyID: {
316  const VectorType *PTy = cast<const VectorType>(Ty);
317  return getSmallestAddressableSize(PTy->getElementType(), GV, TM);
318  }
319  case Type::PointerTyID:
320  case Type::HalfTyID:
321  case Type::FloatTyID:
322  case Type::DoubleTyID:
323  case Type::IntegerTyID: {
324  const DataLayout &DL = GV->getParent()->getDataLayout();
325  // It is unfortunate that DL's function take non-const Type*.
326  return DL.getTypeAllocSize(const_cast<Type*>(Ty));
327  }
328  case Type::FunctionTyID:
329  case Type::VoidTyID:
330  case Type::X86_FP80TyID:
331  case Type::FP128TyID:
332  case Type::PPC_FP128TyID:
333  case Type::LabelTyID:
334  case Type::MetadataTyID:
335  case Type::X86_MMXTyID:
336  case Type::TokenTyID:
337  return 0;
338  }
339 
340  return 0;
341 }
342 
343 MCSection *HexagonTargetObjectFile::selectSmallSectionForGlobal(
344  const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const {
345  const Type *GTy = GO->getType()->getElementType();
346  unsigned Size = getSmallestAddressableSize(GTy, GO, TM);
347 
348  // If we have -ffunction-section or -fdata-section then we should emit the
349  // global value to a unique section specifically for it... even for sdata.
350  bool EmitUniquedSection = TM.getDataSections();
351 
352  TRACE("Small data. Size(" << Size << ")");
353  // Handle Small Section classification here.
354  if (Kind.isBSS() || Kind.isBSSLocal()) {
355  // If -mno-sort-sda is not set, find out smallest accessible entity in
356  // declaration and add it to the section name string.
357  // Note. It does not track the actual usage of the value, only its de-
358  // claration. Also, compiler adds explicit pad fields to some struct
359  // declarations - they are currently counted towards smallest addres-
360  // sable entity.
361  if (NoSmallDataSorting) {
362  TRACE(" default sbss\n");
363  return SmallBSSSection;
364  }
365 
366  StringRef Prefix(".sbss");
367  SmallString<128> Name(Prefix);
368  Name.append(getSectionSuffixForSize(Size));
369 
370  if (EmitUniquedSection) {
371  Name.append(".");
372  Name.append(GO->getName());
373  }
374  TRACE(" unique sbss(" << Name << ")\n");
375  return getContext().getELFSection(Name.str(), ELF::SHT_NOBITS,
377  }
378 
379  if (Kind.isCommon()) {
380  // This is purely for LTO+Linker Script because commons don't really have a
381  // section. However, the BitcodeSectionWriter pass will query for the
382  // sections of commons (and the linker expects us to know their section) so
383  // we'll return one here.
384  if (NoSmallDataSorting)
385  return BSSSection;
386 
387  Twine Name = Twine(".scommon") + getSectionSuffixForSize(Size);
388  TRACE(" small COMMON (" << Name << ")\n");
389 
390  return getContext().getELFSection(Name.str(), ELF::SHT_NOBITS,
393  }
394 
395  // We could have changed sdata object to a constant... in this
396  // case the Kind could be wrong for it.
397  if (Kind.isMergeableConst()) {
398  TRACE(" const_object_as_data ");
399  const GlobalVariable *GVar = dyn_cast<GlobalVariable>(GO);
400  if (GVar->hasSection() && isSmallDataSection(GVar->getSection()))
401  Kind = SectionKind::getData();
402  }
403 
404  if (Kind.isData()) {
405  if (NoSmallDataSorting) {
406  TRACE(" default sdata\n");
407  return SmallDataSection;
408  }
409 
410  StringRef Prefix(".sdata");
411  SmallString<128> Name(Prefix);
412  Name.append(getSectionSuffixForSize(Size));
413 
414  if (EmitUniquedSection) {
415  Name.append(".");
416  Name.append(GO->getName());
417  }
418  TRACE(" unique sdata(" << Name << ")\n");
421  }
422 
423  TRACE("default ELF section\n");
424  // Otherwise, we work the same as ELF.
426 }
427 
428 // Return the function that uses the lookup table. If there are more
429 // than one live function that uses this look table, bail out and place
430 // the lookup table in default section.
431 const Function *
433  const Function *ReturnFn = nullptr;
434  for (auto U : GO->users()) {
435  // validate each instance of user to be a live function.
436  auto *I = dyn_cast<Instruction>(U);
437  if (!I)
438  continue;
439  auto *Bb = I->getParent();
440  if (!Bb)
441  continue;
442  auto *UserFn = Bb->getParent();
443  if (!ReturnFn)
444  ReturnFn = UserFn;
445  else if (ReturnFn != UserFn)
446  return nullptr;
447  }
448  return ReturnFn;
449 }
450 
451 MCSection *HexagonTargetObjectFile::selectSectionForLookupTable(
452  const GlobalObject *GO, const TargetMachine &TM, const Function *Fn) const {
453 
455  // If the function has explicit section, place the lookup table in this
456  // explicit section.
457  if (Fn->hasSection())
458  return getExplicitSectionGlobal(Fn, Kind, TM);
459 
460  const auto *FuncObj = dyn_cast<GlobalObject>(Fn);
461  return SelectSectionForGlobal(FuncObj, Kind, TM);
462 }
bool isGlobalInSmallSection(const GlobalObject *GO, const TargetMachine &TM) const
Return true if this global value should be placed into small data/bss section.
StringRef getSection() const
Get the custom section of this global if it has one.
Definition: GlobalObject.h:90
Instances of this class represent a uniqued identifier for a section in the current translation unit...
Definition: MCSection.h:39
7: Labels
Definition: Type.h:64
A parsed version of the target data layout string in and methods for querying it. ...
Definition: DataLayout.h:111
static SectionKind getData()
Definition: SectionKind.h:202
bool hasLocalLinkage() const
Definition: GlobalValue.h:436
MCSection * getExplicitSectionGlobal(const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const override
Targets should implement this method to assign a section to globals with an explicit section specfied...
bool hasPrivateLinkage() const
Definition: GlobalValue.h:435
This class represents lattice values for constants.
Definition: AllocatorList.h:24
2: 32-bit floating point type
Definition: Type.h:59
ArrayRef< Type * > const elements() const
Definition: DerivedTypes.h:305
unsigned getNumElements() const
Random access to the elements.
Definition: DerivedTypes.h:313
static const char * getSectionSuffixForSize(unsigned Size)
13: Structures
Definition: Type.h:73
F(f)
4: 80-bit floating point type (X87)
Definition: Type.h:61
1: 16-bit floating point type
Definition: Type.h:58
15: Pointers
Definition: Type.h:75
12: Functions
Definition: Type.h:72
#define TRACE(X)
static cl::opt< bool > EmitJtInText("hexagon-emit-jt-text", cl::Hidden, cl::init(false), cl::desc("Emit hexagon jump tables in function section"))
amdgpu Simplify well known AMD library false Value Value const Twine & Name
static cl::opt< bool > NoSmallDataSorting("mno-sort-sda", cl::init(false), cl::Hidden, cl::desc("Disable small data sections sorting"))
const DataLayout & getDataLayout() const
Get the data layout for the module&#39;s target platform.
Definition: Module.cpp:371
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:81
TypeID getTypeID() const
Return the type id for the type.
Definition: Type.h:138
Class to represent struct types.
Definition: DerivedTypes.h:201
bool hasCommonLinkage() const
Definition: GlobalValue.h:440
MCSection * SelectSectionForGlobal(const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const override
StringRef str() const
Explicit conversion to StringRef.
Definition: SmallString.h:267
Context object for machine code objects.
Definition: MCContext.h:63
bool hasExternalLinkage() const
Definition: GlobalValue.h:422
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool startswith(StringRef Prefix) const
Check if this string starts with the given Prefix.
Definition: StringRef.h:267
Class to represent array types.
Definition: DerivedTypes.h:369
bool isBSSLocal() const
Definition: SectionKind.h:161
bool shouldPutJumpTableInFunctionSection(bool UsesLabelDifference, const Function &F) const override
Class to represent pointers.
Definition: DerivedTypes.h:467
bool getDataSections() const
Return true if data objects should be emitted into their own section, corresponds to -fdata-sections...
void append(in_iter S, in_iter E)
Append from an iterator pair.
Definition: SmallString.h:75
11: Arbitrary bit width integers
Definition: Type.h:71
0: type with no size
Definition: Type.h:57
initializer< Ty > init(const Ty &Val)
Definition: CommandLine.h:423
const Function * getLutUsedFunction(const GlobalObject *GO) const
MCSection * SelectSectionForGlobal(const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const override
The instances of the Type class are immutable: once they are created, they are never changed...
Definition: Type.h:46
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
10: Tokens
Definition: Type.h:67
static bool isSmallDataSection(StringRef Sec)
bool hasInternalLinkage() const
Definition: GlobalValue.h:434
SectionKind - This is a simple POD value that classifies the properties of a section.
Definition: SectionKind.h:23
6: 128-bit floating point type (two 64-bits, PowerPC)
Definition: Type.h:63
bool isBSS() const
Definition: SectionKind.h:160
14: Arrays
Definition: Type.h:74
unsigned UseInitArray
UseInitArray - Use .init_array instead of .ctors for static constructors.
16: SIMD &#39;packed&#39; format, or other vector type
Definition: Type.h:76
static cl::opt< unsigned > SmallDataThreshold("hexagon-small-data-threshold", cl::init(8), cl::Hidden, cl::desc("The maximum size of an object in the sdata section"))
void Initialize(MCContext &Ctx, const TargetMachine &TM) override
This method must be called before any actual lowering is done.
bool hasSection() const
Check if this global has a custom object file section.
Definition: GlobalObject.h:82
bool isCommon() const
Definition: SectionKind.h:164
static cl::opt< bool > TraceGVPlacement("trace-gv-placement", cl::Hidden, cl::init(false), cl::desc("Trace global value placement"))
static cl::opt< bool > StaticsInSData("hexagon-statics-in-small-data", cl::init(false), cl::Hidden, cl::ZeroOrMore, cl::desc("Allow static variables in .sdata"))
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
Definition: Debug.cpp:133
8: Metadata
Definition: Type.h:65
Class to represent vector types.
Definition: DerivedTypes.h:393
iterator_range< user_iterator > users()
Definition: Value.h:400
static cl::opt< bool > EmitLutInText("hexagon-emit-lut-text", cl::Hidden, cl::init(false), cl::desc("Emit hexagon lookup tables in function section"))
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool equals(StringRef RHS) const
equals - Check for string equality, this is more efficient than compare() when the relative ordering ...
Definition: StringRef.h:169
uint64_t getTypeAllocSize(Type *Ty) const
Returns the offset in bytes between successive objects of the specified type, including alignment pad...
Definition: DataLayout.h:436
bool isMergeableConst() const
Definition: SectionKind.h:136
static const size_t npos
Definition: StringRef.h:51
bool isPositionIndependent() const
StringRef getName() const
Return a constant reference to the value&#39;s name.
Definition: Value.cpp:214
TargetOptions Options
Definition: TargetMachine.h:97
#define I(x, y, z)
Definition: MD5.cpp:58
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
Definition: Casting.h:323
uint32_t Size
Definition: Profile.cpp:47
std::string str() const
Return the twine contents as a std::string.
Definition: Twine.cpp:18
const unsigned Kind
3: 64-bit floating point type
Definition: Type.h:60
MCSectionELF * getELFSection(const Twine &Section, unsigned Type, unsigned Flags)
Definition: MCContext.h:389
Module * getParent()
Get the module that this global value is contained inside of...
Definition: GlobalValue.h:566
bool isData() const
Definition: SectionKind.h:166
Primary interface to the complete machine description for the target machine.
Definition: TargetMachine.h:59
MCSection * getExplicitSectionGlobal(const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const override
Targets should implement this method to assign a section to globals with an explicit section specfied...
Type * getElementType() const
Definition: DerivedTypes.h:360
MCSection * BSSSection
Section that is default initialized to zero.
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:49
9: MMX vectors (64 bits, X86 specific)
Definition: Type.h:66
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE size_t find(char C, size_t From=0) const
Search for the first character C in the string.
Definition: StringRef.h:298
void Initialize(MCContext &Ctx, const TargetMachine &TM) override
This method must be called before any actual lowering is done.
#define LLVM_DEBUG(X)
Definition: Debug.h:123
Type * getElementType() const
Definition: DerivedTypes.h:486
PointerType * getType() const
Global values are always pointers.
Definition: GlobalValue.h:274
5: 128-bit floating point type (112-bit mantissa)
Definition: Type.h:62
static SectionKind getText()
Definition: SectionKind.h:180
bool isSmallDataEnabled(const TargetMachine &TM) const