mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229747 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
668aca9b4a
commit
b5026b0b83
@ -3289,8 +3289,8 @@ bool LLParser::ParseMDSubrange(MDNode *&Result, bool IsDistinct) {
|
||||
/// ::= !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
|
||||
|
||||
|
@ -1361,8 +1361,8 @@ static void writeMDEnumerator(raw_ostream &Out, const MDEnumerator *N,
|
||||
TypePrinting *, SlotTracker *, const Module *) {
|
||||
Out << "!MDEnumerator(";
|
||||
FieldSeparator FS;
|
||||
Out << FS << "value: " << N->getValue();
|
||||
Out << FS << "name: \"" << N->getName() << "\"";
|
||||
Out << FS << "value: " << N->getValue();
|
||||
Out << ")";
|
||||
}
|
||||
|
||||
|
@ -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)")
|
||||
|
Loading…
Reference in New Issue
Block a user