[llvm-commits] [llvm] r129170 - in /llvm/trunk: docs/SourceLevelDebugging.html lib/CodeGen/AsmPrinter/DwarfDebug.cpp
Devang Patel
dpatel at apple.com
Fri Apr 8 16:39:38 PDT 2011
Author: dpatel
Date: Fri Apr 8 18:39:38 2011
New Revision: 129170
URL: http://llvm.org/viewvc/llvm-project?rev=129170&view=rev
Log:
Simplify array bound checks and clarify comments. One element array can have same non-zero number as lower bound as well as upper bound.
Modified:
llvm/trunk/docs/SourceLevelDebugging.html
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
Modified: llvm/trunk/docs/SourceLevelDebugging.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/SourceLevelDebugging.html?rev=129170&r1=129169&r2=129170&view=diff
==============================================================================
--- llvm/trunk/docs/SourceLevelDebugging.html (original)
+++ llvm/trunk/docs/SourceLevelDebugging.html Fri Apr 8 18:39:38 2011
@@ -708,7 +708,8 @@
<a href="#format_composite_type">composite type</a>. The low value defines
the lower bounds typically zero for C/C++. The high value is the upper
bounds. Values are 64 bit. High - low + 1 is the size of the array. If low
- > high the array will be unbounded.</p>
+ > high the array bounds are not included in generated debugging information.
+</p>
</div>
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=129170&r1=129169&r2=129170&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Fri Apr 8 18:39:38 2011
@@ -1242,19 +1242,16 @@
int64_t L = SR.getLo();
int64_t H = SR.getHi();
- // The L value defines the lower bounds typically zero for C/C++. The H
- // value is the upper bounds. Values are 64 bit. H - L + 1 is the size
- // of the array. If L > H the array will be unbounded. If the L is
- // non zero and same is H then also the array will be unbounded. If L is
- // zero and H is zero then the array has one element and in such case do
- // not emit lower bound.
+ // The L value defines the lower bounds which is typically zero for C/C++. The
+ // H value is the upper bounds. Values are 64 bit. H - L + 1 is the size
+ // of the array. If L > H then do not emit DW_AT_lower_bound and
+ // DW_AT_upper_bound attributes. If L is zero and H is also zero then the
+ // array has one element and in such case do not emit lower bound.
- if (L > H || (L == H && L != 0)) {
- // This is an unbounded subrange.
+ if (L > H) {
Buffer.addChild(DW_Subrange);
return;
}
-
if (L)
addSInt(DW_Subrange, dwarf::DW_AT_lower_bound, 0, L);
addSInt(DW_Subrange, dwarf::DW_AT_upper_bound, 0, H);
More information about the llvm-commits
mailing list