Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

589 lines
24 KiB

  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. #ifndef LLVM_IR_MODULE_H
  15. #define LLVM_IR_MODULE_H
  16. #include "llvm/ADT/OwningPtr.h"
  17. #include "llvm/IR/Function.h"
  18. #include "llvm/IR/GlobalAlias.h"
  19. #include "llvm/IR/GlobalVariable.h"
  20. #include "llvm/IR/Metadata.h"
  21. #include "llvm/Support/DataTypes.h"
  22. namespace llvm {
  23. class FunctionType;
  24. class GVMaterializer;
  25. class LLVMContext;
  26. class StructType;
  27. template<typename T> struct DenseMapInfo;
  28. template<typename KeyT, typename ValueT, typename KeyInfoT> class DenseMap;
  29. template<> struct ilist_traits<Function>
  30. : public SymbolTableListTraits<Function, Module> {
  31. // createSentinel is used to get hold of the node that marks the end of the
  32. // list... (same trick used here as in ilist_traits<Instruction>)
  33. Function *createSentinel() const {
  34. return static_cast<Function*>(&Sentinel);
  35. }
  36. static void destroySentinel(Function*) {}
  37. Function *provideInitialHead() const { return createSentinel(); }
  38. Function *ensureHead(Function*) const { return createSentinel(); }
  39. static void noteHead(Function*, Function*) {}
  40. private:
  41. mutable ilist_node<Function> Sentinel;
  42. };
  43. template<> struct ilist_traits<GlobalVariable>
  44. : public SymbolTableListTraits<GlobalVariable, Module> {
  45. // createSentinel is used to create a node that marks the end of the list.
  46. GlobalVariable *createSentinel() const {
  47. return static_cast<GlobalVariable*>(&Sentinel);
  48. }
  49. static void destroySentinel(GlobalVariable*) {}
  50. GlobalVariable *provideInitialHead() const { return createSentinel(); }
  51. GlobalVariable *ensureHead(GlobalVariable*) const { return createSentinel(); }
  52. static void noteHead(GlobalVariable*, GlobalVariable*) {}
  53. private:
  54. mutable ilist_node<GlobalVariable> Sentinel;
  55. };
  56. template<> struct ilist_traits<GlobalAlias>
  57. : public SymbolTableListTraits<GlobalAlias, Module> {
  58. // createSentinel is used to create a node that marks the end of the list.
  59. GlobalAlias *createSentinel() const {
  60. return static_cast<GlobalAlias*>(&Sentinel);
  61. }
  62. static void destroySentinel(GlobalAlias*) {}
  63. GlobalAlias *provideInitialHead() const { return createSentinel(); }
  64. GlobalAlias *ensureHead(GlobalAlias*) const { return createSentinel(); }
  65. static void noteHead(GlobalAlias*, GlobalAlias*) {}
  66. private:
  67. mutable ilist_node<GlobalAlias> Sentinel;
  68. };
  69. template<> struct ilist_traits<NamedMDNode>
  70. : public ilist_default_traits<NamedMDNode> {
  71. // createSentinel is used to get hold of a node that marks the end of
  72. // the list...
  73. NamedMDNode *createSentinel() const {
  74. return static_cast<NamedMDNode*>(&Sentinel);
  75. }
  76. static void destroySentinel(NamedMDNode*) {}
  77. NamedMDNode *provideInitialHead() const { return createSentinel(); }
  78. NamedMDNode *ensureHead(NamedMDNode*) const { return createSentinel(); }
  79. static void noteHead(NamedMDNode*, NamedMDNode*) {}
  80. void addNodeToList(NamedMDNode *) {}
  81. void removeNodeFromList(NamedMDNode *) {}
  82. private:
  83. mutable ilist_node<NamedMDNode> Sentinel;
  84. };
  85. /// A Module instance is used to store all the information related to an
  86. /// LLVM module. Modules are the top level container of all other LLVM
  87. /// Intermediate Representation (IR) objects. Each module directly contains a
  88. /// list of globals variables, a list of functions, a list of libraries (or
  89. /// other modules) this module depends on, a symbol table, and various data
  90. /// about the target's characteristics.
  91. ///
  92. /// A module maintains a GlobalValRefMap object that is used to hold all
  93. /// constant references to global variables in the module. When a global
  94. /// variable is destroyed, it should have no entries in the GlobalValueRefMap.
  95. /// @brief The main container class for the LLVM Intermediate Representation.
  96. class Module {
  97. /// @name Types And Enumerations
  98. /// @{
  99. public:
  100. /// The type for the list of global variables.
  101. typedef iplist<GlobalVariable> GlobalListType;
  102. /// The type for the list of functions.
  103. typedef iplist<Function> FunctionListType;
  104. /// The type for the list of aliases.
  105. typedef iplist<GlobalAlias> AliasListType;
  106. /// The type for the list of named metadata.
  107. typedef ilist<NamedMDNode> NamedMDListType;
  108. /// The Global Variable iterator.
  109. typedef GlobalListType::iterator global_iterator;
  110. /// The Global Variable constant iterator.
  111. typedef GlobalListType::const_iterator const_global_iterator;
  112. /// The Function iterators.
  113. typedef FunctionListType::iterator iterator;
  114. /// The Function constant iterator
  115. typedef FunctionListType::const_iterator const_iterator;
  116. /// The Global Alias iterators.
  117. typedef AliasListType::iterator alias_iterator;
  118. /// The Global Alias constant iterator
  119. typedef AliasListType::const_iterator const_alias_iterator;
  120. /// The named metadata iterators.
  121. typedef NamedMDListType::iterator named_metadata_iterator;
  122. /// The named metadata constant interators.
  123. typedef NamedMDListType::const_iterator const_named_metadata_iterator;
  124. /// An enumeration for describing the endianess of the target machine.
  125. enum Endianness { AnyEndianness, LittleEndian, BigEndian };
  126. /// An enumeration for describing the size of a pointer on the target machine.
  127. enum PointerSize { AnyPointerSize, Pointer32, Pointer64 };
  128. /// This enumeration defines the supported behaviors of module flags.
  129. enum ModFlagBehavior {
  130. /// Emits an error if two values disagree, otherwise the resulting value is
  131. /// that of the operands.
  132. Error = 1,
  133. /// Emits a warning if two values disagree. The result value will be the
  134. /// operand for the flag from the first module being linked.
  135. Warning = 2,
  136. /// Adds a requirement that another module flag be present and have a
  137. /// specified value after linking is performed. The value must be a metadata
  138. /// pair, where the first element of the pair is the ID of the module flag
  139. /// to be restricted, and the second element of the pair is the value the
  140. /// module flag should be restricted to. This behavior can be used to
  141. /// restrict the allowable results (via triggering of an error) of linking
  142. /// IDs with the **Override** behavior.
  143. Require = 3,
  144. /// Uses the specified value, regardless of the behavior or value of the
  145. /// other module. If both modules specify **Override**, but the values
  146. /// differ, an error will be emitted.
  147. Override = 4,
  148. /// Appends the two values, which are required to be metadata nodes.
  149. Append = 5,
  150. /// Appends the two values, which are required to be metadata
  151. /// nodes. However, duplicate entries in the second list are dropped
  152. /// during the append operation.
  153. AppendUnique = 6
  154. };
  155. struct ModuleFlagEntry {
  156. ModFlagBehavior Behavior;
  157. MDString *Key;
  158. Value *Val;
  159. ModuleFlagEntry(ModFlagBehavior B, MDString *K, Value *V)
  160. : Behavior(B), Key(K), Val(V) {}
  161. };
  162. /// @}
  163. /// @name Member Variables
  164. /// @{
  165. private:
  166. LLVMContext &Context; ///< The LLVMContext from which types and
  167. ///< constants are allocated.
  168. GlobalListType GlobalList; ///< The Global Variables in the module
  169. FunctionListType FunctionList; ///< The Functions in the module
  170. AliasListType AliasList; ///< The Aliases in the module
  171. NamedMDListType NamedMDList; ///< The named metadata in the module
  172. std::string GlobalScopeAsm; ///< Inline Asm at global scope.
  173. ValueSymbolTable *ValSymTab; ///< Symbol table for values
  174. OwningPtr<GVMaterializer> Materializer; ///< Used to materialize GlobalValues
  175. std::string ModuleID; ///< Human readable identifier for the module
  176. std::string TargetTriple; ///< Platform target triple Module compiled on
  177. std::string DataLayout; ///< Target data description
  178. void *NamedMDSymTab; ///< NamedMDNode names.
  179. friend class Constant;
  180. /// @}
  181. /// @name Constructors
  182. /// @{
  183. public:
  184. /// The Module constructor. Note that there is no default constructor. You
  185. /// must provide a name for the module upon construction.
  186. explicit Module(StringRef ModuleID, LLVMContext& C);
  187. /// The module destructor. This will dropAllReferences.
  188. ~Module();
  189. /// @}
  190. /// @name Module Level Accessors
  191. /// @{
  192. /// Get the module identifier which is, essentially, the name of the module.
  193. /// @returns the module identifier as a string
  194. const std::string &getModuleIdentifier() const { return ModuleID; }
  195. /// Get the data layout string for the module's target platform. This encodes
  196. /// the type sizes and alignments expected by this module.
  197. /// @returns the data layout as a string
  198. const std::string &getDataLayout() const { return DataLayout; }
  199. /// Get the target triple which is a string describing the target host.
  200. /// @returns a string containing the target triple.
  201. const std::string &getTargetTriple() const { return TargetTriple; }
  202. /// Get the target endian information.
  203. /// @returns Endianess - an enumeration for the endianess of the target
  204. Endianness getEndianness() const;
  205. /// Get the target pointer size.
  206. /// @returns PointerSize - an enumeration for the size of the target's pointer
  207. PointerSize getPointerSize() const;
  208. /// Get the global data context.
  209. /// @returns LLVMContext - a container for LLVM's global information
  210. LLVMContext &getContext() const { return Context; }
  211. /// Get any module-scope inline assembly blocks.
  212. /// @returns a string containing the module-scope inline assembly blocks.
  213. const std::string &getModuleInlineAsm() const { return GlobalScopeAsm; }
  214. /// @}
  215. /// @name Module Level Mutators
  216. /// @{
  217. /// Set the module identifier.
  218. void setModuleIdentifier(StringRef ID) { ModuleID = ID; }
  219. /// Set the data layout
  220. void setDataLayout(StringRef DL) { DataLayout = DL; }
  221. /// Set the target triple.
  222. void setTargetTriple(StringRef T) { TargetTriple = T; }
  223. /// Set the module-scope inline assembly blocks.
  224. void setModuleInlineAsm(StringRef Asm) {
  225. GlobalScopeAsm = Asm;
  226. if (!GlobalScopeAsm.empty() &&
  227. GlobalScopeAsm[GlobalScopeAsm.size()-1] != '\n')
  228. GlobalScopeAsm += '\n';
  229. }
  230. /// Append to the module-scope inline assembly blocks, automatically inserting
  231. /// a separating newline if necessary.
  232. void appendModuleInlineAsm(StringRef Asm) {
  233. GlobalScopeAsm += Asm;
  234. if (!GlobalScopeAsm.empty() &&
  235. GlobalScopeAsm[GlobalScopeAsm.size()-1] != '\n')
  236. GlobalScopeAsm += '\n';
  237. }
  238. /// @}
  239. /// @name Generic Value Accessors
  240. /// @{
  241. /// getNamedValue - Return the global value in the module with
  242. /// the specified name, of arbitrary type. This method returns null
  243. /// if a global with the specified name is not found.
  244. GlobalValue *getNamedValue(StringRef Name) const;
  245. /// getMDKindID - Return a unique non-zero ID for the specified metadata kind.
  246. /// This ID is uniqued across modules in the current LLVMContext.
  247. unsigned getMDKindID(StringRef Name) const;
  248. /// getMDKindNames - Populate client supplied SmallVector with the name for
  249. /// custom metadata IDs registered in this LLVMContext.
  250. void getMDKindNames(SmallVectorImpl<StringRef> &Result) const;
  251. typedef DenseMap<StructType*, unsigned, DenseMapInfo<StructType*> >
  252. NumeredTypesMapTy;
  253. /// getTypeByName - Return the type with the specified name, or null if there
  254. /// is none by that name.
  255. StructType *getTypeByName(StringRef Name) const;
  256. /// @}
  257. /// @name Function Accessors
  258. /// @{
  259. /// getOrInsertFunction - Look up the specified function in the module symbol
  260. /// table. Four possibilities:
  261. /// 1. If it does not exist, add a prototype for the function and return it.
  262. /// 2. If it exists, and has a local linkage, the existing function is
  263. /// renamed and a new one is inserted.
  264. /// 3. Otherwise, if the existing function has the correct prototype, return
  265. /// the existing function.
  266. /// 4. Finally, the function exists but has the wrong prototype: return the
  267. /// function with a constantexpr cast to the right prototype.
  268. Constant *getOrInsertFunction(StringRef Name, FunctionType *T,
  269. AttributeSet AttributeList);
  270. Constant *getOrInsertFunction(StringRef Name, FunctionType *T);
  271. /// getOrInsertFunction - Look up the specified function in the module symbol
  272. /// table. If it does not exist, add a prototype for the function and return
  273. /// it. This function guarantees to return a constant of pointer to the
  274. /// specified function type or a ConstantExpr BitCast of that type if the
  275. /// named function has a different type. This version of the method takes a
  276. /// null terminated list of function arguments, which makes it easier for
  277. /// clients to use.
  278. Constant *getOrInsertFunction(StringRef Name,
  279. AttributeSet AttributeList,
  280. Type *RetTy, ...) END_WITH_NULL;
  281. /// getOrInsertFunction - Same as above, but without the attributes.
  282. Constant *getOrInsertFunction(StringRef Name, Type *RetTy, ...)
  283. END_WITH_NULL;
  284. Constant *getOrInsertTargetIntrinsic(StringRef Name,
  285. FunctionType *Ty,
  286. AttributeSet AttributeList);
  287. /// getFunction - Look up the specified function in the module symbol table.
  288. /// If it does not exist, return null.
  289. Function *getFunction(StringRef Name) const;
  290. /// @}
  291. /// @name Global Variable Accessors
  292. /// @{
  293. /// getGlobalVariable - Look up the specified global variable in the module
  294. /// symbol table. If it does not exist, return null. If AllowInternal is set
  295. /// to true, this function will return types that have InternalLinkage. By
  296. /// default, these types are not returned.
  297. GlobalVariable *getGlobalVariable(StringRef Name,
  298. bool AllowInternal = false) const;
  299. /// getNamedGlobal - Return the global variable in the module with the
  300. /// specified name, of arbitrary type. This method returns null if a global
  301. /// with the specified name is not found.
  302. GlobalVariable *getNamedGlobal(StringRef Name) const {
  303. return getGlobalVariable(Name, true);
  304. }
  305. /// getOrInsertGlobal - Look up the specified global in the module symbol
  306. /// table.
  307. /// 1. If it does not exist, add a declaration of the global and return it.
  308. /// 2. Else, the global exists but has the wrong type: return the function
  309. /// with a constantexpr cast to the right type.
  310. /// 3. Finally, if the existing global is the correct declaration, return
  311. /// the existing global.
  312. Constant *getOrInsertGlobal(StringRef Name, Type *Ty);
  313. /// @}
  314. /// @name Global Alias Accessors
  315. /// @{
  316. /// getNamedAlias - Return the global alias in the module with the
  317. /// specified name, of arbitrary type. This method returns null if a global
  318. /// with the specified name is not found.
  319. GlobalAlias *getNamedAlias(StringRef Name) const;
  320. /// @}
  321. /// @name Named Metadata Accessors
  322. /// @{
  323. /// getNamedMetadata - Return the NamedMDNode in the module with the
  324. /// specified name. This method returns null if a NamedMDNode with the
  325. /// specified name is not found.
  326. NamedMDNode *getNamedMetadata(const Twine &Name) const;
  327. /// getOrInsertNamedMetadata - Return the named MDNode in the module
  328. /// with the specified name. This method returns a new NamedMDNode if a
  329. /// NamedMDNode with the specified name is not found.
  330. NamedMDNode *getOrInsertNamedMetadata(StringRef Name);
  331. /// eraseNamedMetadata - Remove the given NamedMDNode from this module
  332. /// and delete it.
  333. void eraseNamedMetadata(NamedMDNode *NMD);
  334. /// @}
  335. /// @name Module Flags Accessors
  336. /// @{
  337. /// getModuleFlagsMetadata - Returns the module flags in the provided vector.
  338. void getModuleFlagsMetadata(SmallVectorImpl<ModuleFlagEntry> &Flags) const;
  339. /// getModuleFlagsMetadata - Returns the NamedMDNode in the module that
  340. /// represents module-level flags. This method returns null if there are no
  341. /// module-level flags.
  342. NamedMDNode *getModuleFlagsMetadata() const;
  343. /// getOrInsertModuleFlagsMetadata - Returns the NamedMDNode in the module
  344. /// that represents module-level flags. If module-level flags aren't found,
  345. /// it creates the named metadata that contains them.
  346. NamedMDNode *getOrInsertModuleFlagsMetadata();
  347. /// addModuleFlag - Add a module-level flag to the module-level flags
  348. /// metadata. It will create the module-level flags named metadata if it
  349. /// doesn't already exist.
  350. void addModuleFlag(ModFlagBehavior Behavior, StringRef Key, Value *Val);
  351. void addModuleFlag(ModFlagBehavior Behavior, StringRef Key, uint32_t Val);
  352. void addModuleFlag(MDNode *Node);
  353. /// @}
  354. /// @name Materialization
  355. /// @{
  356. /// setMaterializer - Sets the GVMaterializer to GVM. This module must not
  357. /// yet have a Materializer. To reset the materializer for a module that
  358. /// already has one, call MaterializeAllPermanently first. Destroying this
  359. /// module will destroy its materializer without materializing any more
  360. /// GlobalValues. Without destroying the Module, there is no way to detach or
  361. /// destroy a materializer without materializing all the GVs it controls, to
  362. /// avoid leaving orphan unmaterialized GVs.
  363. void setMaterializer(GVMaterializer *GVM);
  364. /// getMaterializer - Retrieves the GVMaterializer, if any, for this Module.
  365. GVMaterializer *getMaterializer() const { return Materializer.get(); }
  366. /// isMaterializable - True if the definition of GV has yet to be materialized
  367. /// from the GVMaterializer.
  368. bool isMaterializable(const GlobalValue *GV) const;
  369. /// isDematerializable - Returns true if this GV was loaded from this Module's
  370. /// GVMaterializer and the GVMaterializer knows how to dematerialize the GV.
  371. bool isDematerializable(const GlobalValue *GV) const;
  372. /// Materialize - Make sure the GlobalValue is fully read. If the module is
  373. /// corrupt, this returns true and fills in the optional string with
  374. /// information about the problem. If successful, this returns false.
  375. bool Materialize(GlobalValue *GV, std::string *ErrInfo = 0);
  376. /// Dematerialize - If the GlobalValue is read in, and if the GVMaterializer
  377. /// supports it, release the memory for the function, and set it up to be
  378. /// materialized lazily. If !isDematerializable(), this method is a noop.
  379. void Dematerialize(GlobalValue *GV);
  380. /// MaterializeAll - Make sure all GlobalValues in this Module are fully read.
  381. /// If the module is corrupt, this returns true and fills in the optional
  382. /// string with information about the problem. If successful, this returns
  383. /// false.
  384. bool MaterializeAll(std::string *ErrInfo = 0);
  385. /// MaterializeAllPermanently - Make sure all GlobalValues in this Module are
  386. /// fully read and clear the Materializer. If the module is corrupt, this
  387. /// returns true, fills in the optional string with information about the
  388. /// problem, and DOES NOT clear the old Materializer. If successful, this
  389. /// returns false.
  390. bool MaterializeAllPermanently(std::string *ErrInfo = 0);
  391. /// @}
  392. /// @name Direct access to the globals list, functions list, and symbol table
  393. /// @{
  394. /// Get the Module's list of global variables (constant).
  395. const GlobalListType &getGlobalList() const { return GlobalList; }
  396. /// Get the Module's list of global variables.
  397. GlobalListType &getGlobalList() { return GlobalList; }
  398. static iplist<GlobalVariable> Module::*getSublistAccess(GlobalVariable*) {
  399. return &Module::GlobalList;
  400. }
  401. /// Get the Module's list of functions (constant).
  402. const FunctionListType &getFunctionList() const { return FunctionList; }
  403. /// Get the Module's list of functions.
  404. FunctionListType &getFunctionList() { return FunctionList; }
  405. static iplist<Function> Module::*getSublistAccess(Function*) {
  406. return &Module::FunctionList;
  407. }
  408. /// Get the Module's list of aliases (constant).
  409. const AliasListType &getAliasList() const { return AliasList; }
  410. /// Get the Module's list of aliases.
  411. AliasListType &getAliasList() { return AliasList; }
  412. static iplist<GlobalAlias> Module::*getSublistAccess(GlobalAlias*) {
  413. return &Module::AliasList;
  414. }
  415. /// Get the Module's list of named metadata (constant).
  416. const NamedMDListType &getNamedMDList() const { return NamedMDList; }
  417. /// Get the Module's list of named metadata.
  418. NamedMDListType &getNamedMDList() { return NamedMDList; }
  419. static ilist<NamedMDNode> Module::*getSublistAccess(NamedMDNode*) {
  420. return &Module::NamedMDList;
  421. }
  422. /// Get the symbol table of global variable and function identifiers
  423. const ValueSymbolTable &getValueSymbolTable() const { return *ValSymTab; }
  424. /// Get the Module's symbol table of global variable and function identifiers.
  425. ValueSymbolTable &getValueSymbolTable() { return *ValSymTab; }
  426. /// @}
  427. /// @name Global Variable Iteration
  428. /// @{
  429. global_iterator global_begin() { return GlobalList.begin(); }
  430. const_global_iterator global_begin() const { return GlobalList.begin(); }
  431. global_iterator global_end () { return GlobalList.end(); }
  432. const_global_iterator global_end () const { return GlobalList.end(); }
  433. bool global_empty() const { return GlobalList.empty(); }
  434. /// @}
  435. /// @name Function Iteration
  436. /// @{
  437. iterator begin() { return FunctionList.begin(); }
  438. const_iterator begin() const { return FunctionList.begin(); }
  439. iterator end () { return FunctionList.end(); }
  440. const_iterator end () const { return FunctionList.end(); }
  441. size_t size() const { return FunctionList.size(); }
  442. bool empty() const { return FunctionList.empty(); }
  443. /// @}
  444. /// @name Alias Iteration
  445. /// @{
  446. alias_iterator alias_begin() { return AliasList.begin(); }
  447. const_alias_iterator alias_begin() const { return AliasList.begin(); }
  448. alias_iterator alias_end () { return AliasList.end(); }
  449. const_alias_iterator alias_end () const { return AliasList.end(); }
  450. size_t alias_size () const { return AliasList.size(); }
  451. bool alias_empty() const { return AliasList.empty(); }
  452. /// @}
  453. /// @name Named Metadata Iteration
  454. /// @{
  455. named_metadata_iterator named_metadata_begin() { return NamedMDList.begin(); }
  456. const_named_metadata_iterator named_metadata_begin() const {
  457. return NamedMDList.begin();
  458. }
  459. named_metadata_iterator named_metadata_end() { return NamedMDList.end(); }
  460. const_named_metadata_iterator named_metadata_end() const {
  461. return NamedMDList.end();
  462. }
  463. size_t named_metadata_size() const { return NamedMDList.size(); }
  464. bool named_metadata_empty() const { return NamedMDList.empty(); }
  465. /// @}
  466. /// @name Utility functions for printing and dumping Module objects
  467. /// @{
  468. /// Print the module to an output stream with an optional
  469. /// AssemblyAnnotationWriter.
  470. void print(raw_ostream &OS, AssemblyAnnotationWriter *AAW) const;
  471. /// Dump the module to stderr (for debugging).
  472. void dump() const;
  473. /// This function causes all the subinstructions to "let go" of all references
  474. /// that they are maintaining. This allows one to 'delete' a whole class at
  475. /// a time, even though there may be circular references... first all
  476. /// references are dropped, and all use counts go to zero. Then everything
  477. /// is delete'd for real. Note that no operations are valid on an object
  478. /// that has "dropped all references", except operator delete.
  479. void dropAllReferences();
  480. /// @}
  481. };
  482. /// An raw_ostream inserter for modules.
  483. inline raw_ostream &operator<<(raw_ostream &O, const Module &M) {
  484. M.print(O, 0);
  485. return O;
  486. }
  487. } // End llvm namespace
  488. #endif