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

[CIR][CIRGen][Builtin] Support __builtin_return_address #1046

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

ghehg
Copy link
Collaborator

@ghehg ghehg commented Nov 1, 2024

@ghehg ghehg changed the title [CIR][CIRGen][Builtin] Implement __builtin_return_address [CIR][CIRGen][Builtin] Support __builtin_return_address Nov 1, 2024
@ghehg ghehg marked this pull request as ready for review November 2, 2024 12:43
clang/lib/CIR/CodeGen/CIRGenBuiltin.cpp Show resolved Hide resolved
clang/test/CIR/CodeGen/builtins.cpp Outdated Show resolved Hide resolved
@ghehg ghehg force-pushed the second branch 2 times, most recently from 1c5ea0b to e18d6a5 Compare November 5, 2024 20:42
Copy link
Member

@bcardosolopes bcardosolopes left a comment

Choose a reason for hiding this comment

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

Awesome, thanks! Just a minor nit and I'll merge it


def ReturnAddrOp : CIR_Op<"return_address"> {
let arguments = (ins UInt32:$level);
let summary = "call to `__builtin_return_address`";
Copy link
Member

@bcardosolopes bcardosolopes Nov 6, 2024

Choose a reason for hiding this comment

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

Summary should be a bit more generic, extracting from your full desc, one idea: The return address of the current function or of one of its callers.

Copy link
Collaborator Author

@ghehg ghehg Nov 6, 2024

Choose a reason for hiding this comment

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

Make sense, just updated the summary

Copy link

github-actions bot commented Nov 6, 2024

✅ With the latest revision this PR passed the C/C++ code formatter.

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

Successfully merging this pull request may close these issues.

2 participants