[llvm] r238854 - DebugInfo: Really support 2^16 arguments in a subprogram
Duncan P. N. Exon Smith
dexonsmith at apple.com
Tue Jun 2 10:17:44 PDT 2015
Author: dexonsmith
Date: Tue Jun 2 12:17:44 2015
New Revision: 238854
URL: http://llvm.org/viewvc/llvm-project?rev=238854&view=rev
Log:
DebugInfo: Really support 2^16 arguments in a subprogram
As a follow-up to r235955, actually support up to 65535 arguments in a
subprogram. r235955 missed assembly support, having only tested the new
limit via C++ unit tests. Code patch by Amjad Aboud.
Added:
llvm/trunk/test/Assembler/dilocalvariable-arg-large.ll
llvm/trunk/test/Assembler/invalid-dilocalvariable-arg-large.ll
llvm/trunk/test/Assembler/invalid-dilocalvariable-arg-negative.ll
Modified:
llvm/trunk/lib/AsmParser/LLParser.cpp
Modified: llvm/trunk/lib/AsmParser/LLParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLParser.cpp?rev=238854&r1=238853&r2=238854&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/LLParser.cpp (original)
+++ llvm/trunk/lib/AsmParser/LLParser.cpp Tue Jun 2 12:17:44 2015
@@ -3730,7 +3730,7 @@ bool LLParser::ParseDILocalVariable(MDNo
OPTIONAL(file, MDField, ); \
OPTIONAL(line, LineField, ); \
OPTIONAL(type, MDField, ); \
- OPTIONAL(arg, MDUnsignedField, (0, UINT8_MAX)); \
+ OPTIONAL(arg, MDUnsignedField, (0, UINT16_MAX)); \
OPTIONAL(flags, DIFlagField, );
PARSE_MD_FIELDS();
#undef VISIT_MD_FIELDS
Added: llvm/trunk/test/Assembler/dilocalvariable-arg-large.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/dilocalvariable-arg-large.ll?rev=238854&view=auto
==============================================================================
--- llvm/trunk/test/Assembler/dilocalvariable-arg-large.ll (added)
+++ llvm/trunk/test/Assembler/dilocalvariable-arg-large.ll Tue Jun 2 12:17:44 2015
@@ -0,0 +1,10 @@
+; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
+; RUN: verify-uselistorder %s
+
+; CHECK: !named = !{!0, !1}
+!named = !{!0, !1}
+
+!0 = distinct !DISubprogram()
+
+; CHECK: !1 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "foo", arg: 65535, scope: !0)
+!1 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "foo", arg: 65535, scope: !0)
Added: llvm/trunk/test/Assembler/invalid-dilocalvariable-arg-large.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/invalid-dilocalvariable-arg-large.ll?rev=238854&view=auto
==============================================================================
--- llvm/trunk/test/Assembler/invalid-dilocalvariable-arg-large.ll (added)
+++ llvm/trunk/test/Assembler/invalid-dilocalvariable-arg-large.ll Tue Jun 2 12:17:44 2015
@@ -0,0 +1,6 @@
+; RUN: not llvm-as < %s 2>&1 | FileCheck %s
+
+!0 = !DILocalVariable(tag: DW_TAG_arg_variable, scope: !{}, arg: 65535)
+
+; CHECK: <stdin>:[[@LINE+1]]:66: error: value for 'arg' too large, limit is 65535
+!1 = !DILocalVariable(tag: DW_TAG_arg_variable, scope: !{}, arg: 65536)
Added: llvm/trunk/test/Assembler/invalid-dilocalvariable-arg-negative.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/invalid-dilocalvariable-arg-negative.ll?rev=238854&view=auto
==============================================================================
--- llvm/trunk/test/Assembler/invalid-dilocalvariable-arg-negative.ll (added)
+++ llvm/trunk/test/Assembler/invalid-dilocalvariable-arg-negative.ll Tue Jun 2 12:17:44 2015
@@ -0,0 +1,6 @@
+; RUN: not llvm-as < %s 2>&1 | FileCheck %s
+
+!0 = !DILocalVariable(tag: DW_TAG_arg_variable, scope: !{}, arg: 0)
+
+; CHECK: <stdin>:[[@LINE+1]]:66: error: expected unsigned integer
+!1 = !DILocalVariable(tag: DW_TAG_arg_variable, scope: !{}, arg: -1)
More information about the llvm-commits
mailing list