Skip to content

Clang IRGen in Carbon#6641

Merged
chandlerc merged 38 commits intocarbon-language:trunkfrom
dwblaikie:clang_codegen_usage
Feb 13, 2026
Merged

Clang IRGen in Carbon#6641
chandlerc merged 38 commits intocarbon-language:trunkfrom
dwblaikie:clang_codegen_usage

Conversation

@dwblaikie
Copy link
Copy Markdown
Contributor

@dwblaikie dwblaikie commented Jan 21, 2026

Clang performs the equivalent of Carbon's lower progressively, interleaved with parsing/semantic analysis. This is in conflict with Carbon's phase-based approach and leads to bugs in missing functionality in Clang's generated IR during Carbon/C++ interop.

I surveyed other uses of Clang's APIs (originally written up in this doc - though the contents in this proposal are now more complete than the doc) to better understand how Clang's constraints might effect projects and how they've addressed them. In the mean time, Carbon changes made more stable approaches viable that were eventually implemented in #6569.

This proposal then aims to formalize the analysis that lead to #6569 for posterity in case these design decisions need to be revisited in the future.

@dwblaikie dwblaikie added proposal A proposal proposal draft Proposal in draft, not ready for review labels Jan 21, 2026
@dwblaikie dwblaikie force-pushed the clang_codegen_usage branch from 79c938e to c6d0e96 Compare January 21, 2026 23:26
@dwblaikie dwblaikie marked this pull request as ready for review January 28, 2026 22:27
@dwblaikie dwblaikie requested a review from a team as a code owner January 28, 2026 22:27
@dwblaikie dwblaikie requested review from chandlerc and removed request for a team January 28, 2026 22:27
@github-actions github-actions bot added proposal rfc Proposal with request-for-comment sent out and removed proposal draft Proposal in draft, not ready for review labels Jan 28, 2026
dwblaikie and others added 13 commits January 28, 2026 14:27
Co-authored-by: Carbon Infra Bot <carbon-external-infra@google.com>
Co-authored-by: Carbon Infra Bot <carbon-external-infra@google.com>
Co-authored-by: Carbon Infra Bot <carbon-external-infra@google.com>
Co-authored-by: Carbon Infra Bot <carbon-external-infra@google.com>
Co-authored-by: Carbon Infra Bot <carbon-external-infra@google.com>
Co-authored-by: Carbon Infra Bot <carbon-external-infra@google.com>
Co-authored-by: Carbon Infra Bot <carbon-external-infra@google.com>
Co-authored-by: Carbon Infra Bot <carbon-external-infra@google.com>
Co-authored-by: Carbon Infra Bot <carbon-external-infra@google.com>
Co-authored-by: Carbon Infra Bot <carbon-external-infra@google.com>
Co-authored-by: Carbon Infra Bot <carbon-external-infra@google.com>
Co-authored-by: Carbon Infra Bot <carbon-external-infra@google.com>
Co-authored-by: Carbon Infra Bot <carbon-external-infra@google.com>
@dwblaikie dwblaikie requested a review from jonmeow February 9, 2026 19:30
dwblaikie and others added 9 commits February 9, 2026 11:47
Co-authored-by: Carbon Infra Bot <carbon-external-infra@google.com>
Co-authored-by: Carbon Infra Bot <carbon-external-infra@google.com>
Co-authored-by: Carbon Infra Bot <carbon-external-infra@google.com>
Co-authored-by: Carbon Infra Bot <carbon-external-infra@google.com>
Co-authored-by: Carbon Infra Bot <carbon-external-infra@google.com>
Co-authored-by: Carbon Infra Bot <carbon-external-infra@google.com>
Co-authored-by: Carbon Infra Bot <carbon-external-infra@google.com>
Co-authored-by: Carbon Infra Bot <carbon-external-infra@google.com>
Co-authored-by: Carbon Infra Bot <carbon-external-infra@google.com>
@dwblaikie dwblaikie requested a review from chandlerc February 10, 2026 16:18
Copy link
Copy Markdown
Contributor

@chandlerc chandlerc left a comment

Choose a reason for hiding this comment

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

Yeah, this structure makes sense to me I think.

dwblaikie and others added 8 commits February 12, 2026 12:40
Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
Co-authored-by: Carbon Infra Bot <carbon-external-infra@google.com>
Co-authored-by: Carbon Infra Bot <carbon-external-infra@google.com>
Co-authored-by: Carbon Infra Bot <carbon-external-infra@google.com>
@dwblaikie dwblaikie requested a review from chandlerc February 12, 2026 21:20
Copy link
Copy Markdown
Contributor

@chandlerc chandlerc left a comment

Choose a reason for hiding this comment

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

Minor suggestion in line, but generally happy with this.

Any concerns @zygoloid or others before this merges?

Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
Co-authored-by: Carbon Infra Bot <carbon-external-infra@google.com>
@zygoloid
Copy link
Copy Markdown
Contributor

Any concerns @zygoloid or others before this merges?

LGTM

Copy link
Copy Markdown
Contributor

@chandlerc chandlerc left a comment

Choose a reason for hiding this comment

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

Approved!

@chandlerc chandlerc added this pull request to the merge queue Feb 13, 2026
Merged via the queue into carbon-language:trunk with commit 611aba3 Feb 13, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

proposal rfc Proposal with request-for-comment sent out proposal A proposal

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants