Page MenuHomePhabricator

Jaysonyan (Jayson Yan)
User

Projects

User does not belong to any projects.

User Details

User Since
Sep 17 2021, 12:30 PM (78 w, 3 d)

Recent Activity

Dec 10 2021

Jaysonyan requested review of D115563: [WIP] Override methods in LLVMELFDumper which use startline().
Dec 10 2021, 4:34 PM · Restricted Project
Jaysonyan committed rG1f35d7b5de62: [llvm-readobj] Add JSONScopedPrinter to llvm-readelf (authored by Jaysonyan).
[llvm-readobj] Add JSONScopedPrinter to llvm-readelf
Dec 10 2021, 3:35 PM
Jaysonyan closed D114225: Add JSONScopedPrinter to llvm-readelf.
Dec 10 2021, 3:35 PM · Restricted Project
Jaysonyan added a reverting change for rG824eef231a85: [llvm-readobj] Add JSONScopedPrinter to llvm-readelf: rG2526335595d4: Revert "[llvm-readobj] Add JSONScopedPrinter to llvm-readelf".
Dec 10 2021, 1:02 PM
Jaysonyan committed rG2526335595d4: Revert "[llvm-readobj] Add JSONScopedPrinter to llvm-readelf" (authored by Jaysonyan).
Revert "[llvm-readobj] Add JSONScopedPrinter to llvm-readelf"
Dec 10 2021, 1:02 PM
Jaysonyan added a comment to D114225: Add JSONScopedPrinter to llvm-readelf.

The test fails on Windows: http://45.33.8.238/win/50629/step_11.txt

Please take a look and revert for now if it takes a while to fix.

Dec 10 2021, 12:47 PM · Restricted Project
Jaysonyan committed rG824eef231a85: [llvm-readobj] Add JSONScopedPrinter to llvm-readelf (authored by Jaysonyan).
[llvm-readobj] Add JSONScopedPrinter to llvm-readelf
Dec 10 2021, 10:58 AM
Jaysonyan committed rGd25a65030bc1: [llvm] Add ScopedPrinter unit tests (authored by Jaysonyan).
[llvm] Add ScopedPrinter unit tests
Dec 10 2021, 10:58 AM
Jaysonyan committed rG928d17254ba2: [llvm] Add JSONScopedPrinter class (authored by Jaysonyan).
[llvm] Add JSONScopedPrinter class
Dec 10 2021, 10:58 AM
Jaysonyan committed rG80a0ee6f64b9: [NFC] Move printNumber method (authored by Jaysonyan).
[NFC] Move printNumber method
Dec 10 2021, 10:58 AM
Jaysonyan committed rGec6870b39cf7: [llvm] Make ScopedPrinter interface virtual (authored by Jaysonyan).
[llvm] Make ScopedPrinter interface virtual
Dec 10 2021, 10:58 AM
Jaysonyan committed rG10602f2ae1ce: [NFC] Remove unneeded printString methods (authored by Jaysonyan).
[NFC] Remove unneeded printString methods
Dec 10 2021, 10:58 AM
Jaysonyan closed D114224: Add JSONScopedPrinter class.
Dec 10 2021, 10:58 AM · Restricted Project
Jaysonyan closed D114684: Add ScopedPrinter unit tests.
Dec 10 2021, 10:58 AM · Restricted Project
Jaysonyan closed D114741: Move printNumber method.
Dec 10 2021, 10:58 AM · Restricted Project
Jaysonyan closed D114740: Remove unneeded printString methods.
Dec 10 2021, 10:58 AM · Restricted Project
Jaysonyan closed D114223: Make ScopedPrinter interface virtual .
Dec 10 2021, 10:58 AM · Restricted Project
Jaysonyan added a comment to D114225: Add JSONScopedPrinter to llvm-readelf.

Just as a heads up, Dec 10th is the last day of my internship so unfortunately after that I won't be able to work on this change as actively as before. If there is still feedback to address a member of my team may be able to pick this up from where I left off. And thank you for taking the time to review all of my code changes these past months!

Dec 10 2021, 1:28 AM · Restricted Project
Jaysonyan updated the diff for D114225: Add JSONScopedPrinter to llvm-readelf.

Fix up file-summary test.

Dec 10 2021, 1:25 AM · Restricted Project
Jaysonyan updated the diff for D114224: Add JSONScopedPrinter class.

Add param comments.
Update pretty-print tests.

Dec 10 2021, 12:37 AM · Restricted Project

Dec 8 2021

