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

Insert remaining cir.unreachables #457

Closed
bcardosolopes opened this issue Feb 8, 2024 · 2 comments
Closed

Insert remaining cir.unreachables #457

bcardosolopes opened this issue Feb 8, 2024 · 2 comments

Comments

@bcardosolopes
Copy link
Member

This place handles control flows that implicitly returns from a function with a non-void return type. In such a circumstance we want to insert a cir.unreachable operation to terminate the implicitly-returning block. However, when the LexicalScope object that represents the whole function body is destroyed, it already inserts cir.return operations at every returning path. So I believe a better place for emitting cir.unreachable here should be in the LexicalScope::cleanup function.

Originally posted by @bcardosolopes in #447 (comment)

bcardosolopes pushed a commit that referenced this issue Mar 5, 2024
This patch changes the emission of implicit returns from functions whose
return type is not `void`. Instead of emitting `cir.return`, this PR
aligns to the original clang CodeGen and emits a `cir.unreachable`
operation.

Related issue: #457 .
@Lancern
Copy link
Collaborator

Lancern commented Mar 12, 2024

This issue should be resolved and can be closed.

@bcardosolopes
Copy link
Member Author

Thanks for fixing it!

lanza pushed a commit that referenced this issue Mar 23, 2024
This patch changes the emission of implicit returns from functions whose
return type is not `void`. Instead of emitting `cir.return`, this PR
aligns to the original clang CodeGen and emits a `cir.unreachable`
operation.

Related issue: #457 .
eZWALT pushed a commit to eZWALT/clangir that referenced this issue Mar 24, 2024
This patch changes the emission of implicit returns from functions whose
return type is not `void`. Instead of emitting `cir.return`, this PR
aligns to the original clang CodeGen and emits a `cir.unreachable`
operation.

Related issue: llvm#457 .
lanza pushed a commit that referenced this issue Apr 29, 2024
This patch changes the emission of implicit returns from functions whose
return type is not `void`. Instead of emitting `cir.return`, this PR
aligns to the original clang CodeGen and emits a `cir.unreachable`
operation.

Related issue: #457 .
lanza pushed a commit that referenced this issue Apr 29, 2024
This patch changes the emission of implicit returns from functions whose
return type is not `void`. Instead of emitting `cir.return`, this PR
aligns to the original clang CodeGen and emits a `cir.unreachable`
operation.

Related issue: #457 .
eZWALT pushed a commit to eZWALT/clangir that referenced this issue Apr 29, 2024
This patch changes the emission of implicit returns from functions whose
return type is not `void`. Instead of emitting `cir.return`, this PR
aligns to the original clang CodeGen and emits a `cir.unreachable`
operation.

Related issue: llvm#457 .
lanza pushed a commit that referenced this issue Apr 29, 2024
This patch changes the emission of implicit returns from functions whose
return type is not `void`. Instead of emitting `cir.return`, this PR
aligns to the original clang CodeGen and emits a `cir.unreachable`
operation.

Related issue: #457 .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants