CarlosAlbertoEnciso added a comment.
Hi @sdesmalen!
For the following test case
int main() {
int size = 2;
int var[size];
var[1] = 1;
return 0;
}
I compared the DWARF generated by GCC and it looks like
DW_TAG_variable "var"
DW_AT_location ...
DW_AT_type
CarlosAlbertoEnciso added a comment.
Hi @sdesmalen!
First of all my apologies for commenting after the issue has been closed, but I
do not have an account to add a comment to the associated bugzilla.
I have found what it seems to be an issue with the current implementation.
For the given test
This revision was automatically updated to reflect the committed changes.
Closed by commit rL323952: [DebugInfo] Enable debug information for C99 VLA
types (authored by s.desmalen, committed by ).
Herald added a subscriber: llvm-commits.
Changed prior to commit:
This revision was automatically updated to reflect the committed changes.
Closed by commit rC323952: [DebugInfo] Enable debug information for C99 VLA
types (authored by s.desmalen, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D41698?vs=132275=132350#toc
Repository:
rC
sdesmalen marked an inline comment as done.
sdesmalen added a comment.
Thanks for your review @aprantl!
https://reviews.llvm.org/D41698
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
aprantl accepted this revision.
aprantl added inline comments.
This revision is now accepted and ready to land.
Comment at: lib/CodeGen/CGDecl.cpp:994
+ cast(VlaSize.NumElts)->getName());
+ auto QT = getContext().getIntTypeForBitwidth(VlaSize.NumElts->getType()
+
sdesmalen updated this revision to Diff 132275.
sdesmalen added a comment.
- Now always emit an alloca for a VLA dimension expression (regardless of
whether -g is passed).
- Fixed up some more tests since it now also triggers for all tests with
variable length arrays that don't pass -g.
-
aprantl requested changes to this revision.
aprantl added a comment.
This revision now requires changes to proceed.
The correct way to fix this is to generate the stack object unconditionally (it
will get optimized away by mem2reg when optimizations are enabled) and only
emit the dbg.declare
sdesmalen added inline comments.
Comment at: lib/CodeGen/CGDecl.cpp:990
+ D.getLocation(), D.getLocation(), , QT,
+ getContext().CreateTypeSourceInfo(QT), SC_Auto);
+
aprantl wrote:
> sdesmalen wrote:
> > aprantl wrote:
> > > I think it does,
aprantl added inline comments.
Comment at: lib/CodeGen/CGDecl.cpp:990
+ D.getLocation(), D.getLocation(), , QT,
+ getContext().CreateTypeSourceInfo(QT), SC_Auto);
+
sdesmalen wrote:
> aprantl wrote:
> > I think it does, but can you assert me
sdesmalen updated this revision to Diff 131990.
sdesmalen marked 4 inline comments as done.
sdesmalen added a comment.
Herald added a subscriber: jholewinski.
- Changed return type of getVLASize() to a struct with named members.
- EmitDeclare and EmitDeclareOfAutoVariable now return a
sdesmalen added inline comments.
Comment at: lib/CodeGen/CGDebugInfo.h:474
+ CGBuilderTy ,
+ llvm::Metadata **MetadataDecl = nullptr);
aprantl wrote:
> same here. Why not just use a return value?
Initially I thought it would
aprantl added inline comments.
Comment at: lib/CodeGen/CGDebugInfo.h:395
+ CGBuilderTy ,
+ llvm::Metadata **MetadataDecl = nullptr);
I think
```
llvm::DILocalVariable*
sdesmalen added a comment.
Just a gentle reminder that this patch still needs to be accepted (the LLVM
support for it has been merged).
https://reviews.llvm.org/D41698
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
aprantl added inline comments.
Comment at: lib/CodeGen/CGDebugInfo.h:86
+ /// represented by instantiated Metadata nodes.
+ llvm::SmallDenseMap SizeExprCache;
+
sdesmalen wrote:
> aprantl wrote:
> > I'm expecting VLA's to not be
sdesmalen marked 3 inline comments as done.
sdesmalen added inline comments.
Comment at: lib/CodeGen/CGDebugInfo.cpp:2358
+if (auto *SizeNode = getVLASizeExpressionForType(EltTy))
+ Subscripts.push_back(DBuilder.getOrCreateSubrange(0, SizeNode));
+else
sdesmalen updated this revision to Diff 129943.
sdesmalen added a comment.
Refactoring based on @aprantl's suggestions.
https://reviews.llvm.org/D41698
Files:
lib/CodeGen/CGDebugInfo.cpp
lib/CodeGen/CGDebugInfo.h
lib/CodeGen/CGDecl.cpp
lib/CodeGen/CodeGenFunction.cpp
aprantl added a comment.
It would be awesome if you could also add an end-to-end test to the
debuginfo-tests repository so we can verify that this actually works in LLDB
and GDB.
Comment at: lib/CodeGen/CGDebugInfo.cpp:2358
+if (auto *SizeNode =
sdesmalen created this revision.
sdesmalen added reviewers: echristo, aprantl, dexonsmith, clayborg, pcc,
kristof.beyls.
Herald added a subscriber: JDevlieghere.
This patch enables debugging of C99 VLA types by generating more precise
LLVM Debug metadata, using the extended DISubrange 'count'
19 matches
Mail list logo