Jaysonyan added inline comments to D114225: Add JSONScopedPrinter to llvm-readelf.
Dec 8 2021, 2:14 AM · Restricted Project
Jaysonyan updated the diff for D114225: Add JSONScopedPrinter to llvm-readelf.

Update docs formatting.
Update file-summary and pretty print tests.

Dec 8 2021, 2:14 AM · Restricted Project
Jaysonyan updated the diff for D114224: Add JSONScopedPrinter class.

Fix DelimitedScopeCtor test.

Dec 8 2021, 1:33 AM · Restricted Project
Jaysonyan added inline comments to D114224: Add JSONScopedPrinter class.
Dec 8 2021, 1:32 AM · Restricted Project
Jaysonyan updated the diff for D114224: Add JSONScopedPrinter class.

Add verifyAll method to test fixture.
Allow JSONScopedPrinter to be constructed with DelimitedScope.
Add DelimitedScope and pretty-print unit tests.

Dec 8 2021, 1:25 AM · Restricted Project
Jaysonyan added inline comments to D114684: Add ScopedPrinter unit tests.
Dec 8 2021, 12:57 AM · Restricted Project
Jaysonyan updated the diff for D114684: Add ScopedPrinter unit tests.

Add W.flush() to verifyScopedPrinter() method.

Dec 8 2021, 12:57 AM · Restricted Project

Dec 7 2021

Jaysonyan added inline comments to D114225: Add JSONScopedPrinter to llvm-readelf.
Dec 7 2021, 12:34 AM · Restricted Project
Jaysonyan updated the diff for D114225: Add JSONScopedPrinter to llvm-readelf.

Update docs.
Clean up tests.

Dec 7 2021, 12:33 AM · Restricted Project

Dec 6 2021

Jaysonyan updated the diff for D114225: Add JSONScopedPrinter to llvm-readelf.

Use JSONScopedPrinter ctor to initialize outer-most [].

Dec 6 2021, 11:20 PM · Restricted Project
Jaysonyan added inline comments to D114684: Add ScopedPrinter unit tests.
Dec 6 2021, 10:48 PM · Restricted Project
Jaysonyan updated the diff for D114684: Add ScopedPrinter unit tests.

Update test fixture to hold ScopedPrinter as member.

Dec 6 2021, 10:38 PM · Restricted Project
Jaysonyan added inline comments to D114224: Add JSONScopedPrinter class.
Dec 6 2021, 10:34 PM · Restricted Project
Jaysonyan updated the diff for D114224: Add JSONScopedPrinter class.

Update missing enum to enum class
Update test fixture to handle printing outer {} and handle nothing printed at top level.

Dec 6 2021, 10:34 PM · Restricted Project

Dec 5 2021

Jaysonyan updated the diff for D114225: Add JSONScopedPrinter to llvm-readelf.

Add pretty-print test.

Dec 5 2021, 3:13 PM · Restricted Project
Jaysonyan updated the diff for D114225: Add JSONScopedPrinter to llvm-readelf.

Add JSON FileSummary tests.
Add pretty-print option to llvm-readelf.

Dec 5 2021, 2:50 PM · Restricted Project

Dec 3 2021

Jaysonyan added inline comments to D114225: Add JSONScopedPrinter to llvm-readelf.
Dec 3 2021, 3:51 PM · Restricted Project
Jaysonyan updated the diff for D114225: Add JSONScopedPrinter to llvm-readelf.

Add missing comma in error message.

Dec 3 2021, 3:51 PM · Restricted Project
Jaysonyan added inline comments to D114224: Add JSONScopedPrinter class.
Dec 3 2021, 3:25 PM · Restricted Project
Jaysonyan updated the diff for D114224: Add JSONScopedPrinter class.

Update ScopeHistory SmallVector size to 8

Dec 3 2021, 3:24 PM · Restricted Project
Jaysonyan added a comment to D114684: Add ScopedPrinter unit tests.

Yes, they should be added, but I'd be inclined to say that they should be in a separate patch, allowing us to focus this on the ScopedPrinter class specifically.

I can add these in a separate patch then.

Dec 3 2021, 3:19 PM · Restricted Project
Jaysonyan updated the summary of D114224: Add JSONScopedPrinter class.
Dec 3 2021, 3:14 PM · Restricted Project
Jaysonyan updated the diff for D114224: Add JSONScopedPrinter class.

Update enum naming.
Add APSInt implementation and test.
Add classof and kindOf test.

Dec 3 2021, 3:14 PM · Restricted Project
Jaysonyan updated the diff for D114684: Add ScopedPrinter unit tests.

