/// function is automatically inserted into the end of the function list for
/// the module.
///
- Function(const FunctionType *Ty, bool isInternal, const std::string &N = "",
- Module *M = 0);
+ Function(const FunctionType *Ty, LinkageTypes Linkage,
+ const std::string &N = "", Module *M = 0);
~Function();
// Specialize setName to handle symbol table majik...
///
virtual bool isExternal() const { return BasicBlocks.empty(); }
+ /// getIntrinsicID - This method returns the ID number of the specified
+ /// function, or LLVMIntrinsic::not_intrinsic if the function is not an
+ /// instrinsic, or if the pointer is null. This value is always defined to be
+ /// zero to allow easy checking for whether a function is intrinsic or not.
+ /// The particular intrinsic functions which correspond to this value are
+ /// defined in llvm/Intrinsics.h.
+ ///
+ unsigned getIntrinsicID() const;
+ bool isIntrinsic() const { return getIntrinsicID() != 0; }
+
// getNext/Prev - Return the next or previous function in the list. These
// methods should never be used directly, and are only used to implement the
// function list as part of the module.
Function *getPrev() { return Prev; }
const Function *getPrev() const { return Prev; }
- /// Get the underlying elements of the Function... both the argument list and
- /// basic block list are empty for external functions.
+ /// Get the underlying elements of the Function... the basic block list is
+ /// empty for external functions.
///
const ArgumentListType &getArgumentList() const { return ArgumentList; }
ArgumentListType &getArgumentList() { return ArgumentList; }
//===--------------------------------------------------------------------===//
// Symbol Table Accessing functions...
- /// hasSymbolTable() - Returns true if there is a symbol table allocated to
- /// this object AND if there is at least one name in it!
- ///
- bool hasSymbolTable() const;
-
- /// getSymbolTable() - CAUTION: The current symbol table may be null if there
- /// are no names (ie, the symbol table is empty)
- ///
- inline SymbolTable *getSymbolTable() { return SymTab; }
- inline const SymbolTable *getSymbolTable() const { return SymTab; }
-
- /// getSymbolTableSure is guaranteed to not return a null pointer, because if
- /// the function does not already have a symtab, one is created. Use this if
- /// you intend to put something into the symbol table for the function.
+ /// getSymbolTable() - Return the symbol table...
///
- SymbolTable *getSymbolTableSure(); // Implemented in Value.cpp
+ inline SymbolTable &getSymbolTable() { return *SymTab; }
+ inline const SymbolTable &getSymbolTable() const { return *SymTab; }
//===--------------------------------------------------------------------===//