[cfe-dev] [cfe-commits] r67438 - in /cfe/trunk/lib/CodeGen: CGExpr.cpp CodeGenModule.cpp CodeGenModule.h

Chris Lattner sabre at nondot.org
Sat Mar 21 16:51:17 PDT 2009


On Mar 21, 2009, at 3:35 PM, Daniel Dunbar wrote:

> On 3/21/09, Chris Lattner <sabre at nondot.org> wrote:
>> Author: lattner
>> Date: Sat Mar 21 02:48:31 2009
>> New Revision: 67438
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=67438&view=rev
>> Log:
>> simplify and comment some code better.  Make BindRuntimeGlobals
>> more optimistic that it will work (optimizing for the common case).
>
> I may be missing something, but wouldn't this be cleaner if we just
> provided a Module method to return a reference to the entry for a
> name? This would avoiding the shuffling with names and only do one
> lookup.

We already have this through ValueSymbolTable.  I added this comment,  
though I don't really know if it is true:

   /// Note that this map always lines up exactly with the contents of  
the LLVM
   /// IR symbol table, but this is quicker to query since it is doing  
uniqued
   /// pointer lookups instead of full string lookups.
   llvm::DenseMap<const char*, llvm::GlobalValue*> GlobalDeclMap;

I would also like to eliminate RuntimeGlobals at some point.

-Chris



More information about the cfe-dev mailing list