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

Adrian Prantl via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 26 09:34:06 PST 2018


aprantl added inline comments.


================
Comment at: lib/CodeGen/CGDebugInfo.h:395
+                                 CGBuilderTy &Builder,
+                                 llvm::Metadata **MetadataDecl = nullptr);
 
----------------
I think
```
llvm::DILocalVariable* EmitDeclareOfAutoVariable(const VarDecl *Decl, llvm::Value *AI,
                                 CGBuilderTy &Builder);
```
would be more natural.


================
Comment at: lib/CodeGen/CGDebugInfo.h:474
+                   CGBuilderTy &Builder,
+                   llvm::Metadata **MetadataDecl = nullptr);
 
----------------
same here. Why not just use a return value?


================
Comment at: lib/CodeGen/CGDecl.cpp:958
 
+/// RegisterVariableArrayDimensions - Emits the alloca and debug information for
+/// the size expressions for each dimension of an array. It registers the
----------------
LLVM coding style wants this comment to be on the member function declaration in the header file and only there. Also we don't repeat the function name in the comment any more.


================
Comment at: lib/CodeGen/CGDecl.cpp:984
+
+      // Now create a 'fake' VarDecl that we'll generate debug info for.
+      IdentifierInfo &NameIdent = getContext().Idents.getOwn(
----------------
s/'fake'/artificial/


================
Comment at: lib/CodeGen/CGDecl.cpp:990
+          D.getLocation(), D.getLocation(), &NameIdent, QT,
+          getContext().CreateTypeSourceInfo(QT), SC_Auto);
+
----------------
I think it does, but can you assert me that this generates the same code with and without -g ?


================
Comment at: lib/CodeGen/CodeGenFunction.h:2198
+  /// for the given array type.
+  std::pair<llvm::Value *, QualType>
+  getVLAElements1D(const VariableArrayType *vla);
----------------
How about defining a struct with named members for improved readability? I think you can still use the return {a, b} syntax.


https://reviews.llvm.org/D41698





More information about the cfe-commits mailing list