Skip to content
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

Fix quirks in debug printing #4088

Merged
merged 2 commits into from
Jul 1, 2024

Conversation

jonmeow
Copy link
Contributor

@jonmeow jonmeow commented Jun 27, 2024

So, I noticed that ImportIRInst didn't print properly while trying to debug an issue, and that's where this started. Then I was sort of trying to figure out why we have "type_blocks" but "typeBlock", so trying to make that more consistent. "importIRInst0" felt more odd than "import_ir_inst0" which is why I'm suggesting down this particular route, but let me know if you'd prefer the reverse (but then do we also do "typeBlocks", etc, removing the consistency with the member name?)

Also starting to print more detail on import_irs, and added import_ir_insts (adjusting formatting for that too).

@github-actions github-actions bot requested a review from geoffromer June 27, 2024 16:25
@jonmeow jonmeow requested review from zygoloid and removed request for geoffromer June 27, 2024 16:33
Copy link
Contributor

@zygoloid zygoloid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consistently using snake_case seems fine to me.

using ValueType = ImportIRInst;

// An explicitly invalid ID.
static const ImportIRInstId Invalid;

using IdBase::IdBase;

auto Print(llvm::raw_ostream& out) const -> void {
out << "import_ir_inst";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We seem to have no test coverage for this; can you add some?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Also started printing the import_ir_inst list, and adjusted formatting for that and ImportIR.

@jonmeow jonmeow force-pushed the fix-import-ir-inst branch 2 times, most recently from da4e27d to 23cb96e Compare June 28, 2024 21:02
@jonmeow jonmeow added this pull request to the merge queue Jul 1, 2024
Merged via the queue into carbon-language:trunk with commit 8218769 Jul 1, 2024
7 checks passed
@jonmeow jonmeow deleted the fix-import-ir-inst branch July 1, 2024 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants