aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Module.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-11-08 20:34:02 +0000
committerChris Lattner <sabre@nondot.org>2002-11-08 20:34:02 +0000
commita9a93f37779bbab41d73142aa5e4beb43089696e (patch)
tree8acb3c0486be4adca091be28c260ffe1930839e0 /include/llvm/Module.h
parentd321593330f0e3c9a1cabf688e7e964f7bda09f5 (diff)
downloadexternal_llvm-a9a93f37779bbab41d73142aa5e4beb43089696e.zip
external_llvm-a9a93f37779bbab41d73142aa5e4beb43089696e.tar.gz
external_llvm-a9a93f37779bbab41d73142aa5e4beb43089696e.tar.bz2
Add a method "getMainFunction()" that efficiently locates 'main' in a module
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4629 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Module.h')
-rw-r--r--include/llvm/Module.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/llvm/Module.h b/include/llvm/Module.h
index 2b8c0ab..6f7a14f 100644
--- a/include/llvm/Module.h
+++ b/include/llvm/Module.h
@@ -80,6 +80,12 @@ public:
///
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();
+
/// 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.