-
Notifications
You must be signed in to change notification settings - Fork 13.3k
[GOFF] Refactor writing GOFF records #93855
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 3 commits
da97d3d
d850899
ebd2444
a778e25
6f26aa8
641f644
020589f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# RUN: not yaml2obj %s 2>&1 | FileCheck %s | ||
|
||
# CHECK: yaml2obj: error: conversion to EBCDIC 1047 failed on 'Euro symbol €' | ||
|
||
--- !GOFF | ||
- End: | ||
EntryName: "Euro symbol €" | ||
jh7370 marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ | |
# CHECK1-EMPTY: | ||
|
||
## 1 record fully used. | ||
## Flags = 0 => no continuation, not continued. | ||
## Flags = 0 => not a continuation, not continued. | ||
# CHECK2: 03 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ||
# CHECK2-NEXT: 00 00 00 00 00 00 00 00 00 00 c6 96 96 c2 81 99 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Name Length field is zero. From the documentation: "This length cannot be zero if a name is present." Either we're writing invalid GOFF or the documentation needs an update. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or perhaps a comment in the test that says we're purposely ignoring the name length field for this test. |
||
# CHECK2-NEXT: 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 | ||
|
@@ -34,7 +34,7 @@ | |
# CHECK2-EMPTY: | ||
|
||
## 2 records fully used. | ||
## Flags = 1 => no continuation, but continued. | ||
## Flags = 1 => not a continuation, but continued. | ||
# CHECK3: 03 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ||
# CHECK3-NEXT: 00 00 00 00 00 00 00 00 00 00 c6 96 96 c2 81 99 | ||
# CHECK3-NEXT: 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 | ||
|
@@ -49,7 +49,7 @@ | |
# CHECK3-EMPTY: | ||
|
||
## 3rd record used half. | ||
## Flags = 1 => no continuation, but continued. | ||
## Flags = 1 => not a continuation, but continued. | ||
# CHECK4: 03 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ||
# CHECK4-NEXT: 00 00 00 00 00 00 00 00 00 00 c6 96 96 c2 81 99 | ||
# CHECK4-NEXT: 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you just use the RecordType enum from
llvm/BinaryFormat/GOFF.h
here?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those are currently the same, but I do not think that it is good to couple the record type with the class hierarchy discriminator. E.g. in C++ I could model a relocation entry as a record, and treat it as a sub-record of the relocation directory. I currently do not do this, but coupling the discriminator to the record type would be the design decision that I will never do that, which seems a bit limiting to me.