Add a method "getMainFunction()" that efficiently locates 'main' in a module
[oota-llvm.git] / include / llvm / Module.h
index 2b8c0ab5d0eb1c80cd7d06b3eea923a056a4d47d..6f7a14f410be25ba40cb7f12c7776fc8f198e3ea 100644 (file)
@@ -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.