Add APSInt test.

Dec 3 2021, 3:10 PM · Restricted Project
Jaysonyan updated the diff for D114223: Make ScopedPrinter interface virtual .

Add printList implementation for APSInt.

Dec 3 2021, 1:51 PM · Restricted Project

Dec 2 2021

Jaysonyan added inline comments to D114224: Add JSONScopedPrinter class.
Dec 2 2021, 12:52 PM · Restricted Project
Jaysonyan updated the diff for D114224: Add JSONScopedPrinter class.

Update JSONScopedPrinter::printBinaryImpl to print initial offset rather than including a byte index in each byte entry.
Small comment change.

Dec 2 2021, 12:49 PM · Restricted Project
Jaysonyan added inline comments to D114684: Add ScopedPrinter unit tests.
Dec 2 2021, 10:47 AM · Restricted Project
Jaysonyan updated the diff for D114684: Add ScopedPrinter unit tests.

Renamed lambda and expected output variables

Dec 2 2021, 10:47 AM · Restricted Project
Jaysonyan added inline comments to D114223: Make ScopedPrinter interface virtual .
Dec 2 2021, 9:42 AM · Restricted Project
Jaysonyan updated the diff for D114223: Make ScopedPrinter interface virtual .

Remove unneeded explicit cast in printList(...).

Dec 2 2021, 9:40 AM · Restricted Project
Jaysonyan updated the summary of D114225: Add JSONScopedPrinter to llvm-readelf.
Dec 2 2021, 12:53 AM · Restricted Project
Jaysonyan added inline comments to D114225: Add JSONScopedPrinter to llvm-readelf.
Dec 2 2021, 12:53 AM · Restricted Project
Jaysonyan updated the diff for D114225: Add JSONScopedPrinter to llvm-readelf.

Update error messaging.
Misc formatting.

Dec 2 2021, 12:52 AM · Restricted Project

Dec 1 2021

Jaysonyan added inline comments to D114224: Add JSONScopedPrinter class.
Dec 1 2021, 11:21 PM · Restricted Project
Jaysonyan updated the diff for D114224: Add JSONScopedPrinter class.

Remove Character block from JSONScopedPrinter::printBinaryImpl(...)

Dec 1 2021, 11:16 PM · Restricted Project
Jaysonyan updated the diff for D114224: Add JSONScopedPrinter class.

Add JSON implementation for new printList(...) overloads.
Update comment wording.

Dec 1 2021, 11:09 PM · Restricted Project
Jaysonyan updated the diff for D114684: Add ScopedPrinter unit tests.

Add more printList(...) tests.

Dec 1 2021, 10:53 PM · Restricted Project
Jaysonyan updated the diff for D114223: Make ScopedPrinter interface virtual .

Update printList for uint8_t and int8_t and remove ArrayRef from printListImpl(...)

Dec 1 2021, 10:42 PM · Restricted Project
Jaysonyan updated the diff for D114223: Make ScopedPrinter interface virtual .

Add printList overloads (to handle future JSONScopedPrinter number and boolean printing).

Dec 1 2021, 9:46 PM · Restricted Project

Nov 30 2021

Jaysonyan updated the diff for D114684: Add ScopedPrinter unit tests.

Update printEnum test

Nov 30 2021, 10:15 PM · Restricted Project
Jaysonyan added inline comments to D114684: Add ScopedPrinter unit tests.
Nov 30 2021, 10:04 PM · Restricted Project
Jaysonyan updated the diff for D114684: Add ScopedPrinter unit tests.

Add missing tests and update existing ones.

Nov 30 2021, 10:04 PM · Restricted Project
Jaysonyan added inline comments to D114684: Add ScopedPrinter unit tests.
Nov 30 2021, 12:08 AM · Restricted Project
Jaysonyan updated the diff for D114684: Add ScopedPrinter unit tests.

Address patch comments.

Nov 30 2021, 12:08 AM · Restricted Project

Nov 29 2021

Jaysonyan requested review of D114741: Move printNumber method.
Nov 29 2021, 2:17 PM · Restricted Project
Jaysonyan requested review of D114740: Remove unneeded printString methods.
Nov 29 2021, 2:05 PM · Restricted Project
Jaysonyan added inline comments to D114223: Make ScopedPrinter interface virtual .
Nov 29 2021, 1:46 PM · Restricted Project
Jaysonyan updated the diff for D114223: Make ScopedPrinter interface virtual .

Updated printRawFlagsImpl to be overloaded printFlagsImpl method.
Updated formatting.

