[PATCH] D41698: [DebugInfo] Enable debug information for C99 VLA types

Adrian Prantl via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 16 10:15:59 PST 2018


aprantl added inline comments.


================
Comment at: lib/CodeGen/CGDebugInfo.h:86
+  /// represented by instantiated Metadata nodes.
+  llvm::SmallDenseMap<QualType, llvm::Metadata *> SizeExprCache;
+
----------------
sdesmalen wrote:
> aprantl wrote:
> > I'm expecting VLA's to not be very common, should we use a regular DenseMap instead?
> Is that not the argument to use a SmallDenseMap instead? The documentation for DenseMap says:
> "Also, because DenseMap allocates space for a large number of key/value pairs (it starts with 64 by default), it will waste a lot of space if your keys or values are large."
> 
> There is no documentation for SmallDenseMap, but the name suggests it would be optimized for maps with only a few values?
I think you're right. This SmallDenseMap is not being allocated on the stack, so it is the right tradeoff here.


https://reviews.llvm.org/D41698





More information about the cfe-commits mailing list