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

Sander de Smalen via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 30 09:53:29 PST 2018


sdesmalen added inline comments.


================
Comment at: lib/CodeGen/CGDebugInfo.h:474
+                   CGBuilderTy &Builder,
+                   llvm::Metadata **MetadataDecl = nullptr);
 
----------------
aprantl wrote:
> same here. Why not just use a return value?
Initially I thought it would make more sense for the EmitDeclare function to return the actual call instruction to llvm.dbg.declare, but I see that returning DILocalVariable* makes more sense and that this is in line with the other methods of this class.


================
Comment at: lib/CodeGen/CGDecl.cpp:990
+          D.getLocation(), D.getLocation(), &NameIdent, QT,
+          getContext().CreateTypeSourceInfo(QT), SC_Auto);
+
----------------
aprantl wrote:
> I think it does, but can you assert me that this generates the same code with and without -g ?
I'm not really sure what you mean with 'generates the same code', because without -g this function is not invoked? However, this function only affects debug information, not anything else related to the actual creation of the VLA. So without -g, no 'dbg.declare()' or corresponding DILocalVariables are generated for each subexpression of each dimension.


https://reviews.llvm.org/D41698





More information about the cfe-commits mailing list