LLVM  13.0.0git
Module.cpp
Go to the documentation of this file.
1 //===- Module.cpp - Implement the Module class ----------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file implements the Module class for the IR library.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #include "llvm/IR/Module.h"
15 #include "llvm/ADT/Optional.h"
16 #include "llvm/ADT/SmallPtrSet.h"
17 #include "llvm/ADT/SmallString.h"
18 #include "llvm/ADT/SmallVector.h"
19 #include "llvm/ADT/StringMap.h"
20 #include "llvm/ADT/StringRef.h"
21 #include "llvm/ADT/Twine.h"
22 #include "llvm/IR/Attributes.h"
23 #include "llvm/IR/Comdat.h"
24 #include "llvm/IR/Constants.h"
25 #include "llvm/IR/DataLayout.h"
27 #include "llvm/IR/DerivedTypes.h"
28 #include "llvm/IR/Function.h"
29 #include "llvm/IR/GVMaterializer.h"
30 #include "llvm/IR/GlobalAlias.h"
31 #include "llvm/IR/GlobalIFunc.h"
32 #include "llvm/IR/GlobalValue.h"
33 #include "llvm/IR/GlobalVariable.h"
34 #include "llvm/IR/LLVMContext.h"
35 #include "llvm/IR/Metadata.h"
38 #include "llvm/IR/Type.h"
39 #include "llvm/IR/TypeFinder.h"
40 #include "llvm/IR/Value.h"
42 #include "llvm/Pass.h"
43 #include "llvm/Support/Casting.h"
44 #include "llvm/Support/CodeGen.h"
45 #include "llvm/Support/Error.h"
47 #include "llvm/Support/Path.h"
50 #include <algorithm>
51 #include <cassert>
52 #include <cstdint>
53 #include <memory>
54 #include <utility>
55 #include <vector>
56 
57 using namespace llvm;
58 
59 //===----------------------------------------------------------------------===//
60 // Methods to implement the globals and functions lists.
61 //
62 
63 // Explicit instantiations of SymbolTableListTraits since some of the methods
64 // are not in the public header file.
69 
70 //===----------------------------------------------------------------------===//
71 // Primitive Module methods.
72 //
73 
75  : Context(C), ValSymTab(std::make_unique<ValueSymbolTable>()),
76  Materializer(), ModuleID(std::string(MID)),
77  SourceFileName(std::string(MID)), DL("") {
78  Context.addModule(this);
79 }
80 
82  Context.removeModule(this);
84  GlobalList.clear();
85  FunctionList.clear();
86  AliasList.clear();
87  IFuncList.clear();
88 }
89 
90 std::unique_ptr<RandomNumberGenerator>
92  SmallString<32> Salt(Name);
93 
94  // This RNG is guaranteed to produce the same random stream only
95  // when the Module ID and thus the input filename is the same. This
96  // might be problematic if the input filename extension changes
97  // (e.g. from .c to .bc or .ll).
98  //
99  // We could store this salt in NamedMetadata, but this would make
100  // the parameter non-const. This would unfortunately make this
101  // interface unusable by any Machine passes, since they only have a
102  // const reference to their IR Module. Alternatively we can always
103  // store salt metadata from the Module constructor.
105 
106  return std::unique_ptr<RandomNumberGenerator>(
107  new RandomNumberGenerator(Salt));
108 }
109 
110 /// getNamedValue - Return the first global value in the module with
111 /// the specified name, of arbitrary type. This method returns null
112 /// if a global with the specified name is not found.
114  return cast_or_null<GlobalValue>(getValueSymbolTable().lookup(Name));
115 }
116 
117 /// getMDKindID - Return a unique non-zero ID for the specified metadata kind.
118 /// This ID is uniqued across modules in the current LLVMContext.
120  return Context.getMDKindID(Name);
121 }
122 
123 /// getMDKindNames - Populate client supplied SmallVector with the name for
124 /// custom metadata IDs registered in this LLVMContext. ID #0 is not used,
125 /// so it is filled in as an empty string.
127  return Context.getMDKindNames(Result);
128 }
129 
131  return Context.getOperandBundleTags(Result);
132 }
133 
134 //===----------------------------------------------------------------------===//
135 // Methods for easy access to the functions in the module.
136 //
137 
138 // getOrInsertFunction - Look up the specified function in the module symbol
139 // table. If it does not exist, add a prototype for the function and return
140 // it. This is nice because it allows most passes to get away with not handling
141 // the symbol table directly for this common task.
142 //
145  // See if we have a definition for the specified function already.
147  if (!F) {
148  // Nope, add it
151  if (!New->isIntrinsic()) // Intrinsics get attrs set on construction
152  New->setAttributes(AttributeList);
153  FunctionList.push_back(New);
154  return {Ty, New}; // Return the new prototype.
155  }
156 
157  // If the function exists but has the wrong type, return a bitcast to the
158  // right type.
159  auto *PTy = PointerType::get(Ty, F->getAddressSpace());
160  if (F->getType() != PTy)
161  return {Ty, ConstantExpr::getBitCast(F, PTy)};
162 
163  // Otherwise, we just found the existing function or a prototype.
164  return {Ty, F};
165 }
166 
168  return getOrInsertFunction(Name, Ty, AttributeList());
169 }
170 
171 // getFunction - Look up the specified function in the module symbol table.
172 // If it does not exist, return null.
173 //
175  return dyn_cast_or_null<Function>(getNamedValue(Name));
176 }
177 
178 //===----------------------------------------------------------------------===//
179 // Methods for easy access to the global variables in the module.
180 //
181 
182 /// getGlobalVariable - Look up the specified global variable in the module
183 /// symbol table. If it does not exist, return null. The type argument
184 /// should be the underlying type of the global, i.e., it should not have
185 /// the top-level PointerType, which represents the address of the global.
186 /// If AllowLocal is set to true, this function will return types that
187 /// have an local. By default, these types are not returned.
188 ///
190  bool AllowLocal) const {
191  if (GlobalVariable *Result =
192  dyn_cast_or_null<GlobalVariable>(getNamedValue(Name)))
193  if (AllowLocal || !Result->hasLocalLinkage())
194  return Result;
195  return nullptr;
196 }
197 
198 /// getOrInsertGlobal - Look up the specified global in the module symbol table.
199 /// 1. If it does not exist, add a declaration of the global and return it.
200 /// 2. Else, the global exists but has the wrong type: return the function
201 /// with a constantexpr cast to the right type.
202 /// 3. Finally, if the existing global is the correct declaration, return the
203 /// existing global.
205  StringRef Name, Type *Ty,
206  function_ref<GlobalVariable *()> CreateGlobalCallback) {
207  // See if we have a definition for the specified global already.
208  GlobalVariable *GV = dyn_cast_or_null<GlobalVariable>(getNamedValue(Name));
209  if (!GV)
210  GV = CreateGlobalCallback();
211  assert(GV && "The CreateGlobalCallback is expected to create a global");
212 
213  // If the variable exists but has the wrong type, return a bitcast to the
214  // right type.
215  Type *GVTy = GV->getType();
217  if (GVTy != PTy)
218  return ConstantExpr::getBitCast(GV, PTy);
219 
220  // Otherwise, we just found the existing function or a prototype.
221  return GV;
222 }
223 
224 // Overload to construct a global variable using its constructor's defaults.
226  return getOrInsertGlobal(Name, Ty, [&] {
227  return new GlobalVariable(*this, Ty, false, GlobalVariable::ExternalLinkage,
228  nullptr, Name);
229  });
230 }
231 
232 //===----------------------------------------------------------------------===//
233 // Methods for easy access to the global variables in the module.
234 //
235 
236 // getNamedAlias - Look up the specified global in the module symbol table.
237 // If it does not exist, return null.
238 //
240  return dyn_cast_or_null<GlobalAlias>(getNamedValue(Name));
241 }
242 
244  return dyn_cast_or_null<GlobalIFunc>(getNamedValue(Name));
245 }
246 
247 /// getNamedMetadata - Return the first NamedMDNode in the module with the
248 /// specified name. This method returns null if a NamedMDNode with the
249 /// specified name is not found.
251  SmallString<256> NameData;
252  StringRef NameRef = Name.toStringRef(NameData);
253  return NamedMDSymTab.lookup(NameRef);
254 }
255 
256 /// getOrInsertNamedMetadata - Return the first named MDNode in the module
257 /// with the specified name. This method returns a new NamedMDNode if a
258 /// NamedMDNode with the specified name is not found.
260  NamedMDNode *&NMD = NamedMDSymTab[Name];
261  if (!NMD) {
262  NMD = new NamedMDNode(Name);
263  NMD->setParent(this);
264  NamedMDList.push_back(NMD);
265  }
266  return NMD;
267 }
268 
269 /// eraseNamedMetadata - Remove the given NamedMDNode from this module and
270 /// delete it.
272  NamedMDSymTab.erase(NMD->getName());
273  NamedMDList.erase(NMD->getIterator());
274 }
275 
277  if (ConstantInt *Behavior = mdconst::dyn_extract_or_null<ConstantInt>(MD)) {
278  uint64_t Val = Behavior->getLimitedValue();
279  if (Val >= ModFlagBehaviorFirstVal && Val <= ModFlagBehaviorLastVal) {
280  MFB = static_cast<ModFlagBehavior>(Val);
281  return true;
282  }
283  }
284  return false;
285 }
286 
288  MDString *&Key, Metadata *&Val) {
289  if (ModFlag.getNumOperands() < 3)
290  return false;
291  if (!isValidModFlagBehavior(ModFlag.getOperand(0), MFB))
292  return false;
293  MDString *K = dyn_cast_or_null<MDString>(ModFlag.getOperand(1));
294  if (!K)
295  return false;
296  Key = K;
297  Val = ModFlag.getOperand(2);
298  return true;
299 }
300 
301 /// getModuleFlagsMetadata - Returns the module flags in the provided vector.
302 void Module::
304  const NamedMDNode *ModFlags = getModuleFlagsMetadata();
305  if (!ModFlags) return;
306 
307  for (const MDNode *Flag : ModFlags->operands()) {
308  ModFlagBehavior MFB;
309  MDString *Key = nullptr;
310  Metadata *Val = nullptr;
311  if (isValidModuleFlag(*Flag, MFB, Key, Val)) {
312  // Check the operands of the MDNode before accessing the operands.
313  // The verifier will actually catch these failures.
314  Flags.push_back(ModuleFlagEntry(MFB, Key, Val));
315  }
316  }
317 }
318 
319 /// Return the corresponding value if Key appears in module flags, otherwise
320 /// return null.
323  getModuleFlagsMetadata(ModuleFlags);
324  for (const ModuleFlagEntry &MFE : ModuleFlags) {
325  if (Key == MFE.Key->getString())
326  return MFE.Val;
327  }
328  return nullptr;
329 }
330 
331 /// getModuleFlagsMetadata - Returns the NamedMDNode in the module that
332 /// represents module-level flags. This method returns null if there are no
333 /// module-level flags.
335  return getNamedMetadata("llvm.module.flags");
336 }
337 
338 /// getOrInsertModuleFlagsMetadata - Returns the NamedMDNode in the module that
339 /// represents module-level flags. If module-level flags aren't found, it
340 /// creates the named metadata that contains them.
342  return getOrInsertNamedMetadata("llvm.module.flags");
343 }
344 
345 /// addModuleFlag - Add a module-level flag to the module-level flags
346 /// metadata. It will create the module-level flags named metadata if it doesn't
347 /// already exist.
349  Metadata *Val) {
350  Type *Int32Ty = Type::getInt32Ty(Context);
351  Metadata *Ops[3] = {
353  MDString::get(Context, Key), Val};
355 }
357  Constant *Val) {
358  addModuleFlag(Behavior, Key, ConstantAsMetadata::get(Val));
359 }
361  uint32_t Val) {
362  Type *Int32Ty = Type::getInt32Ty(Context);
363  addModuleFlag(Behavior, Key, ConstantInt::get(Int32Ty, Val));
364 }
366  assert(Node->getNumOperands() == 3 &&
367  "Invalid number of operands for module flag!");
368  assert(mdconst::hasa<ConstantInt>(Node->getOperand(0)) &&
369  isa<MDString>(Node->getOperand(1)) &&
370  "Invalid operand types for module flag!");
372 }
373 
375  Metadata *Val) {
377  // Replace the flag if it already exists.
378  for (unsigned I = 0, E = ModFlags->getNumOperands(); I != E; ++I) {
379  MDNode *Flag = ModFlags->getOperand(I);
380  ModFlagBehavior MFB;
381  MDString *K = nullptr;
382  Metadata *V = nullptr;
383  if (isValidModuleFlag(*Flag, MFB, K, V) && K->getString() == Key) {
384  Flag->replaceOperandWith(2, Val);
385  return;
386  }
387  }
388  addModuleFlag(Behavior, Key, Val);
389 }
390 
392  DL.reset(Desc);
393 }
394 
395 void Module::setDataLayout(const DataLayout &Other) { DL = Other; }
396 
397 const DataLayout &Module::getDataLayout() const { return DL; }
398 
400  return cast<DICompileUnit>(CUs->getOperand(Idx));
401 }
403  return cast<DICompileUnit>(CUs->getOperand(Idx));
404 }
405 
406 void Module::debug_compile_units_iterator::SkipNoDebugCUs() {
407  while (CUs && (Idx < CUs->getNumOperands()) &&
408  ((*this)->getEmissionKind() == DICompileUnit::NoDebug))
409  ++Idx;
410 }
411 
413  return concat<GlobalObject>(functions(), globals());
414 }
416 Module::global_objects() const {
417  return concat<const GlobalObject>(functions(), globals());
418 }
419 
421  return concat<GlobalValue>(functions(), globals(), aliases(), ifuncs());
422 }
424 Module::global_values() const {
425  return concat<const GlobalValue>(functions(), globals(), aliases(), ifuncs());
426 }
427 
428 //===----------------------------------------------------------------------===//
429 // Methods to control the materialization of GlobalValues in the Module.
430 //
432  assert(!Materializer &&
433  "Module already has a GVMaterializer. Call materializeAll"
434  " to clear it out before setting another one.");
435  Materializer.reset(GVM);
436 }
437 
439  if (!Materializer)
440  return Error::success();
441 
442  return Materializer->materialize(GV);
443 }
444 
446  if (!Materializer)
447  return Error::success();
448  std::unique_ptr<GVMaterializer> M = std::move(Materializer);
449  return M->materializeModule();
450 }
451 
453  if (!Materializer)
454  return Error::success();
455  return Materializer->materializeMetadata();
456 }
457 
458 //===----------------------------------------------------------------------===//
459 // Other module related stuff.
460 //
461 
462 std::vector<StructType *> Module::getIdentifiedStructTypes() const {
463  // If we have a materializer, it is possible that some unread function
464  // uses a type that is currently not visible to a TypeFinder, so ask
465  // the materializer which types it created.
466  if (Materializer)
467  return Materializer->getIdentifiedStructTypes();
468 
469  std::vector<StructType *> Ret;
470  TypeFinder SrcStructTypes;
471  SrcStructTypes.run(*this, true);
472  Ret.assign(SrcStructTypes.begin(), SrcStructTypes.end());
473  return Ret;
474 }
475 
477  const FunctionType *Proto) {
478  auto Encode = [&BaseName](unsigned Suffix) {
479  return (Twine(BaseName) + "." + Twine(Suffix)).str();
480  };
481 
482  {
483  // fast path - the prototype is already known
484  auto UinItInserted = UniquedIntrinsicNames.insert({{Id, Proto}, 0});
485  if (!UinItInserted.second)
486  return Encode(UinItInserted.first->second);
487  }
488 
489  // Not known yet. A new entry was created with index 0. Check if there already
490  // exists a matching declaration, or select a new entry.
491 
492  // Start looking for names with the current known maximum count (or 0).
493  auto NiidItInserted = CurrentIntrinsicIds.insert({BaseName, 0});
494  unsigned Count = NiidItInserted.first->second;
495 
496  // This might be slow if a whole population of intrinsics already existed, but
497  // we cache the values for later usage.
498  std::string NewName;
499  while (true) {
500  NewName = Encode(Count);
501  GlobalValue *F = getNamedValue(NewName);
502  if (!F) {
503  // Reserve this entry for the new proto
504  UniquedIntrinsicNames[{Id, Proto}] = Count;
505  break;
506  }
507 
508  // A declaration with this name already exists. Remember it.
509  FunctionType *FT = dyn_cast<FunctionType>(F->getType()->getElementType());
510  auto UinItInserted = UniquedIntrinsicNames.insert({{Id, FT}, Count});
511  if (FT == Proto) {
512  // It was a declaration for our prototype. This entry was allocated in the
513  // beginning. Update the count to match the existing declaration.
514  UinItInserted.first->second = Count;
515  break;
516  }
517 
518  ++Count;
519  }
520 
521  NiidItInserted.first->second = Count + 1;
522 
523  return NewName;
524 }
525 
526 // dropAllReferences() - This function causes all the subelements to "let go"
527 // of all references that they are maintaining. This allows one to 'delete' a
528 // whole module at a time, even though there may be circular references... first
529 // all references are dropped, and all use counts go to zero. Then everything
530 // is deleted for real. Note that no operations are valid on an object that
531 // has "dropped all references", except operator delete.
532 //
534  for (Function &F : *this)
535  F.dropAllReferences();
536 
537  for (GlobalVariable &GV : globals())
538  GV.dropAllReferences();
539 
540  for (GlobalAlias &GA : aliases())
541  GA.dropAllReferences();
542 
543  for (GlobalIFunc &GIF : ifuncs())
544  GIF.dropAllReferences();
545 }
546 
548  auto *Val =
549  cast_or_null<ConstantAsMetadata>(getModuleFlag("NumRegisterParameters"));
550  if (!Val)
551  return 0;
552  return cast<ConstantInt>(Val->getValue())->getZExtValue();
553 }
554 
555 unsigned Module::getDwarfVersion() const {
556  auto *Val = cast_or_null<ConstantAsMetadata>(getModuleFlag("Dwarf Version"));
557  if (!Val)
558  return 0;
559  return cast<ConstantInt>(Val->getValue())->getZExtValue();
560 }
561 
562 bool Module::isDwarf64() const {
563  auto *Val = cast_or_null<ConstantAsMetadata>(getModuleFlag("DWARF64"));
564  return Val && cast<ConstantInt>(Val->getValue())->isOne();
565 }
566 
567 unsigned Module::getCodeViewFlag() const {
568  auto *Val = cast_or_null<ConstantAsMetadata>(getModuleFlag("CodeView"));
569  if (!Val)
570  return 0;
571  return cast<ConstantInt>(Val->getValue())->getZExtValue();
572 }
573 
574 unsigned Module::getInstructionCount() const {
575  unsigned NumInstrs = 0;
576  for (const Function &F : FunctionList)
577  NumInstrs += F.getInstructionCount();
578  return NumInstrs;
579 }
580 
582  auto &Entry = *ComdatSymTab.insert(std::make_pair(Name, Comdat())).first;
583  Entry.second.Name = &Entry;
584  return &Entry.second;
585 }
586 
588  auto *Val = cast_or_null<ConstantAsMetadata>(getModuleFlag("PIC Level"));
589 
590  if (!Val)
591  return PICLevel::NotPIC;
592 
593  return static_cast<PICLevel::Level>(
594  cast<ConstantInt>(Val->getValue())->getZExtValue());
595 }
596 
598  addModuleFlag(ModFlagBehavior::Max, "PIC Level", PL);
599 }
600 
602  auto *Val = cast_or_null<ConstantAsMetadata>(getModuleFlag("PIE Level"));
603 
604  if (!Val)
605  return PIELevel::Default;
606 
607  return static_cast<PIELevel::Level>(
608  cast<ConstantInt>(Val->getValue())->getZExtValue());
609 }
610 
612  addModuleFlag(ModFlagBehavior::Max, "PIE Level", PL);
613 }
614 
616  auto *Val = cast_or_null<ConstantAsMetadata>(getModuleFlag("Code Model"));
617 
618  if (!Val)
619  return None;
620 
621  return static_cast<CodeModel::Model>(
622  cast<ConstantInt>(Val->getValue())->getZExtValue());
623 }
624 
626  // Linking object files with different code models is undefined behavior
627  // because the compiler would have to generate additional code (to span
628  // longer jumps) if a larger code model is used with a smaller one.
629  // Therefore we will treat attempts to mix code models as an error.
630  addModuleFlag(ModFlagBehavior::Error, "Code Model", CL);
631 }
632 
635  setModuleFlag(ModFlagBehavior::Error, "CSProfileSummary", M);
636  else
637  setModuleFlag(ModFlagBehavior::Error, "ProfileSummary", M);
638 }
639 
641  return (IsCS ? getModuleFlag("CSProfileSummary")
642  : getModuleFlag("ProfileSummary"));
643 }
644 
646  Metadata *MF = getModuleFlag("SemanticInterposition");
647 
648  auto *Val = cast_or_null<ConstantAsMetadata>(MF);
649  if (!Val)
650  return false;
651 
652  return cast<ConstantInt>(Val->getValue())->getZExtValue();
653 }
654 
656  addModuleFlag(ModFlagBehavior::Error, "SemanticInterposition", SI);
657 }
658 
659 void Module::setOwnedMemoryBuffer(std::unique_ptr<MemoryBuffer> MB) {
660  OwnedMemoryBuffer = std::move(MB);
661 }
662 
664  auto *Val = cast_or_null<ConstantAsMetadata>(getModuleFlag("RtLibUseGOT"));
665  return Val && (cast<ConstantInt>(Val->getValue())->getZExtValue() > 0);
666 }
667 
669  addModuleFlag(ModFlagBehavior::Max, "RtLibUseGOT", 1);
670 }
671 
673  SmallVector<unsigned, 3> Entries;
674  Entries.push_back(V.getMajor());
675  if (auto Minor = V.getMinor()) {
676  Entries.push_back(*Minor);
677  if (auto Subminor = V.getSubminor())
678  Entries.push_back(*Subminor);
679  // Ignore the 'build' component as it can't be represented in the object
680  // file.
681  }
682  addModuleFlag(ModFlagBehavior::Warning, "SDK Version",
683  ConstantDataArray::get(Context, Entries));
684 }
685 
687  auto *CM = dyn_cast_or_null<ConstantAsMetadata>(getModuleFlag("SDK Version"));
688  if (!CM)
689  return {};
690  auto *Arr = dyn_cast_or_null<ConstantDataArray>(CM->getValue());
691  if (!Arr)
692  return {};
693  auto getVersionComponent = [&](unsigned Index) -> Optional<unsigned> {
694  if (Index >= Arr->getNumElements())
695  return None;
696  return (unsigned)Arr->getElementAsInteger(Index);
697  };
698  auto Major = getVersionComponent(0);
699  if (!Major)
700  return {};
701  VersionTuple Result = VersionTuple(*Major);
702  if (auto Minor = getVersionComponent(1)) {
703  Result = VersionTuple(*Major, *Minor);
704  if (auto Subminor = getVersionComponent(2)) {
705  Result = VersionTuple(*Major, *Minor, *Subminor);
706  }
707  }
708  return Result;
709 }
710 
712  const Module &M, SmallVectorImpl<GlobalValue *> &Vec, bool CompilerUsed) {
713  const char *Name = CompilerUsed ? "llvm.compiler.used" : "llvm.used";
714  GlobalVariable *GV = M.getGlobalVariable(Name);
715  if (!GV || !GV->hasInitializer())
716  return GV;
717 
718  const ConstantArray *Init = cast<ConstantArray>(GV->getInitializer());
719  for (Value *Op : Init->operands()) {
720  GlobalValue *G = cast<GlobalValue>(Op->stripPointerCasts());
721  Vec.push_back(G);
722  }
723  return GV;
724 }
725 
727  if (auto *SummaryMD = getProfileSummary(/*IsCS*/ false)) {
728  std::unique_ptr<ProfileSummary> ProfileSummary(
729  ProfileSummary::getFromMD(SummaryMD));
730  if (ProfileSummary) {
733  return;
734  uint64_t BlockCount = Index.getBlockCount();
735  uint32_t NumCounts = ProfileSummary->getNumCounts();
736  if (!NumCounts)
737  return;
738  double Ratio = (double)BlockCount / NumCounts;
742  }
743  }
744 }
llvm::Module::global_values
iterator_range< global_value_iterator > global_values()
Definition: Module.cpp:420
llvm::EngineKind::Kind
Kind
Definition: ExecutionEngine.h:524
MemoryBuffer.h
Int32Ty
IntegerType * Int32Ty
Definition: NVVMIntrRange.cpp:67
llvm::Module::getOrInsertModuleFlagsMetadata
NamedMDNode * getOrInsertModuleFlagsMetadata()
Returns the NamedMDNode in the module that represents module-level flags.
Definition: Module.cpp:341
GlobalIFunc.h
llvm
Definition: AllocatorList.h:23
llvm::Module::getModuleFlagsMetadata
NamedMDNode * getModuleFlagsMetadata() const
Returns the NamedMDNode in the module that represents module-level flags.
Definition: Module.cpp:334
M
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
Definition: README.txt:252
Comdat.h
llvm::NamedMDNode
A tuple of MDNodes.
Definition: Metadata.h:1386
llvm::lltok::Error
@ Error
Definition: LLToken.h:21
Optional.h
llvm::DataLayout
A parsed version of the target data layout string in and methods for querying it.
Definition: DataLayout.h:112
llvm::Module::getInstructionCount
unsigned getInstructionCount() const
Returns the number of non-debug IR instructions in the module.
Definition: Module.cpp:574
llvm::ProfileSummary::Kind
Kind
Definition: ProfileSummary.h:47
Metadata.h
llvm::NamedMDNode::getNumOperands
unsigned getNumOperands() const
Definition: Metadata.cpp:1114
llvm::GVMaterializer
Definition: GVMaterializer.h:28
llvm::Module::isDwarf64
bool isDwarf64() const
Returns the DWARF format by checking module flags.
Definition: Module.cpp:562
llvm::iplist_impl::push_back
void push_back(pointer val)
Definition: ilist.h:313
DebugInfoMetadata.h
llvm::Module::ModFlagBehaviorLastVal
@ ModFlagBehaviorLastVal
Definition: Module.h:153
llvm::DataLayout::getProgramAddressSpace
unsigned getProgramAddressSpace() const
Definition: DataLayout.h:292
llvm::Function
Definition: Function.h:61
llvm::TypeFinder::end
iterator end()
Definition: TypeFinder.h:50
StringRef.h
llvm::ProfileSummary::getFromMD
static ProfileSummary * getFromMD(Metadata *MD)
Construct profile summary from metdata.
Definition: ProfileSummary.cpp:195
Pass.h
llvm::Module::ifuncs
iterator_range< ifunc_iterator > ifuncs()
Definition: Module.h:666
llvm::Module::setMaterializer
void setMaterializer(GVMaterializer *GVM)
Sets the GVMaterializer to GVM.
Definition: Module.cpp:431
llvm::Module::ModFlagBehaviorFirstVal
@ ModFlagBehaviorFirstVal
Definition: Module.h:152
llvm::PointerType::get
static PointerType * get(Type *ElementType, unsigned AddressSpace)
This constructs a pointer to an object of the specified type in a numbered address space.
Definition: Type.cpp:693
double
into xmm2 addss xmm2 xmm1 xmm3 addss xmm3 movaps xmm0 unpcklps xmm0 ret seems silly when it could just be one addps Expand libm rounding functions main should enable SSE DAZ mode and other fast SSE modes Think about doing i64 math in SSE regs on x86 This testcase should have no SSE instructions in and only one load from a constant double
Definition: README-SSE.txt:85
llvm::SmallVector
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition: SmallVector.h:1168
llvm::Module::getCodeViewFlag
unsigned getCodeViewFlag() const
Returns the CodeView Version by checking module flags.
Definition: Module.cpp:567
Path.h
llvm::Module::~Module
~Module()
The module destructor. This will dropAllReferences.
Definition: Module.cpp:81
llvm::Module::getRtLibUseGOT
bool getRtLibUseGOT() const
Returns true if PLT should be avoided for RTLib calls.
Definition: Module.cpp:663
VersionTuple.h
llvm::Type::getPointerAddressSpace
unsigned getPointerAddressSpace() const
Get the address space of this pointer or pointer vector type.
Definition: DerivedTypes.h:693
llvm::Error::success
static ErrorSuccess success()
Create a success value.
Definition: Error.h:332
llvm::GlobalVariable
Definition: GlobalVariable.h:40
llvm::ConstantExpr::getBitCast
static Constant * getBitCast(Constant *C, Type *Ty, bool OnlyIfReduced=false)
Definition: Constants.cpp:2207
RandomNumberGenerator.h
llvm::GlobalAlias
Definition: GlobalAlias.h:27
Error.h
llvm::Module::isValidModFlagBehavior
static bool isValidModFlagBehavior(Metadata *MD, ModFlagBehavior &MFB)
Checks if Metadata represents a valid ModFlagBehavior, and stores the converted result in MFB.
Definition: Module.cpp:276
llvm::Module::getModuleFlag
Metadata * getModuleFlag(StringRef Key) const
Return the corresponding value if Key appears in module flags, otherwise return null.
Definition: Module.cpp:321
llvm::Type
The instances of the Type class are immutable: once they are created, they are never changed.
Definition: Type.h:46
llvm::Module::getCodeModel
Optional< CodeModel::Model > getCodeModel() const
Returns the code model (tiny, small, kernel, medium or large model)
Definition: Module.cpp:615
Module.h
llvm::AttributeList
Definition: Attributes.h:385
llvm::Optional< CodeModel::Model >
llvm::Module::setSDKVersion
void setSDKVersion(const VersionTuple &V)
Attach a build SDK version metadata to this module.
Definition: Module.cpp:672
llvm::ConstantAsMetadata::get
static ConstantAsMetadata * get(Constant *C)
Definition: Metadata.h:419
llvm::Module::getOrInsertFunction
FunctionCallee getOrInsertFunction(StringRef Name, FunctionType *T, AttributeList AttributeList)
Look up the specified function in the module symbol table.
Definition: Module.cpp:143
llvm::Module::global_objects
iterator_range< global_object_iterator > global_objects()
Definition: Module.cpp:412
llvm::Module::getProfileSummary
Metadata * getProfileSummary(bool IsCS) const
Returns profile summary metadata.
Definition: Module.cpp:640
llvm::MipsISD::Ret
@ Ret
Definition: MipsISelLowering.h:116
llvm::Module::getMDKindNames
void getMDKindNames(SmallVectorImpl< StringRef > &Result) const
Populate client supplied SmallVector with the name for custom metadata IDs registered in this LLVMCon...
Definition: Module.cpp:126
llvm::Module::getFunction
Function * getFunction(StringRef Name) const
Look up the specified function in the module symbol table.
Definition: Module.cpp:174
llvm::RandomNumberGenerator
A random number generator.
Definition: RandomNumberGenerator.h:32
llvm::Type::getInt32Ty
static IntegerType * getInt32Ty(LLVMContext &C)
Definition: Type.cpp:204
ModuleSummaryIndex.h
llvm::TypeFinder::begin
iterator begin()
Definition: TypeFinder.h:49
llvm::MDNode::get
static MDTuple * get(LLVMContext &Context, ArrayRef< Metadata * > MDs)
Definition: Metadata.h:1198
llvm::Module::setPIELevel
void setPIELevel(PIELevel::Level PL)
Set the PIE level (small or large model)
Definition: Module.cpp:611
F
#define F(x, y, z)
Definition: MD5.cpp:56
llvm::GlobalVariable::hasInitializer
bool hasInitializer() const
Definitions have initializers, declarations don't.
Definition: GlobalVariable.h:92
llvm::collectUsedGlobalVariables
GlobalVariable * collectUsedGlobalVariables(const Module &M, SmallVectorImpl< GlobalValue * > &Vec, bool CompilerUsed)
Given "llvm.used" or "llvm.compiler.used" as a global name, collect the initializer elements of that ...
Definition: Module.cpp:711
llvm::Module::getSDKVersion
VersionTuple getSDKVersion() const
Get the build SDK version metadata.
Definition: Module.cpp:686
llvm::iplist_impl::erase
iterator erase(iterator where)
Definition: ilist.h:267
llvm::VersionTuple::getMajor
unsigned getMajor() const
Retrieve the major version number.
Definition: VersionTuple.h:68
llvm::MDNode::getNumOperands
unsigned getNumOperands() const
Return number of MDNode operands.
Definition: Metadata.h:1108
Context
LLVMContext & Context
Definition: NVVMIntrRange.cpp:66
llvm::Module::setRtLibUseGOT
void setRtLibUseGOT()
Set that PLT should be avoid for RTLib calls.
Definition: Module.cpp:668
llvm::NamedMDNode::addOperand
void addOperand(MDNode *M)
Definition: Metadata.cpp:1124
llvm::ConstantInt
This is the shared class of boolean and integer constants.
Definition: Constants.h:77
llvm::Module::setSemanticInterposition
void setSemanticInterposition(bool)
Set whether semantic interposition is to be respected.
Definition: Module.cpp:655
GlobalValue.h
Constants.h
llvm::Module::globals
iterator_range< global_iterator > globals()
Definition: Module.h:608
SmallString.h
E
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
llvm::Module::setCodeModel
void setCodeModel(CodeModel::Model CL)
Set the code model (tiny, small, kernel, medium or large)
Definition: Module.cpp:625
C
(vector float) vec_cmpeq(*A, *B) C
Definition: README_ALTIVEC.txt:86
llvm::ProfileSummary::getMD
Metadata * getMD(LLVMContext &Context, bool AddPartialField=true, bool AddPartialProfileRatioField=true)
Return summary information as metadata.
Definition: ProfileSummary.cpp:81
llvm::Module::getValueSymbolTable
const ValueSymbolTable & getValueSymbolTable() const
Get the symbol table of global variable and function identifiers.
Definition: Module.h:588
Twine.h
llvm::StringMap::insert
bool insert(MapEntryTy *KeyValue)
insert - Insert the specified key/value pair into the map.
Definition: StringMap.h:276
llvm::NamedMDNode::getName
StringRef getName() const
Definition: Metadata.cpp:1135
TypeFinder.h
SI
@ SI
Definition: SIInstrInfo.cpp:7342
SymbolTableListTraitsImpl.h
llvm::AMDGPU::PALMD::Key
Key
PAL metadata keys.
Definition: AMDGPUMetadata.h:481
GVMaterializer.h
llvm::Module::getNamedAlias
GlobalAlias * getNamedAlias(StringRef Name) const
Return the global alias in the module with the specified name, of arbitrary type.
Definition: Module.cpp:239
llvm::ConstantArray
ConstantArray - Constant Array Declarations.
Definition: Constants.h:407
llvm::MCID::Flag
Flag
These should be considered private to the implementation of the MCInstrDesc class.
Definition: MCInstrDesc.h:147
llvm::Module::ModuleFlagEntry
Definition: Module.h:165
llvm::Module::getOrInsertGlobal
Constant * getOrInsertGlobal(StringRef Name, Type *Ty, function_ref< GlobalVariable *()> CreateGlobalCallback)
Look up the specified global in the module symbol table.
Definition: Module.cpp:204
llvm::ConstantInt::get
static Constant * get(Type *Ty, uint64_t V, bool IsSigned=false)
If Ty is a vector type, return a Constant with a splat of the given value.
Definition: Constants.cpp:885
llvm::Module::debug_compile_units_iterator::operator*
DICompileUnit * operator*() const
Definition: Module.cpp:399
llvm::AArch64CC::PL
@ PL
Definition: AArch64BaseInfo.h:241
llvm::VersionTuple
Represents a version number in the form major[.minor[.subminor[.build]]].
Definition: VersionTuple.h:27
SmallPtrSet.h
StringMap.h
llvm::ProfileSummary::PSK_Sample
@ PSK_Sample
Definition: ProfileSummary.h:47
llvm::Comdat
Definition: Comdat.h:31
llvm::Metadata
Root of the metadata hierarchy.
Definition: Metadata.h:62
llvm::None
const NoneType None
Definition: None.h:23
Type.h
llvm::Module::getNamedIFunc
GlobalIFunc * getNamedIFunc(StringRef Name) const
Return the global ifunc in the module with the specified name, of arbitrary type.
Definition: Module.cpp:243
llvm::SmallString< 32 >
ValueSymbolTable.h
llvm::ProfileSummary::getKind
Kind getKind() const
Definition: ProfileSummary.h:82
llvm::Module::getUniqueIntrinsicName
std::string getUniqueIntrinsicName(StringRef BaseName, Intrinsic::ID Id, const FunctionType *Proto)
Return a unique name for an intrinsic whose mangling is based on an unnamed type.
Definition: Module.cpp:476
llvm::CodeModel::Model
Model
Definition: CodeGen.h:28
llvm::function_ref
An efficient, type-erasing, non-owning reference to a callable.
Definition: STLExtras.h:176
llvm::MDNode::getOperand
const MDOperand & getOperand(unsigned I) const
Definition: Metadata.h:1102
G
const DataFlowGraph & G
Definition: RDFGraph.cpp:202
llvm::Module::aliases
iterator_range< alias_iterator > aliases()
Definition: Module.h:648
llvm::GlobalValue
Definition: GlobalValue.h:44
llvm::GlobalVariable::getInitializer
const Constant * getInitializer() const
getInitializer - Return the initializer for this global variable.
Definition: GlobalVariable.h:136
llvm::Module::setPICLevel
void setPICLevel(PICLevel::Level PL)
Set the PIC level (small or large model)
Definition: Module.cpp:597
llvm::Constant
This is an important base class in LLVM.
Definition: Constant.h:41
llvm::Module::getNumberRegisterParameters
unsigned getNumberRegisterParameters() const
Returns the Number of Register ParametersDwarf Version by checking module flags.
Definition: Module.cpp:547
llvm::SymbolTableListTraits
Definition: GlobalAlias.h:25
Index
uint32_t Index
Definition: ELFObjHandler.cpp:84
llvm::StringMap::erase
void erase(iterator I)
Definition: StringMap.h:355
llvm::Module::dropAllReferences
void dropAllReferences()
This function causes all the subinstructions to "let go" of all references that they are maintaining.
Definition: Module.cpp:533
llvm::VersionTuple::getSubminor
Optional< unsigned > getSubminor() const
Retrieve the subminor version number, if provided.
Definition: VersionTuple.h:78
move
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
Definition: README.txt:546
llvm::LLVMContext
This is an important class for using LLVM in a threaded context.
Definition: LLVMContext.h:68
I
#define I(x, y, z)
Definition: MD5.cpp:59
llvm::StringMap::lookup
ValueTy lookup(StringRef Key) const
lookup - Return the entry for the specified key, or a default constructed value if no such entry exis...
Definition: StringMap.h:234
llvm::PICLevel::NotPIC
@ NotPIC
Definition: CodeGen.h:33
llvm::Module::materializeAll
llvm::Error materializeAll()
Make sure all GlobalValues in this Module are fully read and clear the Materializer.
Definition: Module.cpp:445
llvm::DICompileUnit
Compile unit.
Definition: DebugInfoMetadata.h:1313
llvm::PointerType
Class to represent pointers.
Definition: DerivedTypes.h:634
llvm::ProfileSummary
Definition: ProfileSummary.h:45
llvm::Module::functions
iterator_range< iterator > functions()
Definition: Module.h:630
llvm::Module::getOrInsertComdat
Comdat * getOrInsertComdat(StringRef Name)
Return the Comdat in the module with the specified name.
Definition: Module.cpp:581
llvm::MDString::get
static MDString * get(LLVMContext &Context, StringRef Str)
Definition: Metadata.cpp:467
llvm::Module::setDataLayout
void setDataLayout(StringRef Desc)
Set the data layout.
Definition: Module.cpp:391
llvm::NamedMDNode::getOperand
MDNode * getOperand(unsigned i) const
Definition: Metadata.cpp:1118
llvm::Function::Create
static Function * Create(FunctionType *Ty, LinkageTypes Linkage, unsigned AddrSpace, const Twine &N="", Module *M=nullptr)
Definition: Function.h:137
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::VersionTuple::getMinor
Optional< unsigned > getMinor() const
Retrieve the minor version number, if provided.
Definition: VersionTuple.h:71
llvm::Module::getModuleIdentifier
const std::string & getModuleIdentifier() const
Get the module identifier which is, essentially, the name of the module.
Definition: Module.h:227
llvm::Module::materializeMetadata
llvm::Error materializeMetadata()
Definition: Module.cpp:452
llvm::Module
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:67
llvm::MDNode
Metadata node.
Definition: Metadata.h:897
llvm::Module::setModuleFlag
void setModuleFlag(ModFlagBehavior Behavior, StringRef Key, Metadata *Val)
Like addModuleFlag but replaces the old module flag if it already exists.
Definition: Module.cpp:374
llvm::DICompileUnit::NoDebug
@ NoDebug
Definition: DebugInfoMetadata.h:1319
llvm::Module::setOwnedMemoryBuffer
void setOwnedMemoryBuffer(std::unique_ptr< MemoryBuffer > MB)
Take ownership of the given memory buffer.
Definition: Module.cpp:659
llvm::Module::Module
Module(StringRef ModuleID, LLVMContext &C)
The Module constructor.
Definition: Module.cpp:74
DataLayout.h
llvm::PIELevel::Default
@ Default
Definition: CodeGen.h:37
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:57
llvm::TypeFinder::run
void run(const Module &M, bool onlyNamed)
Definition: TypeFinder.cpp:31
llvm::TypeFinder
TypeFinder - Walk over a module, identifying all of the types that are used by the module.
Definition: TypeFinder.h:30
llvm::ConstantDataArray::get
static Constant * get(LLVMContext &Context, ArrayRef< ElementTy > Elts)
get() constructor - Return a constant with array type with an element count and element type matching...
Definition: Constants.h:690
uint32_t
llvm::ilist_node_impl::getIterator
self_iterator getIterator()
Definition: ilist_node.h:81
DL
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
Definition: AArch64SLSHardening.cpp:76
llvm::PICLevel::Level
Level
Definition: CodeGen.h:33
llvm::ProfileSummary::PSK_CSInstr
@ PSK_CSInstr
Definition: ProfileSummary.h:47
llvm::Init
Definition: Record.h:271
llvm::Module::getGlobalVariable
GlobalVariable * getGlobalVariable(StringRef Name) const
Look up the specified global variable in the module symbol table.
Definition: Module.h:408
llvm::NamedMDNode::operands
iterator_range< op_iterator > operands()
Definition: Metadata.h:1482
llvm::Module::getOperandBundleTags
void getOperandBundleTags(SmallVectorImpl< StringRef > &Result) const
Populate client supplied SmallVector with the bundle tags registered in this LLVMContext.
Definition: Module.cpp:130
llvm::Module::getSemanticInterposition
bool getSemanticInterposition() const
Returns whether semantic interposition is to be respected.
Definition: Module.cpp:645
llvm::Module::materialize
llvm::Error materialize(GlobalValue *GV)
Make sure the GlobalValue is fully read.
Definition: Module.cpp:438
Attributes.h
llvm::Module::debug_compile_units_iterator::operator->
DICompileUnit * operator->() const
Definition: Module.cpp:402
llvm::Twine
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:80
llvm::LLVMContext::getMDKindNames
void getMDKindNames(SmallVectorImpl< StringRef > &Result) const
getMDKindNames - Populate client supplied SmallVector with the name for custom metadata IDs registere...
Definition: LLVMContext.cpp:270
llvm::GraphProgram::Name
Name
Definition: GraphWriter.h:52
std
Definition: BitVector.h:838
llvm::Module::getMDKindID
unsigned getMDKindID(StringRef Name) const
Return a unique non-zero ID for the specified metadata kind.
Definition: Module.cpp:119
llvm::AMDGPU::SendMsg::Op
Op
Definition: SIDefines.h:314
llvm::Error
Lightweight error class with error context and mandatory checking.
Definition: Error.h:157
GlobalVariable.h
llvm::Module::getContext
LLVMContext & getContext() const
Get the global data context.
Definition: Module.h:261
Casting.h
Function.h
llvm::Module::getOrInsertNamedMetadata
NamedMDNode * getOrInsertNamedMetadata(StringRef Name)
Return the named MDNode in the module with the specified name.
Definition: Module.cpp:259
llvm::ProfileSummary::setPartialProfileRatio
void setPartialProfileRatio(double R)
Definition: ProfileSummary.h:98
llvm::Module::getDwarfVersion
unsigned getDwarfVersion() const
Returns the Dwarf Version by checking module flags.
Definition: Module.cpp:555
llvm::Module::getIdentifiedStructTypes
std::vector< StructType * > getIdentifiedStructTypes() const
Definition: Module.cpp:462
llvm::LLVMContext::getOperandBundleTags
void getOperandBundleTags(SmallVectorImpl< StringRef > &Result) const
getOperandBundleTags - Populate client supplied SmallVector with the bundle tags registered in this L...
Definition: LLVMContext.cpp:277
llvm::Module::getPIELevel
PIELevel::Level getPIELevel() const
Returns the PIE level (small or large model)
Definition: Module.cpp:601
llvm::Module::createRNG
std::unique_ptr< RandomNumberGenerator > createRNG(const StringRef Name) const
Get a RandomNumberGenerator salted for use with this module.
Definition: Module.cpp:91
GlobalAlias.h
llvm::Module::getPICLevel
PICLevel::Level getPICLevel() const
Returns the PIC level (small or large model)
Definition: Module.cpp:587
llvm::GlobalValue::ExternalLinkage
@ ExternalLinkage
Externally visible function.
Definition: GlobalValue.h:48
CodeGen.h
llvm::ProfileSummary::getNumCounts
uint32_t getNumCounts()
Definition: ProfileSummary.h:91
llvm::Module::setPartialSampleProfileRatio
void setPartialSampleProfileRatio(const ModuleSummaryIndex &Index)
Set the partial sample profile ratio in the profile summary module flag, if applicable.
Definition: Module.cpp:726
llvm::PIELevel::Level
Level
Definition: CodeGen.h:37
llvm::sys::path::filename
StringRef filename(StringRef path, Style style=Style::native)
Get filename.
Definition: Path.cpp:575
SmallVector.h
llvm::ValueSymbolTable
This class provides a symbol table of name/value pairs.
Definition: ValueSymbolTable.h:37
llvm::Module::addModuleFlag
void addModuleFlag(ModFlagBehavior Behavior, StringRef Key, Metadata *Val)
Add a module-level flag to the module-level flags metadata.
Definition: Module.cpp:348
lookup
static bool lookup(const GsymReader &GR, DataExtractor &Data, uint64_t &Offset, uint64_t BaseAddr, uint64_t Addr, SourceLocations &SrcLocs, llvm::Error &Err)
A Lookup helper functions.
Definition: InlineInfo.cpp:108
llvm::ModuleSummaryIndex
Class to hold module path string table and global value map, and encapsulate methods for operating on...
Definition: ModuleSummaryIndex.h:1026
llvm::Module::getNamedMetadata
NamedMDNode * getNamedMetadata(const Twine &Name) const
Return the first NamedMDNode in the module with the specified name.
Definition: Module.cpp:250
llvm::ProfileSummary::isPartialProfile
bool isPartialProfile()
Definition: ProfileSummary.h:96
llvm::Module::isValidModuleFlag
static bool isValidModuleFlag(const MDNode &ModFlag, ModFlagBehavior &MFB, MDString *&Key, Metadata *&Val)
Check if the given module flag metadata represents a valid module flag, and store the flag behavior,...
Definition: Module.cpp:287
llvm::DataLayout::reset
void reset(StringRef LayoutDescription)
Parse a data layout string (with fallback to default values).
Definition: DataLayout.cpp:178
llvm::iterator_range
A range adaptor for a pair of iterators.
Definition: iterator_range.h:30
llvm::FunctionCallee
A handy container for a FunctionType+Callee-pointer pair, which can be passed around as a single enti...
Definition: DerivedTypes.h:164
llvm::SmallVectorImpl< StringRef >
llvm::LLVMContext::getMDKindID
unsigned getMDKindID(StringRef Name) const
getMDKindID - Return a unique non-zero ID for the specified metadata kind.
Definition: LLVMContext.cpp:260
llvm::GlobalValue::getType
PointerType * getType() const
Global values are always pointers.
Definition: GlobalValue.h:271
llvm::Module::getDataLayout
const DataLayout & getDataLayout() const
Get the data layout for the module's target platform.
Definition: Module.cpp:397
DerivedTypes.h
llvm::Module::eraseNamedMetadata
void eraseNamedMetadata(NamedMDNode *NMD)
Remove the given NamedMDNode from this module and delete it.
Definition: Module.cpp:271
LLVMContext.h
llvm::Module::setProfileSummary
void setProfileSummary(Metadata *M, ProfileSummary::Kind Kind)
Attach profile summary metadata to this module.
Definition: Module.cpp:633
llvm::MDString::getString
StringRef getString() const
Definition: Metadata.cpp:477
llvm::AMDGPU::VGPRIndexMode::Id
Id
Definition: SIDefines.h:221
SymbolTableListTraits.h
llvm::MDString
A single uniqued string.
Definition: Metadata.h:611
Value.h
llvm::GlobalIFunc
Definition: GlobalIFunc.h:32
llvm::Value
LLVM Value Representation.
Definition: Value.h:75
llvm::Module::ModFlagBehavior
ModFlagBehavior
This enumeration defines the supported behaviors of module flags.
Definition: Module.h:117
llvm::Module::getNamedValue
GlobalValue * getNamedValue(StringRef Name) const
Return the global value in the module with the specified name, of arbitrary type.
Definition: Module.cpp:113
SpecialSubKind::string
@ string
Other
Optional< std::vector< StOtherPiece > > Other
Definition: ELFYAML.cpp:1163
llvm::FunctionType
Class to represent function types.
Definition: DerivedTypes.h:102
llvm::Intrinsic::ID
unsigned ID
Definition: TargetTransformInfo.h:38