[llvm] r232400 - AsmParser: Stop requiring 'name:' when it's not printed
Duncan P. N. Exon Smith
dexonsmith at apple.com
Mon Mar 16 12:01:55 PDT 2015
Author: dexonsmith
Date: Mon Mar 16 14:01:54 2015
New Revision: 232400
URL: http://llvm.org/viewvc/llvm-project?rev=232400&view=rev
Log:
AsmParser: Stop requiring 'name:' when it's not printed
r230877 optimized which fields are written out for `CHECK`-ability, but
apparently missed changing some of them to optional in `LLParser`.
Fixes PR22921.
Removed:
llvm/trunk/test/Assembler/invalid-mdglobalvariable-missing-name.ll
llvm/trunk/test/Assembler/invalid-mdobjcproperty-missing-name.ll
llvm/trunk/test/Assembler/invalid-mdsubprogram-missing-name.ll
Modified:
llvm/trunk/lib/AsmParser/LLParser.cpp
llvm/trunk/test/Assembler/mdglobalvariable.ll
llvm/trunk/test/Assembler/mdobjcproperty.ll
llvm/trunk/test/Assembler/mdsubprogram.ll
Modified: llvm/trunk/lib/AsmParser/LLParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLParser.cpp?rev=232400&r1=232399&r2=232400&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/LLParser.cpp (original)
+++ llvm/trunk/lib/AsmParser/LLParser.cpp Mon Mar 16 14:01:54 2015
@@ -3534,7 +3534,7 @@ bool LLParser::ParseMDCompileUnit(MDNode
bool LLParser::ParseMDSubprogram(MDNode *&Result, bool IsDistinct) {
#define VISIT_MD_FIELDS(OPTIONAL, REQUIRED) \
OPTIONAL(scope, MDField, ); \
- REQUIRED(name, MDStringField, ); \
+ OPTIONAL(name, MDStringField, ); \
OPTIONAL(linkageName, MDStringField, ); \
OPTIONAL(file, MDField, ); \
OPTIONAL(line, LineField, ); \
@@ -3649,7 +3649,7 @@ bool LLParser::ParseMDTemplateValueParam
bool LLParser::ParseMDGlobalVariable(MDNode *&Result, bool IsDistinct) {
#define VISIT_MD_FIELDS(OPTIONAL, REQUIRED) \
OPTIONAL(scope, MDField, ); \
- REQUIRED(name, MDStringField, ); \
+ OPTIONAL(name, MDStringField, ); \
OPTIONAL(linkageName, MDStringField, ); \
OPTIONAL(file, MDField, ); \
OPTIONAL(line, LineField, ); \
@@ -3735,7 +3735,7 @@ bool LLParser::ParseMDExpression(MDNode
/// getter: "getFoo", attributes: 7, type: !2)
bool LLParser::ParseMDObjCProperty(MDNode *&Result, bool IsDistinct) {
#define VISIT_MD_FIELDS(OPTIONAL, REQUIRED) \
- REQUIRED(name, MDStringField, ); \
+ OPTIONAL(name, MDStringField, ); \
OPTIONAL(file, MDField, ); \
OPTIONAL(line, LineField, ); \
OPTIONAL(setter, MDStringField, ); \
Removed: llvm/trunk/test/Assembler/invalid-mdglobalvariable-missing-name.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/invalid-mdglobalvariable-missing-name.ll?rev=232399&view=auto
==============================================================================
--- llvm/trunk/test/Assembler/invalid-mdglobalvariable-missing-name.ll (original)
+++ llvm/trunk/test/Assembler/invalid-mdglobalvariable-missing-name.ll (removed)
@@ -1,4 +0,0 @@
-; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
-
-; CHECK: <stdin>:[[@LINE+1]]:42: error: missing required field 'name'
-!0 = !MDGlobalVariable(linkageName: "foo")
Removed: llvm/trunk/test/Assembler/invalid-mdobjcproperty-missing-name.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/invalid-mdobjcproperty-missing-name.ll?rev=232399&view=auto
==============================================================================
--- llvm/trunk/test/Assembler/invalid-mdobjcproperty-missing-name.ll (original)
+++ llvm/trunk/test/Assembler/invalid-mdobjcproperty-missing-name.ll (removed)
@@ -1,4 +0,0 @@
-; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
-
-; CHECK: [[@LINE+1]]:38: error: missing required field 'name'
-!0 = !MDObjCProperty(setter: "setFoo")
Removed: llvm/trunk/test/Assembler/invalid-mdsubprogram-missing-name.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/invalid-mdsubprogram-missing-name.ll?rev=232399&view=auto
==============================================================================
--- llvm/trunk/test/Assembler/invalid-mdsubprogram-missing-name.ll (original)
+++ llvm/trunk/test/Assembler/invalid-mdsubprogram-missing-name.ll (removed)
@@ -1,4 +0,0 @@
-; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
-
-; CHECK: <stdin>:[[@LINE+1]]:38: error: missing required field 'name'
-!0 = !MDSubprogram(linkageName: "foo")
Modified: llvm/trunk/test/Assembler/mdglobalvariable.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/mdglobalvariable.ll?rev=232400&r1=232399&r2=232400&view=diff
==============================================================================
--- llvm/trunk/test/Assembler/mdglobalvariable.ll (original)
+++ llvm/trunk/test/Assembler/mdglobalvariable.ll Mon Mar 16 14:01:54 2015
@@ -18,5 +18,5 @@
isDefinition: false, variable: i32* @foo,
declaration: !4)
-; CHECK: !6 = !MDGlobalVariable(name: "bar", scope: null, isLocal: false, isDefinition: true)
-!6 = !MDGlobalVariable(name: "bar")
+; CHECK: !6 = !MDGlobalVariable(scope: null, isLocal: false, isDefinition: true)
+!6 = !MDGlobalVariable()
Modified: llvm/trunk/test/Assembler/mdobjcproperty.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/mdobjcproperty.ll?rev=232400&r1=232399&r2=232400&view=diff
==============================================================================
--- llvm/trunk/test/Assembler/mdobjcproperty.ll (original)
+++ llvm/trunk/test/Assembler/mdobjcproperty.ll Mon Mar 16 14:01:54 2015
@@ -14,7 +14,7 @@
!3 = !MDObjCProperty(name: "foo", file: !1, line: 7, setter: "setFoo",
getter: "getFoo", attributes: 7, type: !2)
-; CHECK-NEXT: !4 = !MDObjCProperty(name: "foo")
-!4 = !MDObjCProperty(name: "foo", file: null, line: 0, setter: "", getter: "",
+; CHECK-NEXT: !4 = !MDObjCProperty()
+!4 = !MDObjCProperty(name: "", file: null, line: 0, setter: "", getter: "",
attributes: 0, type: null)
-!5 = !MDObjCProperty(name: "foo")
+!5 = !MDObjCProperty()
Modified: llvm/trunk/test/Assembler/mdsubprogram.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/mdsubprogram.ll?rev=232400&r1=232399&r2=232400&view=diff
==============================================================================
--- llvm/trunk/test/Assembler/mdsubprogram.ll (original)
+++ llvm/trunk/test/Assembler/mdsubprogram.ll Mon Mar 16 14:01:54 2015
@@ -23,6 +23,6 @@ declare void @_Z3foov()
flags: DIFlagPrototyped, isOptimized: true, function: void ()* @_Z3foov,
templateParams: !5, declaration: !6, variables: !7)
-; CHECK: !9 = !MDSubprogram(name: "bar", scope: null, isLocal: false, isDefinition: true, isOptimized: false)
-!9 = !MDSubprogram(name: "bar")
+; CHECK: !9 = !MDSubprogram(scope: null, isLocal: false, isDefinition: true, isOptimized: false)
+!9 = !MDSubprogram()
More information about the llvm-commits
mailing list