diff options
author | Bill Wendling <isanbard@gmail.com> | 2008-11-05 23:42:27 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2008-11-05 23:42:27 +0000 |
commit | 6745463f9f79e2faf3e5f96e4150b1b32057b440 (patch) | |
tree | 717b2410b82273c92585f1f0b7922c37879c2644 /lib/VMCore | |
parent | c41fb3151784f7fccb4731ef594c4ea3dc685d5f (diff) | |
download | external_llvm-6745463f9f79e2faf3e5f96e4150b1b32057b440.zip external_llvm-6745463f9f79e2faf3e5f96e4150b1b32057b440.tar.gz external_llvm-6745463f9f79e2faf3e5f96e4150b1b32057b440.tar.bz2 |
Add comments to function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58781 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r-- | lib/VMCore/Module.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/VMCore/Module.cpp b/lib/VMCore/Module.cpp index d4432c6..b7bb491 100644 --- a/lib/VMCore/Module.cpp +++ b/lib/VMCore/Module.cpp @@ -224,6 +224,12 @@ GlobalVariable *Module::getGlobalVariable(const std::string &Name, 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(); |