- // reduceApply - Apply the specified function to all of the methods in this
- // module. The result values are or'd together and the result is returned.
- //
- bool reduceApply(bool (*Func)(GlobalVariable*));
- bool reduceApply(bool (*Func)(const GlobalVariable*)) const;
- bool reduceApply(bool (*Func)(Function*));
- bool reduceApply(bool (*Func)(const Function*)) const;
-
- // Get the underlying elements of the Module...
+ const std::string &getModuleIdentifier() const { return ModuleID; }
+
+ /// Target endian information...
+ Endianness getEndianness() const { return Endian; }
+ void setEndianness(Endianness E) { Endian = E; }
+
+ /// Target Pointer Size information...
+ PointerSize getPointerSize() const { return PtrSize; }
+ void setPointerSize(PointerSize PS) { PtrSize = PS; }
+
+ /// 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.
+ Function *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 version of the method takes a null terminated list of function
+ /// arguments, which makes it easier for clients to use.
+ Function *getOrInsertFunction(const std::string &Name, const Type *RetTy,...);
+
+ /// 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 FunctionType *Ty);
+
+ /// getMainFunction - This function looks up main efficiently. This is such a
+ /// common case, that it is a method in Module. If main cannot be found, a
+ /// null pointer is returned.
+ ///
+ Function *getMainFunction();
+
+ /// getNamedFunction - Return the first function in the module with the
+ /// specified name, of arbitrary type. This method returns null if a function
+ /// with the specified name is not found.
+ ///
+ Function *getNamedFunction(const std::string &Name);
+
+ /// 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.
+ ///
+ bool addTypeName(const std::string &Name, const Type *Ty);
+
+ /// getTypeName - If there is at least one entry in the symbol table for the
+ /// specified type, return it.
+ ///
+ std::string getTypeName(const Type *Ty);
+
+ /// Get the underlying elements of the Module...