[llvm-commits] [llvm] r58781 - /llvm/trunk/lib/VMCore/Module.cpp

Bill Wendling isanbard at gmail.com
Wed Nov 5 15:42:27 PST 2008


Author: void
Date: Wed Nov  5 17:42:27 2008
New Revision: 58781

URL: http://llvm.org/viewvc/llvm-project?rev=58781&view=rev
Log:
Add comments to function.

Modified:
    llvm/trunk/lib/VMCore/Module.cpp

Modified: llvm/trunk/lib/VMCore/Module.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Module.cpp?rev=58781&r1=58780&r2=58781&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/Module.cpp (original)
+++ llvm/trunk/lib/VMCore/Module.cpp Wed Nov  5 17:42:27 2008
@@ -224,6 +224,12 @@
   return 0;
 }
 
+/// getOrInsertGlobal - Look up the specified global in the module symbol table.
+///   1. If it does not exist, add a declaration of the global and return it.
+///   2. Else, the global exists but has the wrong type: return the function
+///      with a constantexpr cast to the right type.
+///   3. Finally, if the existing global is the correct delclaration, return the
+///      existing global.
 Constant *Module::getOrInsertGlobal(const std::string &Name, const Type *Ty) {
   ValueSymbolTable &SymTab = getValueSymbolTable();
 





More information about the llvm-commits mailing list