+/// @}
+/// @name Generic Value Accessors
+/// @{
+
+ /// getNamedValue - Return the first global value in the module with
+ /// the specified name, of arbitrary type. This method returns null
+ /// if a global with the specified name is not found.
+ GlobalValue *getNamedValue(const std::string &Name) const;
+ GlobalValue *getNamedValue(const char *Name) const;
+
+/// @}
+/// @name Function Accessors
+/// @{
+public:
+ /// getOrInsertFunction - Look up the specified function in the module symbol
+ /// table. Four possibilities:
+ /// 1. If it does not exist, add a prototype for the function and return it.
+ /// 2. If it exists, and has a local linkage, the existing function is
+ /// renamed and a new one is inserted.
+ /// 3. Otherwise, if the existing function has the correct prototype, return
+ /// the existing function.
+ /// 4. Finally, the function exists but has the wrong prototype: return the
+ /// function with a constantexpr cast to the right prototype.
+ Constant *getOrInsertFunction(const std::string &Name, const FunctionType *T,
+ AttrListPtr AttributeList);
+
+ Constant *getOrInsertFunction(const std::string &Name, const FunctionType *T);
+
+ /// getOrInsertFunction - Look up the specified function in the module symbol
+ /// table. If it does not exist, add a prototype for the function and return
+ /// it. This function guarantees to return a constant of pointer to the
+ /// specified function type or a ConstantExpr BitCast of that type if the
+ /// named function has a different type. This version of the method takes a
+ /// null terminated list of function arguments, which makes it easier for
+ /// clients to use.
+ Constant *getOrInsertFunction(const std::string &Name,
+ AttrListPtr AttributeList,
+ const Type *RetTy, ...) END_WITH_NULL;
+
+ Constant *getOrInsertFunction(const std::string &Name, const Type *RetTy, ...)
+ END_WITH_NULL;
+
+ Constant *getOrInsertTargetIntrinsic(const std::string &Name,
+ const FunctionType *Ty,
+ AttrListPtr AttributeList);
+
+ /// getFunction - Look up the specified function in the module symbol table.
+ /// If it does not exist, return null.
+ Function *getFunction(const std::string &Name) const;
+ Function *getFunction(const char *Name) const;
+
+/// @}
+/// @name Global Variable Accessors
+/// @{
+public:
+ /// getGlobalVariable - Look up the specified global variable in the module
+ /// symbol table. If it does not exist, return null. If AllowInternal is set
+ /// to true, this function will return types that have InternalLinkage. By
+ /// default, these types are not returned.
+ GlobalVariable *getGlobalVariable(const std::string &Name,
+ bool AllowInternal = false) const;
+
+ /// getNamedGlobal - Return the first global variable in the module with the
+ /// specified name, of arbitrary type. This method returns null if a global
+ /// with the specified name is not found.
+ GlobalVariable *getNamedGlobal(const std::string &Name) const {
+ return getGlobalVariable(Name, true);
+ }
+
+ /// getOrInsertGlobal - Look up the specified global in the module symbol
+ /// table.
+ /// 1. If it does not exist, add a declaration of the global and return it.
+ /// 2. Else, the global exists but has the wrong type: return the function
+ /// with a constantexpr cast to the right type.
+ /// 3. Finally, if the existing global is the correct delclaration, return
+ /// the existing global.
+ Constant *getOrInsertGlobal(const std::string &Name, const Type *Ty);
+
+/// @}
+/// @name Global Alias Accessors
+/// @{
+public:
+ /// getNamedAlias - Return the first global alias in the module with the
+ /// specified name, of arbitrary type. This method returns null if a global
+ /// with the specified name is not found.
+ GlobalAlias *getNamedAlias(const std::string &Name) const;
+
+/// @}
+/// @name Type Accessors
+/// @{
+public:
+ /// addTypeName - Insert an entry in the symbol table mapping Str to Type. If
+ /// there is already an entry for this name, true is returned and the symbol
+ /// table is not modified.