[llvm] r229747 - IR: Swap order of name and value in MDEnum
Duncan P. N. Exon Smith
dexonsmith at apple.com
Wed Feb 18 13:16:33 PST 2015
Author: dexonsmith
Date: Wed Feb 18 15:16:33 2015
New Revision: 229747
URL: http://llvm.org/viewvc/llvm-project?rev=229747&view=rev
Log:
IR: Swap order of name and value in MDEnum
Put the name before the value in assembly for `MDEnum`. While working
on the testcase upgrade script for the new hierarchy, I noticed that it
"looks nicer" to have the name first, since it lines the names up in the
(somewhat typical) case that they have a common prefix.
Modified:
llvm/trunk/lib/AsmParser/LLParser.cpp
llvm/trunk/lib/IR/AsmWriter.cpp
llvm/trunk/test/Assembler/debug-info.ll
Modified: llvm/trunk/lib/AsmParser/LLParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLParser.cpp?rev=229747&r1=229746&r2=229747&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/LLParser.cpp (original)
+++ llvm/trunk/lib/AsmParser/LLParser.cpp Wed Feb 18 15:16:33 2015
@@ -3289,8 +3289,8 @@ bool LLParser::ParseMDSubrange(MDNode *&
/// ::= !MDEnumerator(value: 30, name: "SomeKind")
bool LLParser::ParseMDEnumerator(MDNode *&Result, bool IsDistinct) {
#define VISIT_MD_FIELDS(OPTIONAL, REQUIRED) \
- REQUIRED(value, MDSignedField, ); \
- REQUIRED(name, MDStringField, );
+ REQUIRED(name, MDStringField, ); \
+ REQUIRED(value, MDSignedField, );
PARSE_MD_FIELDS();
#undef VISIT_MD_FIELDS
Modified: llvm/trunk/lib/IR/AsmWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/AsmWriter.cpp?rev=229747&r1=229746&r2=229747&view=diff
==============================================================================
--- llvm/trunk/lib/IR/AsmWriter.cpp (original)
+++ llvm/trunk/lib/IR/AsmWriter.cpp Wed Feb 18 15:16:33 2015
@@ -1361,8 +1361,8 @@ static void writeMDEnumerator(raw_ostrea
TypePrinting *, SlotTracker *, const Module *) {
Out << "!MDEnumerator(";
FieldSeparator FS;
- Out << FS << "value: " << N->getValue();
Out << FS << "name: \"" << N->getName() << "\"";
+ Out << FS << "value: " << N->getValue();
Out << ")";
}
Modified: llvm/trunk/test/Assembler/debug-info.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/debug-info.ll?rev=229747&r1=229746&r2=229747&view=diff
==============================================================================
--- llvm/trunk/test/Assembler/debug-info.ll (original)
+++ llvm/trunk/test/Assembler/debug-info.ll Wed Feb 18 15:16:33 2015
@@ -13,12 +13,12 @@
!2 = !MDSubrange(count: 3, lowerBound: 4)
!3 = !MDSubrange(count: 3, lowerBound: -5)
-; CHECK-NEXT: !3 = !MDEnumerator(value: 7, name: "seven")
-; CHECK-NEXT: !4 = !MDEnumerator(value: -8, name: "negeight")
-; CHECK-NEXT: !5 = !MDEnumerator(value: 0, name: "")
-!4 = !MDEnumerator(value: 7, name: "seven")
-!5 = !MDEnumerator(value: -8, name: "negeight")
-!6 = !MDEnumerator(value: 0, name: "")
+; CHECK-NEXT: !3 = !MDEnumerator(name: "seven", value: 7)
+; CHECK-NEXT: !4 = !MDEnumerator(name: "negeight", value: -8)
+; CHECK-NEXT: !5 = !MDEnumerator(name: "", value: 0)
+!4 = !MDEnumerator(name: "seven", value: 7)
+!5 = !MDEnumerator(name: "negeight", value: -8)
+!6 = !MDEnumerator(name: "", value: 0)
; CHECK-NEXT: !6 = !MDBasicType(tag: DW_TAG_base_type, name: "name", size: 1, align: 2, encoding: DW_ATE_unsigned_char)
; CHECK-NEXT: !7 = !MDBasicType(tag: DW_TAG_unspecified_type, name: "decltype(nullptr)")
More information about the llvm-commits
mailing list