aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Module.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-03-29 03:32:29 +0000
committerChris Lattner <sabre@nondot.org>2002-03-29 03:32:29 +0000
commitdb70a8eff3e738a6c3317d06aa56ea7a63b26387 (patch)
tree09f9c793bcc0db831b97f8446de242d9aec13b48 /include/llvm/Module.h
parentb59404280b8219134f376cee30d04c57e03979b6 (diff)
downloadexternal_llvm-db70a8eff3e738a6c3317d06aa56ea7a63b26387.zip
external_llvm-db70a8eff3e738a6c3317d06aa56ea7a63b26387.tar.gz
external_llvm-db70a8eff3e738a6c3317d06aa56ea7a63b26387.tar.bz2
Add getOrInsertFunction and getFunction methods to Module. This simplifies
some code in the transformations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2026 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Module.h')
-rw-r--r--include/llvm/Module.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/llvm/Module.h b/include/llvm/Module.h
index d7d9240..a2a8e50 100644
--- a/include/llvm/Module.h
+++ b/include/llvm/Module.h
@@ -18,6 +18,7 @@
class GlobalVariable;
class GlobalValueRefMap; // Used by ConstantVals.cpp
class ConstantPointerRef;
+class FunctionType;
class Module : public Value, public SymTabValue {
public:
@@ -52,6 +53,16 @@ public:
Module();
~Module();
+ // 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);
+
+ // 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);
+
// Get the underlying elements of the Module...
inline const GlobalListType &getGlobalList() const { return GlobalList; }
inline GlobalListType &getGlobalList() { return GlobalList; }