Nov 29 2021, 1:45 PM · Restricted Project

Nov 28 2021

Jaysonyan updated the diff for D114223: Make ScopedPrinter interface virtual .

Misc formatting.

Nov 28 2021, 9:46 PM · Restricted Project
Jaysonyan added inline comments to D114224: Add JSONScopedPrinter class.
Nov 28 2021, 9:12 PM · Restricted Project
Jaysonyan updated the diff for D114224: Add JSONScopedPrinter class.

Add JSONScopedPrinter specific tests.
Update printBinaryImpl structure to include index.
Add hexNumberToInt method.
Revert JSONScopedPrinter::printListImpl to only print strings.
Add printRawFlagsImpl method to JSONScopedPrinter.

Nov 28 2021, 9:12 PM · Restricted Project
Jaysonyan updated the diff for D114684: Add ScopedPrinter unit tests.

Clean up lambda naming.

Nov 28 2021, 7:22 PM · Restricted Project
Jaysonyan requested review of D114684: Add ScopedPrinter unit tests.
Nov 28 2021, 7:11 PM · Restricted Project
Jaysonyan updated the diff for D114223: Make ScopedPrinter interface virtual .

Make printFlags and printObject virtual.

Nov 28 2021, 11:27 AM · Restricted Project

Nov 26 2021

Jaysonyan added inline comments to D114225: Add JSONScopedPrinter to llvm-readelf.
Nov 26 2021, 12:26 PM · Restricted Project
Jaysonyan updated the diff for D114225: Add JSONScopedPrinter to llvm-readelf.

Update formatting.

Nov 26 2021, 12:21 PM · Restricted Project
Jaysonyan updated the diff for D114225: Add JSONScopedPrinter to llvm-readelf.

Update --elf-output-style error messaging.
Add printFileSummary method to ObjDumper.
Misc formatting.

Nov 26 2021, 12:18 PM · Restricted Project

Nov 23 2021

Jaysonyan added inline comments to D114224: Add JSONScopedPrinter class.
Nov 23 2021, 11:51 PM · Restricted Project
Jaysonyan updated the diff for D114224: Add JSONScopedPrinter class.

Add JSONScopedPrinter tests.
Update some ScopedPrinter methods.
Fix some formatting.

Nov 23 2021, 11:48 PM · Restricted Project

Nov 22 2021

Jaysonyan added inline comments to D114225: Add JSONScopedPrinter to llvm-readelf.
Nov 22 2021, 7:07 PM · Restricted Project

Nov 21 2021

Jaysonyan added inline comments to D114225: Add JSONScopedPrinter to llvm-readelf.
Nov 21 2021, 11:31 PM · Restricted Project
Jaysonyan added a comment to D114224: Add JSONScopedPrinter class.

Cross-posting this comment, since it's now applicable to this patch specifically: I think we probably need to do a bit of both: each method should be tested in isolation. I think we should ensure we have tests for the history stack, where it's applicable only. Basically, test the existing possible code paths, plus maybe one or two more interesting cases that test interaction between functions, if it seems sensible.

Nov 21 2021, 11:02 PM · Restricted Project
Jaysonyan updated the diff for D114224: Add JSONScopedPrinter class.

Add printBinaryImpl implementation.
Remove duplicated logic for json scope logic.
Update printHex to print numbers.
Clean up formatting.

Nov 21 2021, 11:01 PM · Restricted Project

Nov 19 2021

Jaysonyan updated the diff for D114223: Make ScopedPrinter interface virtual .

Add abstraction to object/array begin/end.
Misc formatting and function renaming.

Nov 19 2021, 1:42 PM · Restricted Project

Nov 18 2021

Jaysonyan added a comment to D114052: Add JSONScopedPrinter as a subclass to ScopedPrinter with history stack.

I think JSONScopedPrinter (and possibly ScopedPrinter too, if it doesn't already have them) could do with gtest unit tests. It should be fairly straightforward to write them, and would help give confidence in the methods, especially as we may not use all of them up-front. The tests would also help with documenting what the code actually does, which will aid in future reviewing.

Will do! Do we want to test each method in isolation? or possibly in conjunction with each other to test things like the history stack? or possibly both?

We need to consider what will happen when dumping archives containing non-ELF objects. In such a case, it won't be possible to dump JSON output (for now) for them. Should we emit an error/warning in this case?

I think emitting a warning to the error stream seems reasonable in this case. Since it may still be desirable to output the information for remaining ELF objects inside those archives.

For the *Internal functions, I think *Impl tends to be a more common naming pattern I've seen (the non-impl versions do the common work, and then call the virtual impl versions, as you've done).

