[cfe-commits] r99823 - in /cfe/trunk/lib/CodeGen: CGDebugInfo.cpp CGDebugInfo.h

Chris Lattner clattner at apple.com
Mon Mar 29 11:46:42 PDT 2010


On Mar 29, 2010, at 11:29 AM, Ted Kremenek wrote:

> Author: kremenek
> Date: Mon Mar 29 13:29:57 2010
> New Revision: 99823
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=99823&view=rev
> Log:
> Change 'TypeCache' from being an std::map to a llvm::DenseMap.  This reduces codegen time
> on one .i file from 403.gcc by 0.5%.

Thanks Ted,

> 
>   /// TypeCache - Cache of previously constructed Types.
>   // FIXME: Eliminate this map.  Be careful of iterator invalidation.
> -  std::map<void *, llvm::WeakVH> TypeCache;
> +  llvm::DenseMap<void *, llvm::WeakVH> TypeCache;

I think you can remove the fixme now.  Did you make sure that iterators aren't getting invalidated here?  If something does this:


WeakVH &H = TypeCache[x];
... stuff that could insert or delete from TypeCache...

... use H ...

Then this would be a bug,

-Chris





More information about the cfe-commits mailing list