LLVM  8.0.0svn
Module.h
Go to the documentation of this file.
1 //===- llvm/Module.h - C++ class to represent a VM module -------*- 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 /// @file
11 /// Module.h This file contains the declarations for the Module class.
12 //
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_IR_MODULE_H
16 #define LLVM_IR_MODULE_H
17 
18 #include "llvm-c/Types.h"
19 #include "llvm/ADT/Optional.h"
20 #include "llvm/ADT/STLExtras.h"
21 #include "llvm/ADT/StringMap.h"
22 #include "llvm/ADT/StringRef.h"
24 #include "llvm/IR/Attributes.h"
25 #include "llvm/IR/Comdat.h"
26 #include "llvm/IR/DataLayout.h"
27 #include "llvm/IR/Function.h"
28 #include "llvm/IR/GlobalAlias.h"
29 #include "llvm/IR/GlobalIFunc.h"
30 #include "llvm/IR/GlobalVariable.h"
31 #include "llvm/IR/Metadata.h"
34 #include "llvm/Support/CodeGen.h"
35 #include <cstddef>
36 #include <cstdint>
37 #include <iterator>
38 #include <memory>
39 #include <string>
40 #include <vector>
41 
42 namespace llvm {
43 
44 class Error;
45 class FunctionType;
46 class GVMaterializer;
47 class LLVMContext;
48 class MemoryBuffer;
49 class RandomNumberGenerator;
50 template <class PtrType> class SmallPtrSetImpl;
51 class StructType;
52 class VersionTuple;
53 
54 /// A Module instance is used to store all the information related to an
55 /// LLVM module. Modules are the top level container of all other LLVM
56 /// Intermediate Representation (IR) objects. Each module directly contains a
57 /// list of globals variables, a list of functions, a list of libraries (or
58 /// other modules) this module depends on, a symbol table, and various data
59 /// about the target's characteristics.
60 ///
61 /// A module maintains a GlobalValRefMap object that is used to hold all
62 /// constant references to global variables in the module. When a global
63 /// variable is destroyed, it should have no entries in the GlobalValueRefMap.
64 /// The main container class for the LLVM Intermediate Representation.
65 class Module {
66 /// @name Types And Enumerations
67 /// @{
68 public:
69  /// The type for the list of global variables.
71  /// The type for the list of functions.
73  /// The type for the list of aliases.
75  /// The type for the list of ifuncs.
77  /// The type for the list of named metadata.
79  /// The type of the comdat "symbol" table.
81 
82  /// The Global Variable iterator.
84  /// The Global Variable constant iterator.
86 
87  /// The Function iterators.
89  /// The Function constant iterator
91 
92  /// The Function reverse iterator.
94  /// The Function constant reverse iterator.
96 
97  /// The Global Alias iterators.
99  /// The Global Alias constant iterator
101 
102  /// The Global IFunc iterators.
104  /// The Global IFunc constant iterator
106 
107  /// The named metadata iterators.
109  /// The named metadata constant iterators.
111 
112  /// This enumeration defines the supported behaviors of module flags.
114  /// Emits an error if two values disagree, otherwise the resulting value is
115  /// that of the operands.
116  Error = 1,
117 
118  /// Emits a warning if two values disagree. The result value will be the
119  /// operand for the flag from the first module being linked.
120  Warning = 2,
121 
122  /// Adds a requirement that another module flag be present and have a
123  /// specified value after linking is performed. The value must be a metadata
124  /// pair, where the first element of the pair is the ID of the module flag
125  /// to be restricted, and the second element of the pair is the value the
126  /// module flag should be restricted to. This behavior can be used to
127  /// restrict the allowable results (via triggering of an error) of linking
128  /// IDs with the **Override** behavior.
129  Require = 3,
130 
131  /// Uses the specified value, regardless of the behavior or value of the
132  /// other module. If both modules specify **Override**, but the values
133  /// differ, an error will be emitted.
134  Override = 4,
135 
136  /// Appends the two values, which are required to be metadata nodes.
137  Append = 5,
138 
139  /// Appends the two values, which are required to be metadata
140  /// nodes. However, duplicate entries in the second list are dropped
141  /// during the append operation.
143 
144  /// Takes the max of the two values, which are required to be integers.
145  Max = 7,
146 
147  // Markers:
150  };
151 
152  /// Checks if Metadata represents a valid ModFlagBehavior, and stores the
153  /// converted result in MFB.
154  static bool isValidModFlagBehavior(Metadata *MD, ModFlagBehavior &MFB);
155 
160 
162  : Behavior(B), Key(K), Val(V) {}
163  };
164 
165 /// @}
166 /// @name Member Variables
167 /// @{
168 private:
169  LLVMContext &Context; ///< The LLVMContext from which types and
170  ///< constants are allocated.
171  GlobalListType GlobalList; ///< The Global Variables in the module
172  FunctionListType FunctionList; ///< The Functions in the module
173  AliasListType AliasList; ///< The Aliases in the module
174  IFuncListType IFuncList; ///< The IFuncs in the module
175  NamedMDListType NamedMDList; ///< The named metadata in the module
176  std::string GlobalScopeAsm; ///< Inline Asm at global scope.
177  ValueSymbolTable *ValSymTab; ///< Symbol table for values
178  ComdatSymTabType ComdatSymTab; ///< Symbol table for COMDATs
179  std::unique_ptr<MemoryBuffer>
180  OwnedMemoryBuffer; ///< Memory buffer directly owned by this
181  ///< module, for legacy clients only.
182  std::unique_ptr<GVMaterializer>
183  Materializer; ///< Used to materialize GlobalValues
184  std::string ModuleID; ///< Human readable identifier for the module
185  std::string SourceFileName; ///< Original source file name for module,
186  ///< recorded in bitcode.
187  std::string TargetTriple; ///< Platform target triple Module compiled on
188  ///< Format: (arch)(sub)-(vendor)-(sys0-(abi)
189  void *NamedMDSymTab; ///< NamedMDNode names.
190  DataLayout DL; ///< DataLayout associated with the module
191 
192  friend class Constant;
193 
194 /// @}
195 /// @name Constructors
196 /// @{
197 public:
198  /// The Module constructor. Note that there is no default constructor. You
199  /// must provide a name for the module upon construction.
200  explicit Module(StringRef ModuleID, LLVMContext& C);
201  /// The module destructor. This will dropAllReferences.
202  ~Module();
203 
204 /// @}
205 /// @name Module Level Accessors
206 /// @{
207 
208  /// Get the module identifier which is, essentially, the name of the module.
209  /// @returns the module identifier as a string
210  const std::string &getModuleIdentifier() const { return ModuleID; }
211 
212  /// Returns the number of non-debug IR instructions in the module.
213  /// This is equivalent to the sum of the IR instruction counts of each
214  /// function contained in the module.
215  unsigned getInstructionCount();
216 
217  /// Get the module's original source file name. When compiling from
218  /// bitcode, this is taken from a bitcode record where it was recorded.
219  /// For other compiles it is the same as the ModuleID, which would
220  /// contain the source file name.
221  const std::string &getSourceFileName() const { return SourceFileName; }
222 
223  /// Get a short "name" for the module.
224  ///
225  /// This is useful for debugging or logging. It is essentially a convenience
226  /// wrapper around getModuleIdentifier().
227  StringRef getName() const { return ModuleID; }
228 
229  /// Get the data layout string for the module's target platform. This is
230  /// equivalent to getDataLayout()->getStringRepresentation().
231  const std::string &getDataLayoutStr() const {
232  return DL.getStringRepresentation();
233  }
234 
235  /// Get the data layout for the module's target platform.
236  const DataLayout &getDataLayout() const;
237 
238  /// Get the target triple which is a string describing the target host.
239  /// @returns a string containing the target triple.
240  const std::string &getTargetTriple() const { return TargetTriple; }
241 
242  /// Get the global data context.
243  /// @returns LLVMContext - a container for LLVM's global information
244  LLVMContext &getContext() const { return Context; }
245 
246  /// Get any module-scope inline assembly blocks.
247  /// @returns a string containing the module-scope inline assembly blocks.
248  const std::string &getModuleInlineAsm() const { return GlobalScopeAsm; }
249 
250  /// Get a RandomNumberGenerator salted for use with this module. The
251  /// RNG can be seeded via -rng-seed=<uint64> and is salted with the
252  /// ModuleID and the provided pass salt. The returned RNG should not
253  /// be shared across threads or passes.
254  ///
255  /// A unique RNG per pass ensures a reproducible random stream even
256  /// when other randomness consuming passes are added or removed. In
257  /// addition, the random stream will be reproducible across LLVM
258  /// versions when the pass does not change.
259  std::unique_ptr<RandomNumberGenerator> createRNG(const Pass* P) const;
260 
261  /// Return true if size-info optimization remark is enabled, false
262  /// otherwise.
265  "size-info");
266  }
267 
268  /// @}
269  /// @name Module Level Mutators
270  /// @{
271 
272  /// Set the module identifier.
273  void setModuleIdentifier(StringRef ID) { ModuleID = ID; }
274 
275  /// Set the module's original source file name.
276  void setSourceFileName(StringRef Name) { SourceFileName = Name; }
277 
278  /// Set the data layout
279  void setDataLayout(StringRef Desc);
280  void setDataLayout(const DataLayout &Other);
281 
282  /// Set the target triple.
283  void setTargetTriple(StringRef T) { TargetTriple = T; }
284 
285  /// Set the module-scope inline assembly blocks.
286  /// A trailing newline is added if the input doesn't have one.
288  GlobalScopeAsm = Asm;
289  if (!GlobalScopeAsm.empty() && GlobalScopeAsm.back() != '\n')
290  GlobalScopeAsm += '\n';
291  }
292 
293  /// Append to the module-scope inline assembly blocks.
294  /// A trailing newline is added if the input doesn't have one.
296  GlobalScopeAsm += Asm;
297  if (!GlobalScopeAsm.empty() && GlobalScopeAsm.back() != '\n')
298  GlobalScopeAsm += '\n';
299  }
300 
301 /// @}
302 /// @name Generic Value Accessors
303 /// @{
304 
305  /// Return the global value in the module with the specified name, of
306  /// arbitrary type. This method returns null if a global with the specified
307  /// name is not found.
309 
310  /// Return a unique non-zero ID for the specified metadata kind. This ID is
311  /// uniqued across modules in the current LLVMContext.
312  unsigned getMDKindID(StringRef Name) const;
313 
314  /// Populate client supplied SmallVector with the name for custom metadata IDs
315  /// registered in this LLVMContext.
316  void getMDKindNames(SmallVectorImpl<StringRef> &Result) const;
317 
318  /// Populate client supplied SmallVector with the bundle tags registered in
319  /// this LLVMContext. The bundle tags are ordered by increasing bundle IDs.
320  /// \see LLVMContext::getOperandBundleTagID
322 
323  /// Return the type with the specified name, or null if there is none by that
324  /// name.
325  StructType *getTypeByName(StringRef Name) const;
326 
327  std::vector<StructType *> getIdentifiedStructTypes() const;
328 
329 /// @}
330 /// @name Function Accessors
331 /// @{
332 
333  /// Look up the specified function in the module symbol table. Four
334  /// possibilities:
335  /// 1. If it does not exist, add a prototype for the function and return it.
336  /// 2. If it exists, and has a local linkage, the existing function is
337  /// renamed and a new one is inserted.
338  /// 3. Otherwise, if the existing function has the correct prototype, return
339  /// the existing function.
340  /// 4. Finally, the function exists but has the wrong prototype: return the
341  /// function with a constantexpr cast to the right prototype.
344 
346 
347  /// Look up the specified function in the module symbol table. If it does not
348  /// exist, add a prototype for the function and return it. This function
349  /// guarantees to return a constant of pointer to the specified function type
350  /// or a ConstantExpr BitCast of that type if the named function has a
351  /// different type. This version of the method takes a list of
352  /// function arguments, which makes it easier for clients to use.
353  template<typename... ArgsTy>
355  AttributeList AttributeList,
356  Type *RetTy, ArgsTy... Args)
357  {
358  SmallVector<Type*, sizeof...(ArgsTy)> ArgTys{Args...};
359  return getOrInsertFunction(Name,
360  FunctionType::get(RetTy, ArgTys, false),
361  AttributeList);
362  }
363 
364  /// Same as above, but without the attributes.
365  template<typename... ArgsTy>
366  Constant *getOrInsertFunction(StringRef Name, Type *RetTy, ArgsTy... Args) {
367  return getOrInsertFunction(Name, AttributeList{}, RetTy, Args...);
368  }
369 
370  /// Look up the specified function in the module symbol table. If it does not
371  /// exist, return null.
372  Function *getFunction(StringRef Name) const;
373 
374 /// @}
375 /// @name Global Variable Accessors
376 /// @{
377 
378  /// Look up the specified global variable in the module symbol table. If it
379  /// does not exist, return null. If AllowInternal is set to true, this
380  /// function will return types that have InternalLinkage. By default, these
381  /// types are not returned.
383  return getGlobalVariable(Name, false);
384  }
385 
386  GlobalVariable *getGlobalVariable(StringRef Name, bool AllowInternal) const;
387 
389  bool AllowInternal = false) {
390  return static_cast<const Module *>(this)->getGlobalVariable(Name,
391  AllowInternal);
392  }
393 
394  /// Return the global variable in the module with the specified name, of
395  /// arbitrary type. This method returns null if a global with the specified
396  /// name is not found.
398  return getGlobalVariable(Name, true);
399  }
401  return const_cast<GlobalVariable *>(
402  static_cast<const Module *>(this)->getNamedGlobal(Name));
403  }
404 
405  /// Look up the specified global in the module symbol table.
406  /// 1. If it does not exist, add a declaration of the global and return it.
407  /// 2. Else, the global exists but has the wrong type: return the function
408  /// with a constantexpr cast to the right type.
409  /// 3. Finally, if the existing global is the correct declaration, return
410  /// the existing global.
412 
413 /// @}
414 /// @name Global Alias Accessors
415 /// @{
416 
417  /// Return the global alias in the module with the specified name, of
418  /// arbitrary type. This method returns null if a global with the specified
419  /// name is not found.
420  GlobalAlias *getNamedAlias(StringRef Name) const;
421 
422 /// @}
423 /// @name Global IFunc Accessors
424 /// @{
425 
426  /// Return the global ifunc in the module with the specified name, of
427  /// arbitrary type. This method returns null if a global with the specified
428  /// name is not found.
429  GlobalIFunc *getNamedIFunc(StringRef Name) const;
430 
431 /// @}
432 /// @name Named Metadata Accessors
433 /// @{
434 
435  /// Return the first NamedMDNode in the module with the specified name. This
436  /// method returns null if a NamedMDNode with the specified name is not found.
437  NamedMDNode *getNamedMetadata(const Twine &Name) const;
438 
439  /// Return the named MDNode in the module with the specified name. This method
440  /// returns a new NamedMDNode if a NamedMDNode with the specified name is not
441  /// found.
443 
444  /// Remove the given NamedMDNode from this module and delete it.
445  void eraseNamedMetadata(NamedMDNode *NMD);
446 
447 /// @}
448 /// @name Comdat Accessors
449 /// @{
450 
451  /// Return the Comdat in the module with the specified name. It is created
452  /// if it didn't already exist.
454 
455 /// @}
456 /// @name Module Flags Accessors
457 /// @{
458 
459  /// Returns the module flags in the provided vector.
461 
462  /// Return the corresponding value if Key appears in module flags, otherwise
463  /// return null.
465 
466  /// Returns the NamedMDNode in the module that represents module-level flags.
467  /// This method returns null if there are no module-level flags.
469 
470  /// Returns the NamedMDNode in the module that represents module-level flags.
471  /// If module-level flags aren't found, it creates the named metadata that
472  /// contains them.
474 
475  /// Add a module-level flag to the module-level flags metadata. It will create
476  /// the module-level flags named metadata if it doesn't already exist.
478  void addModuleFlag(ModFlagBehavior Behavior, StringRef Key, Constant *Val);
479  void addModuleFlag(ModFlagBehavior Behavior, StringRef Key, uint32_t Val);
480  void addModuleFlag(MDNode *Node);
481 
482 /// @}
483 /// @name Materialization
484 /// @{
485 
486  /// Sets the GVMaterializer to GVM. This module must not yet have a
487  /// Materializer. To reset the materializer for a module that already has one,
488  /// call materializeAll first. Destroying this module will destroy
489  /// its materializer without materializing any more GlobalValues. Without
490  /// destroying the Module, there is no way to detach or destroy a materializer
491  /// without materializing all the GVs it controls, to avoid leaving orphan
492  /// unmaterialized GVs.
493  void setMaterializer(GVMaterializer *GVM);
494  /// Retrieves the GVMaterializer, if any, for this Module.
495  GVMaterializer *getMaterializer() const { return Materializer.get(); }
496  bool isMaterialized() const { return !getMaterializer(); }
497 
498  /// Make sure the GlobalValue is fully read.
500 
501  /// Make sure all GlobalValues in this Module are fully read and clear the
502  /// Materializer.
504 
506 
507 /// @}
508 /// @name Direct access to the globals list, functions list, and symbol table
509 /// @{
510 
511  /// Get the Module's list of global variables (constant).
512  const GlobalListType &getGlobalList() const { return GlobalList; }
513  /// Get the Module's list of global variables.
514  GlobalListType &getGlobalList() { return GlobalList; }
515 
517  return &Module::GlobalList;
518  }
519 
520  /// Get the Module's list of functions (constant).
521  const FunctionListType &getFunctionList() const { return FunctionList; }
522  /// Get the Module's list of functions.
523  FunctionListType &getFunctionList() { return FunctionList; }
525  return &Module::FunctionList;
526  }
527 
528  /// Get the Module's list of aliases (constant).
529  const AliasListType &getAliasList() const { return AliasList; }
530  /// Get the Module's list of aliases.
531  AliasListType &getAliasList() { return AliasList; }
532 
534  return &Module::AliasList;
535  }
536 
537  /// Get the Module's list of ifuncs (constant).
538  const IFuncListType &getIFuncList() const { return IFuncList; }
539  /// Get the Module's list of ifuncs.
540  IFuncListType &getIFuncList() { return IFuncList; }
541 
543  return &Module::IFuncList;
544  }
545 
546  /// Get the Module's list of named metadata (constant).
547  const NamedMDListType &getNamedMDList() const { return NamedMDList; }
548  /// Get the Module's list of named metadata.
549  NamedMDListType &getNamedMDList() { return NamedMDList; }
550 
552  return &Module::NamedMDList;
553  }
554 
555  /// Get the symbol table of global variable and function identifiers
556  const ValueSymbolTable &getValueSymbolTable() const { return *ValSymTab; }
557  /// Get the Module's symbol table of global variable and function identifiers.
558  ValueSymbolTable &getValueSymbolTable() { return *ValSymTab; }
559 
560  /// Get the Module's symbol table for COMDATs (constant).
561  const ComdatSymTabType &getComdatSymbolTable() const { return ComdatSymTab; }
562  /// Get the Module's symbol table for COMDATs.
563  ComdatSymTabType &getComdatSymbolTable() { return ComdatSymTab; }
564 
565 /// @}
566 /// @name Global Variable Iteration
567 /// @{
568 
569  global_iterator global_begin() { return GlobalList.begin(); }
570  const_global_iterator global_begin() const { return GlobalList.begin(); }
571  global_iterator global_end () { return GlobalList.end(); }
572  const_global_iterator global_end () const { return GlobalList.end(); }
573  bool global_empty() const { return GlobalList.empty(); }
574 
576  return make_range(global_begin(), global_end());
577  }
579  return make_range(global_begin(), global_end());
580  }
581 
582 /// @}
583 /// @name Function Iteration
584 /// @{
585 
586  iterator begin() { return FunctionList.begin(); }
587  const_iterator begin() const { return FunctionList.begin(); }
588  iterator end () { return FunctionList.end(); }
589  const_iterator end () const { return FunctionList.end(); }
590  reverse_iterator rbegin() { return FunctionList.rbegin(); }
591  const_reverse_iterator rbegin() const{ return FunctionList.rbegin(); }
592  reverse_iterator rend() { return FunctionList.rend(); }
593  const_reverse_iterator rend() const { return FunctionList.rend(); }
594  size_t size() const { return FunctionList.size(); }
595  bool empty() const { return FunctionList.empty(); }
596 
598  return make_range(begin(), end());
599  }
601  return make_range(begin(), end());
602  }
603 
604 /// @}
605 /// @name Alias Iteration
606 /// @{
607 
608  alias_iterator alias_begin() { return AliasList.begin(); }
609  const_alias_iterator alias_begin() const { return AliasList.begin(); }
610  alias_iterator alias_end () { return AliasList.end(); }
611  const_alias_iterator alias_end () const { return AliasList.end(); }
612  size_t alias_size () const { return AliasList.size(); }
613  bool alias_empty() const { return AliasList.empty(); }
614 
616  return make_range(alias_begin(), alias_end());
617  }
619  return make_range(alias_begin(), alias_end());
620  }
621 
622 /// @}
623 /// @name IFunc Iteration
624 /// @{
625 
626  ifunc_iterator ifunc_begin() { return IFuncList.begin(); }
627  const_ifunc_iterator ifunc_begin() const { return IFuncList.begin(); }
628  ifunc_iterator ifunc_end () { return IFuncList.end(); }
629  const_ifunc_iterator ifunc_end () const { return IFuncList.end(); }
630  size_t ifunc_size () const { return IFuncList.size(); }
631  bool ifunc_empty() const { return IFuncList.empty(); }
632 
634  return make_range(ifunc_begin(), ifunc_end());
635  }
637  return make_range(ifunc_begin(), ifunc_end());
638  }
639 
640  /// @}
641  /// @name Convenience iterators
642  /// @{
643 
644  using global_object_iterator =
649 
651  return concat<GlobalObject>(functions(), globals());
652  }
654  return concat<const GlobalObject>(functions(), globals());
655  }
656 
658  return global_objects().begin();
659  }
661 
663  return global_objects().begin();
664  }
666  return global_objects().end();
667  }
668 
669  using global_value_iterator =
675 
677  return concat<GlobalValue>(functions(), globals(), aliases(), ifuncs());
678  }
680  return concat<const GlobalValue>(functions(), globals(), aliases(),
681  ifuncs());
682  }
683 
686 
688  return global_values().begin();
689  }
691  return global_values().end();
692  }
693 
694  /// @}
695  /// @name Named Metadata Iteration
696  /// @{
697 
698  named_metadata_iterator named_metadata_begin() { return NamedMDList.begin(); }
700  return NamedMDList.begin();
701  }
702 
703  named_metadata_iterator named_metadata_end() { return NamedMDList.end(); }
705  return NamedMDList.end();
706  }
707 
708  size_t named_metadata_size() const { return NamedMDList.size(); }
709  bool named_metadata_empty() const { return NamedMDList.empty(); }
710 
713  }
716  }
717 
718  /// An iterator for DICompileUnits that skips those marked NoDebug.
720  : public std::iterator<std::input_iterator_tag, DICompileUnit *> {
721  NamedMDNode *CUs;
722  unsigned Idx;
723 
724  void SkipNoDebugCUs();
725 
726  public:
727  explicit debug_compile_units_iterator(NamedMDNode *CUs, unsigned Idx)
728  : CUs(CUs), Idx(Idx) {
729  SkipNoDebugCUs();
730  }
731 
733  ++Idx;
734  SkipNoDebugCUs();
735  return *this;
736  }
737 
740  ++Idx;
741  return T;
742  }
743 
745  return Idx == I.Idx;
746  }
747 
749  return Idx != I.Idx;
750  }
751 
752  DICompileUnit *operator*() const;
753  DICompileUnit *operator->() const;
754  };
755 
757  auto *CUs = getNamedMetadata("llvm.dbg.cu");
758  return debug_compile_units_iterator(CUs, 0);
759  }
760 
762  auto *CUs = getNamedMetadata("llvm.dbg.cu");
763  return debug_compile_units_iterator(CUs, CUs ? CUs->getNumOperands() : 0);
764  }
765 
766  /// Return an iterator for all DICompileUnits listed in this Module's
767  /// llvm.dbg.cu named metadata node and aren't explicitly marked as
768  /// NoDebug.
770  auto *CUs = getNamedMetadata("llvm.dbg.cu");
771  return make_range(
773  debug_compile_units_iterator(CUs, CUs ? CUs->getNumOperands() : 0));
774  }
775 /// @}
776 
777  /// Destroy ConstantArrays in LLVMContext if they are not used.
778  /// ConstantArrays constructed during linking can cause quadratic memory
779  /// explosion. Releasing all unused constants can cause a 20% LTO compile-time
780  /// slowdown for a large application.
781  ///
782  /// NOTE: Constants are currently owned by LLVMContext. This can then only
783  /// be called where all uses of the LLVMContext are understood.
785 
786 /// @name Utility functions for printing and dumping Module objects
787 /// @{
788 
789  /// Print the module to an output stream with an optional
790  /// AssemblyAnnotationWriter. If \c ShouldPreserveUseListOrder, then include
791  /// uselistorder directives so that use-lists can be recreated when reading
792  /// the assembly.
794  bool ShouldPreserveUseListOrder = false,
795  bool IsForDebug = false) const;
796 
797  /// Dump the module to stderr (for debugging).
798  void dump() const;
799 
800  /// This function causes all the subinstructions to "let go" of all references
801  /// that they are maintaining. This allows one to 'delete' a whole class at
802  /// a time, even though there may be circular references... first all
803  /// references are dropped, and all use counts go to zero. Then everything
804  /// is delete'd for real. Note that no operations are valid on an object
805  /// that has "dropped all references", except operator delete.
806  void dropAllReferences();
807 
808 /// @}
809 /// @name Utility functions for querying Debug information.
810 /// @{
811 
812  /// Returns the Number of Register ParametersDwarf Version by checking
813  /// module flags.
814  unsigned getNumberRegisterParameters() const;
815 
816  /// Returns the Dwarf Version by checking module flags.
817  unsigned getDwarfVersion() const;
818 
819  /// Returns the CodeView Version by checking module flags.
820  /// Returns zero if not present in module.
821  unsigned getCodeViewFlag() const;
822 
823 /// @}
824 /// @name Utility functions for querying and setting PIC level
825 /// @{
826 
827  /// Returns the PIC level (small or large model)
829 
830  /// Set the PIC level (small or large model)
832 /// @}
833 
834 /// @}
835 /// @name Utility functions for querying and setting PIE level
836 /// @{
837 
838  /// Returns the PIE level (small or large model)
840 
841  /// Set the PIE level (small or large model)
842  void setPIELevel(PIELevel::Level PL);
843 /// @}
844 
845  /// @}
846  /// @name Utility function for querying and setting code model
847  /// @{
848 
849  /// Returns the code model (tiny, small, kernel, medium or large model)
851 
852  /// Set the code model (tiny, small, kernel, medium or large)
854  /// @}
855 
856  /// @name Utility functions for querying and setting PGO summary
857  /// @{
858 
859  /// Attach profile summary metadata to this module.
860  void setProfileSummary(Metadata *M);
861 
862  /// Returns profile summary metadata
864  /// @}
865 
866  /// Returns true if PLT should be avoided for RTLib calls.
867  bool getRtLibUseGOT() const;
868 
869  /// Set that PLT should be avoid for RTLib calls.
870  void setRtLibUseGOT();
871 
872  /// @name Utility functions for querying and setting the build SDK version
873  /// @{
874 
875  /// Attach a build SDK version metadata to this module.
876  void setSDKVersion(const VersionTuple &V);
877 
878  /// Get the build SDK version metadata.
879  ///
880  /// An empty version is returned if no such metadata is attached.
881  VersionTuple getSDKVersion() const;
882  /// @}
883 
884  /// Take ownership of the given memory buffer.
885  void setOwnedMemoryBuffer(std::unique_ptr<MemoryBuffer> MB);
886 };
887 
888 /// Given "llvm.used" or "llvm.compiler.used" as a global name, collect
889 /// the initializer elements of that global in Set and return the global itself.
892  bool CompilerUsed);
893 
894 /// An raw_ostream inserter for modules.
896  M.print(O, nullptr);
897  return O;
898 }
899 
900 // Create wrappers for C Binding types (see CBindingWrapping.h).
902 
903 /* LLVMModuleProviderRef exists for historical reasons, but now just holds a
904  * Module.
905  */
907  return reinterpret_cast<Module*>(MP);
908 }
909 
910 } // end namespace llvm
911 
912 #endif // LLVM_IR_MODULE_H
Pass interface - Implemented by all &#39;passes&#39;.
Definition: Pass.h:81
uint64_t CallInst * C
debug_compile_units_iterator debug_compile_units_end() const
Definition: Module.h:761
const_alias_iterator alias_end() const
Definition: Module.h:611
A parsed version of the target data layout string in and methods for querying it. ...
Definition: DataLayout.h:111
const std::string & getTargetTriple() const
Get the target triple which is a string describing the target host.
Definition: Module.h:240
This class provides a symbol table of name/value pairs.
const_named_metadata_iterator named_metadata_begin() const
Definition: Module.h:699
llvm::Error materializeAll()
Make sure all GlobalValues in this Module are fully read and clear the Materializer.
Definition: Module.cpp:397
LLVMContext & Context
ValueSymbolTable & getValueSymbolTable()
Get the Module&#39;s symbol table of global variable and function identifiers.
Definition: Module.h:558
const_reverse_iterator rend() const
Definition: Module.h:593
Takes the max of the two values, which are required to be integers.
Definition: Module.h:145
This class represents lattice values for constants.
Definition: AllocatorList.h:24
struct LLVMOpaqueModule * LLVMModuleRef
The top-level container for all other LLVM Intermediate Representation (IR) objects.
Definition: Types.h:62
Constant * getOrInsertFunction(StringRef Name, FunctionType *T, AttributeList AttributeList)
Look up the specified function in the module symbol table.
Definition: Module.cpp:144
NamedMDNode * getModuleFlagsMetadata() const
Returns the NamedMDNode in the module that represents module-level flags.
Definition: Module.cpp:319
A Module instance is used to store all the information related to an LLVM module. ...
Definition: Module.h:65
void setModuleIdentifier(StringRef ID)
Set the module identifier.
Definition: Module.h:273
const ValueSymbolTable & getValueSymbolTable() const
Get the symbol table of global variable and function identifiers.
Definition: Module.h:556
This provides a very simple, boring adaptor for a begin and end iterator into a range type...
void setMaterializer(GVMaterializer *GVM)
Sets the GVMaterializer to GVM.
Definition: Module.cpp:383
const std::string & getStringRepresentation() const
Returns the string representation of the DataLayout.
Definition: DataLayout.h:229
size_t named_metadata_size() const
Definition: Module.h:708
debug_compile_units_iterator operator++(int)
Definition: Module.h:738
named_metadata_iterator named_metadata_end()
Definition: Module.h:703
This file contains the declarations for metadata subclasses.
FunctionListType::iterator iterator
The Function iterators.
Definition: Module.h:88
const GlobalVariable * getNamedGlobal(StringRef Name) const
Return the global variable in the module with the specified name, of arbitrary type.
Definition: Module.h:397
ifunc_iterator ifunc_end()
Definition: Module.h:628
This file contains the declaration of the Comdat class, which represents a single COMDAT in LLVM...
iterator_range< const_iterator > functions() const
Definition: Module.h:600
bool global_empty() const
Definition: Module.h:573
NamedMDNode * getOrInsertNamedMetadata(StringRef Name)
Return the named MDNode in the module with the specified name.
Definition: Module.cpp:255
const_iterator begin() const
Definition: Module.h:587
void setDataLayout(StringRef Desc)
Set the data layout.
Definition: Module.cpp:359
global_object_iterator global_object_begin()
Definition: Module.h:657
debug_compile_units_iterator & operator++()
Definition: Module.h:732
const_reverse_iterator rbegin() const
Definition: Module.h:591
const std::string & getDataLayoutStr() const
Get the data layout string for the module&#39;s target platform.
Definition: Module.h:231
Optional< CodeModel::Model > getCodeModel() const
Returns the code model (tiny, small, kernel, medium or large model)
Definition: Module.cpp:512
GlobalVariable * getGlobalVariable(StringRef Name) const
Look up the specified global variable in the module symbol table.
Definition: Module.h:382
const_global_iterator global_end() const
Definition: Module.h:572
Metadata node.
Definition: Metadata.h:864
StringRef getName() const
Get a short "name" for the module.
Definition: Module.h:227
AliasListType::iterator alias_iterator
The Global Alias iterators.
Definition: Module.h:98
const GlobalListType & getGlobalList() const
Get the Module&#39;s list of global variables (constant).
Definition: Module.h:512
iterator_range< const_ifunc_iterator > ifuncs() const
Definition: Module.h:636
const_ifunc_iterator ifunc_begin() const
Definition: Module.h:627
A templated base class for SmallPtrSet which provides the typesafe interface that is common across al...
Definition: SmallPtrSet.h:344
Adds a requirement that another module flag be present and have a specified value after linking is pe...
Definition: Module.h:129
const AliasListType & getAliasList() const
Get the Module&#39;s list of aliases (constant).
Definition: Module.h:529
iterator_range< global_object_iterator > global_objects()
Definition: Module.h:650
ComdatSymTabType & getComdatSymbolTable()
Get the Module&#39;s symbol table for COMDATs.
Definition: Module.h:563
ModFlagBehavior Behavior
Definition: Module.h:157
Appends the two values, which are required to be metadata nodes.
Definition: Module.h:137
GlobalAlias * getNamedAlias(StringRef Name) const
Return the global alias in the module with the specified name, of arbitrary type. ...
Definition: Module.cpp:235
A tuple of MDNodes.
Definition: Metadata.h:1326
iterator_range< const_global_iterator > globals() const
Definition: Module.h:578
amdgpu Simplify well known AMD library false Value Value const Twine & Name
#define DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ty, ref)
const DataLayout & getDataLayout() const
Get the data layout for the module&#39;s target platform.
Definition: Module.cpp:365
global_value_iterator global_value_end()
Definition: Module.h:685
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:81
Attribute unwrap(LLVMAttributeRef Attr)
Definition: Attributes.h:195
void eraseNamedMetadata(NamedMDNode *NMD)
Remove the given NamedMDNode from this module and delete it.
Definition: Module.cpp:268
const ComdatSymTabType & getComdatSymbolTable() const
Get the Module&#39;s symbol table for COMDATs (constant).
Definition: Module.h:561
Class to represent struct types.
Definition: DerivedTypes.h:201
LLVMContext & getContext() const
Get the global data context.
Definition: Module.h:244
unsigned getInstructionCount()
Returns the number of non-debug IR instructions in the module.
Definition: Module.cpp:471
This file contains the simple types necessary to represent the attributes associated with functions a...
void setModuleInlineAsm(StringRef Asm)
Set the module-scope inline assembly blocks.
Definition: Module.h:287
Metadata * getProfileSummary()
Returns profile summary metadata.
Definition: Module.cpp:534
ELFYAML::ELF_STO Other
Definition: ELFYAML.cpp:783
APInt operator*(APInt a, uint64_t RHS)
Definition: APInt.h:2091
global_iterator global_begin()
Definition: Module.h:569
Class to represent function types.
Definition: DerivedTypes.h:103
reverse_iterator rend()
Definition: Module.h:592
void setRtLibUseGOT()
Set that PLT should be avoid for RTLib calls.
Definition: Module.cpp:547
NamedMDListType & getNamedMDList()
Get the Module&#39;s list of named metadata.
Definition: Module.h:549
const_iterator end() const
Definition: Module.h:589
bool empty() const
Definition: Module.h:595
bool operator==(const debug_compile_units_iterator &I) const
Definition: Module.h:744
#define T
NamedMDNode * getNamedMetadata(const Twine &Name) const
Return the first NamedMDNode in the module with the specified name.
Definition: Module.cpp:246
GlobalValue * getNamedValue(StringRef Name) const
Return the global value in the module with the specified name, of arbitrary type. ...
Definition: Module.cpp:114
debug_compile_units_iterator debug_compile_units_begin() const
Definition: Module.h:756
global_object_iterator global_object_end()
Definition: Module.h:660
iterator_range< const_alias_iterator > aliases() const
Definition: Module.h:618
void dropAllReferences()
This function causes all the subinstructions to "let go" of all references that they are maintaining...
Definition: Module.cpp:435
const_alias_iterator alias_begin() const
Definition: Module.h:609
IFuncListType & getIFuncList()
Get the Module&#39;s list of ifuncs.
Definition: Module.h:540
const std::string & getSourceFileName() const
Get the module&#39;s original source file name.
Definition: Module.h:221
unsigned getCodeViewFlag() const
Returns the CodeView Version by checking module flags.
Definition: Module.cpp:464
static AliasListType Module::* getSublistAccess(GlobalAlias *)
Definition: Module.h:533
bool alias_empty() const
Definition: Module.h:613
void getOperandBundleTags(SmallVectorImpl< StringRef > &Result) const
Populate client supplied SmallVector with the bundle tags registered in this LLVMContext.
Definition: Module.cpp:131
static IFuncListType Module::* getSublistAccess(GlobalIFunc *)
Definition: Module.h:542
#define P(N)
Module(StringRef ModuleID, LLVMContext &C)
The Module constructor.
Definition: Module.cpp:74
Emits an error if two values disagree, otherwise the resulting value is that of the operands...
Definition: Module.h:116
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
iterator_range< iterator > functions()
Definition: Module.h:597
alias_iterator alias_end()
Definition: Module.h:610
PIELevel::Level getPIELevel() const
Returns the PIE level (small or large model)
Definition: Module.cpp:498
const FunctionListType & getFunctionList() const
Get the Module&#39;s list of functions (constant).
Definition: Module.h:521
The instances of the Type class are immutable: once they are created, they are never changed...
Definition: Type.h:46
AliasListType & getAliasList()
Get the Module&#39;s list of aliases.
Definition: Module.h:531
iterator_range< const_global_object_iterator > global_objects() const
Definition: Module.h:653
This is an important class for using LLVM in a threaded context.
Definition: LLVMContext.h:69
Constant * getOrInsertGlobal(StringRef Name, Type *Ty)
Look up the specified global in the module symbol table.
Definition: Module.cpp:206
Metadata * getModuleFlag(StringRef Key) const
Return the corresponding value if Key appears in module flags, otherwise return null.
Definition: Module.cpp:306
bool shouldEmitInstrCountChangedRemark()
Return true if size-info optimization remark is enabled, false otherwise.
Definition: Module.h:263
This is an important base class in LLVM.
Definition: Constant.h:42
ifunc_iterator ifunc_begin()
Definition: Module.h:626
iterator_range< const_global_value_iterator > global_values() const
Definition: Module.h:679
void dump() const
Dump the module to stderr (for debugging).
Definition: AsmWriter.cpp:4307
static GlobalListType Module::* getSublistAccess(GlobalVariable *)
Definition: Module.h:516
amdgpu inline
ModFlagBehavior
This enumeration defines the supported behaviors of module flags.
Definition: Module.h:113
size_t alias_size() const
Definition: Module.h:612
iterator_range< named_metadata_iterator > named_metadata()
Definition: Module.h:711
static FunctionListType Module::* getSublistAccess(Function *)
Definition: Module.h:524
void addModuleFlag(ModFlagBehavior Behavior, StringRef Key, Metadata *Val)
Add a module-level flag to the module-level flags metadata.
Definition: Module.cpp:333
void setCodeModel(CodeModel::Model CL)
Set the code model (tiny, small, kernel, medium or large)
Definition: Module.cpp:522
AliasListType::const_iterator const_alias_iterator
The Global Alias constant iterator.
Definition: Module.h:100
static FunctionType * get(Type *Result, ArrayRef< Type *> Params, bool isVarArg)
This static method is the primary way of constructing a FunctionType.
Definition: Type.cpp:297
const_global_value_iterator global_value_end() const
Definition: Module.h:690
An iterator for DICompileUnits that skips those marked NoDebug.
Definition: Module.h:719
struct LLVMOpaqueModuleProvider * LLVMModuleProviderRef
Interface used to provide a module to JIT or interpreter.
Definition: Types.h:125
Comdat * getOrInsertComdat(StringRef Name)
Return the Comdat in the module with the specified name.
Definition: Module.cpp:478
const NamedMDListType & getNamedMDList() const
Get the Module&#39;s list of named metadata (constant).
Definition: Module.h:547
const std::string & getModuleIdentifier() const
Get the module identifier which is, essentially, the name of the module.
Definition: Module.h:210
unsigned getDwarfVersion() const
Returns the Dwarf Version by checking module flags.
Definition: Module.cpp:457
An intrusive list with ownership and callbacks specified/controlled by ilist_traits, only with API safe for polymorphic types.
Definition: ilist.h:390
const_global_value_iterator global_value_begin() const
Definition: Module.h:687
const IFuncListType & getIFuncList() const
Get the Module&#39;s list of ifuncs (constant).
Definition: Module.h:538
std::vector< StructType * > getIdentifiedStructTypes() const
Definition: Module.cpp:414
reverse_iterator rbegin()
Definition: Module.h:590
void print(raw_ostream &OS, AssemblyAnnotationWriter *AAW, bool ShouldPreserveUseListOrder=false, bool IsForDebug=false) const
Print the module to an output stream with an optional AssemblyAnnotationWriter.
Definition: AsmWriter.cpp:4066
global_iterator global_end()
Definition: Module.h:571
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
GlobalVariable * collectUsedGlobalVariables(const Module &M, SmallPtrSetImpl< GlobalValue *> &Set, bool CompilerUsed)
Given "llvm.used" or "llvm.compiler.used" as a global name, collect the initializer elements of that ...
Definition: Module.cpp:590
Iterator for intrusive lists based on ilist_node.
ModuleFlagEntry(ModFlagBehavior B, MDString *K, Metadata *V)
Definition: Module.h:161
GlobalListType & getGlobalList()
Get the Module&#39;s list of global variables.
Definition: Module.h:514
void dropTriviallyDeadConstantArrays()
Destroy ConstantArrays in LLVMContext if they are not used.
This is a &#39;vector&#39; (really, a variable-sized array), optimized for the case when the array is small...
Definition: SmallVector.h:847
static bool isValidModFlagBehavior(Metadata *MD, ModFlagBehavior &MFB)
Checks if Metadata represents a valid ModFlagBehavior, and stores the converted result in MFB...
Definition: Module.cpp:273
GlobalVariable * getNamedGlobal(StringRef Name)
Definition: Module.h:400
NamedMDNode * getOrInsertModuleFlagsMetadata()
Returns the NamedMDNode in the module that represents module-level flags.
Definition: Module.cpp:326
alias_iterator alias_begin()
Definition: Module.h:608
const_ifunc_iterator ifunc_end() const
Definition: Module.h:629
Constant * getOrInsertFunction(StringRef Name, Type *RetTy, ArgsTy... Args)
Same as above, but without the attributes.
Definition: Module.h:366
size_t ifunc_size() const
Definition: Module.h:630
static NamedMDListType Module::* getSublistAccess(NamedMDNode *)
Definition: Module.h:551
Uses the specified value, regardless of the behavior or value of the other module.
Definition: Module.h:134
Function * getFunction(StringRef Name) const
Look up the specified function in the module symbol table.
Definition: Module.cpp:176
A range adaptor for a pair of iterators.
Constant * getOrInsertFunction(StringRef Name, AttributeList AttributeList, Type *RetTy, ArgsTy... Args)
Look up the specified function in the module symbol table.
Definition: Module.h:354
Emits a warning if two values disagree.
Definition: Module.h:120
FunctionListType & getFunctionList()
Get the Module&#39;s list of functions.
Definition: Module.h:523
bool getRtLibUseGOT() const
Returns true if PLT should be avoided for RTLib calls.
Definition: Module.cpp:542
const_global_object_iterator global_object_begin() const
Definition: Module.h:662
const_named_metadata_iterator named_metadata_end() const
Definition: Module.h:704
bool isMaterialized() const
Definition: Module.h:496
void setProfileSummary(Metadata *M)
Attach profile summary metadata to this module.
Definition: Module.cpp:530
debug_compile_units_iterator(NamedMDNode *CUs, unsigned Idx)
Definition: Module.h:727
Represents a version number in the form major[.minor[.subminor[.build]]].
Definition: VersionTuple.h:27
virtual bool isAnalysisRemarkEnabled(StringRef PassName) const
Return true if analysis remarks are enabled, override to provide different implementation.
iterator end()
Definition: Module.h:588
Appends the two values, which are required to be metadata nodes.
Definition: Module.h:142
bool ifunc_empty() const
Definition: Module.h:631
GlobalVariable * getGlobalVariable(StringRef Name, bool AllowInternal=false)
Definition: Module.h:388
void setSourceFileName(StringRef Name)
Set the module&#39;s original source file name.
Definition: Module.h:276
size_t size() const
Definition: Module.h:594
#define I(x, y, z)
Definition: MD5.cpp:58
void setSDKVersion(const VersionTuple &V)
Attach a build SDK version metadata to this module.
Definition: Module.cpp:551
global_value_iterator global_value_begin()
Definition: Module.h:684
iterator_range< debug_compile_units_iterator > debug_compile_units() const
Return an iterator for all DICompileUnits listed in this Module&#39;s llvm.dbg.cu named metadata node and...
Definition: Module.h:769
std::unique_ptr< RandomNumberGenerator > createRNG(const Pass *P) const
Get a RandomNumberGenerator salted for use with this module.
Definition: Module.cpp:93
iterator begin()
Definition: Module.h:586
void appendModuleInlineAsm(StringRef Asm)
Append to the module-scope inline assembly blocks.
Definition: Module.h:295
llvm::Error materialize(GlobalValue *GV)
Make sure the GlobalValue is fully read.
Definition: Module.cpp:390
void setTargetTriple(StringRef T)
Set the target triple.
Definition: Module.h:283
StructType * getTypeByName(StringRef Name) const
Return the type with the specified name, or null if there is none by that name.
Definition: Type.cpp:522
~Module()
The module destructor. This will dropAllReferences.
Definition: Module.cpp:81
void setPIELevel(PIELevel::Level PL)
Set the PIE level (small or large model)
Definition: Module.cpp:508
iterator_range< ifunc_iterator > ifuncs()
Definition: Module.h:633
void setOwnedMemoryBuffer(std::unique_ptr< MemoryBuffer > MB)
Take ownership of the given memory buffer.
Definition: Module.cpp:538
raw_ostream & operator<<(raw_ostream &OS, const APInt &I)
Definition: APInt.h:2039
const std::string & getModuleInlineAsm() const
Get any module-scope inline assembly blocks.
Definition: Module.h:248
void getMDKindNames(SmallVectorImpl< StringRef > &Result) const
Populate client supplied SmallVector with the name for custom metadata IDs registered in this LLVMCon...
Definition: Module.cpp:127
const DiagnosticHandler * getDiagHandlerPtr() const
getDiagHandlerPtr - Returns const raw pointer of DiagnosticHandler set by setDiagnosticHandler.
unsigned getMDKindID(StringRef Name) const
Return a unique non-zero ID for the specified metadata kind.
Definition: Module.cpp:120
unsigned getNumberRegisterParameters() const
Returns the Number of Register ParametersDwarf Version by checking module flags.
Definition: Module.cpp:449
FunctionListType::const_iterator const_iterator
The Function constant iterator.
Definition: Module.h:90
Lightweight error class with error context and mandatory checking.
Definition: Error.h:158
bool named_metadata_empty() const
Definition: Module.h:709
GlobalListType::const_iterator const_global_iterator
The Global Variable constant iterator.
Definition: Module.h:85
const_global_iterator global_begin() const
Definition: Module.h:570
void setPICLevel(PICLevel::Level PL)
Set the PIC level (small or large model)
Definition: Module.cpp:494
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition: raw_ostream.h:46
PICLevel::Level getPICLevel() const
Returns the PIC level (small or large model)
Definition: Module.cpp:484
iterator_range< global_iterator > globals()
Definition: Module.h:575
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:49
A single uniqued string.
Definition: Metadata.h:604
Iterator wrapper that concatenates sequences together.
Definition: STLExtras.h:807
VersionTuple getSDKVersion() const
Get the build SDK version metadata.
Definition: Module.cpp:565
iterator_range< global_value_iterator > global_values()
Definition: Module.h:676
GlobalIFunc * getNamedIFunc(StringRef Name) const
Return the global ifunc in the module with the specified name, of arbitrary type. ...
Definition: Module.cpp:239
Root of the metadata hierarchy.
Definition: Metadata.h:58
GlobalListType::iterator global_iterator
The Global Variable iterator.
Definition: Module.h:83
llvm::Error materializeMetadata()
Definition: Module.cpp:404
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
bool operator!=(const debug_compile_units_iterator &I) const
Definition: Module.h:748
named_metadata_iterator named_metadata_begin()
Definition: Module.h:698
const_global_object_iterator global_object_end() const
Definition: Module.h:665
GVMaterializer * getMaterializer() const
Retrieves the GVMaterializer, if any, for this Module.
Definition: Module.h:495
iterator_range< const_named_metadata_iterator > named_metadata() const
Definition: Module.h:714
iterator_range< alias_iterator > aliases()
Definition: Module.h:615