Thanks for the insight! Addressed in D114223.

Nov 18 2021, 11:26 PM · Restricted Project
Jaysonyan requested review of D114225: Add JSONScopedPrinter to llvm-readelf.
Nov 18 2021, 11:06 PM · Restricted Project
Jaysonyan retitled D114224: Add JSONScopedPrinter class from Add `JSONScopedPrinter` to Add JSONScopedPrinter class.
Nov 18 2021, 10:21 PM · Restricted Project
Jaysonyan requested review of D114224: Add JSONScopedPrinter class.
Nov 18 2021, 10:21 PM · Restricted Project
Jaysonyan requested review of D114223: Make ScopedPrinter interface virtual .
Nov 18 2021, 10:05 PM · Restricted Project

Nov 17 2021

Jaysonyan added a comment to D111658: Add JSON output skeleton to llvm-readelf.

Thanks for thinking about this, and sorry for not coming back sooner (I've been dealing with deadlines, but am now free for a bit, so hopefully will have a bit more time). I quite like the "history stack" idea of the two new approaches, and I think the solutions to the other cases are viable. Note however that your two new diffs appear to be identical? Either that or I'm missing where the problem 3 approach differs in the implementation.

Do you have a preference for an approach of the three?

Nov 17 2021, 7:38 PM · Restricted Project

Nov 16 2021

Jaysonyan added a comment to D111658: Add JSON output skeleton to llvm-readelf.

I think that having JSONScopedPrinter as a subclass of ScopedPrinter would have more downsides than upsides without major refactoring to how we interact with ScopedPrinter in llvm-readobj. I believe the biggest driving force to having JSONScopedPrinter as a subclass to ScopedPrinter is with the hope that each implementation of ObjDumper can be agnostic to the type of ScopedPrinter it is using (json or regular). Although I don't believe that this is possible for a few reasons:

Nov 16 2021, 9:02 PM · Restricted Project
Jaysonyan updated the summary of D114052: Add JSONScopedPrinter as a subclass to ScopedPrinter with history stack.
Nov 16 2021, 8:57 PM · Restricted Project
Jaysonyan requested review of D114053: Add JSONScopedPrinter as a subclass to ScopedPrinter with array output.
Nov 16 2021, 8:56 PM · Restricted Project
Jaysonyan requested review of D114052: Add JSONScopedPrinter as a subclass to ScopedPrinter with history stack.
Nov 16 2021, 8:54 PM · Restricted Project

Nov 10 2021

Jaysonyan added a comment to D111658: Add JSON output skeleton to llvm-readelf.

Sorry, I'm a little bit busy, and have a number of other reviews that are calling for my attention too. I haven't had a chance to give this too much further thought yet. One initial thought I had was that things like printLine might just be a no-op for JSON output, although I think it might be nicer if we could wrap these sorts of calls behind another interface suitable for generic llvm-readobj usage. Unfortunately, I don't have the time right now to take a look at all usages, to see if there's a way we could represent such functions in a cleaner manner. I'll try to come back to this later this week, or next week, if I can.

Nov 10 2021, 10:16 AM · Restricted Project

Nov 8 2021

Jaysonyan added a comment to D111658: Add JSON output skeleton to llvm-readelf.

@jhenderson I was wondering if you had any more thoughts on the design on ScopedPrinter/ ScopedPrinterBase/JSONScopedPrinter? As I see it right now, it's not very feasible to treat ScopedPrinter and JSONScopedPrinter uniformly due to the usage of methods like startLine(). So a parent-child structure between ScopedPrinter and JSONScopedPrinter might not be suitable.

Nov 8 2021, 7:51 PM · Restricted Project

Nov 5 2021

Jaysonyan updated the diff for D111658: Add JSON output skeleton to llvm-readelf.

Update readelf and readobj docs wording
Misc formatting and renaming changes

Nov 5 2021, 10:54 AM · Restricted Project

Nov 4 2021

Jaysonyan added a comment to D111658: Add JSON output skeleton to llvm-readelf.
  1. Change JSONScopedPrinter to derive from ReadobjScopedPrinter and implement the additional functions (and move it into the llvm-readobj code).
Nov 4 2021, 9:55 PM · Restricted Project

Nov 3 2021

Jaysonyan added inline comments to D111658: Add JSON output skeleton to llvm-readelf.
Nov 3 2021, 8:17 PM · Restricted Project