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___memmove_chk #1106

Merged
merged 4 commits into from
Nov 15, 2024

Conversation

ghehg
Copy link
Collaborator

@ghehg ghehg commented Nov 11, 2024

No description provided.

@ghehg ghehg marked this pull request as ready for review November 12, 2024 13:09
Copy link
Collaborator

@smeenai smeenai left a comment

Choose a reason for hiding this comment

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

I don't think testing the LLVM output is super valuable here, because I assume the cir.libc.memmove -> llvm memmove intrinsic lowering is already tested somewhere else, and there's nothing interesting on the LLVM lowering side beyond that. I'm fine leaving those in though.

@@ -345,6 +345,18 @@ RValue CIRGenFunction::emitRotate(const CallExpr *E, bool IsRotateRight) {
return RValue::get(r);
}

static bool isMemBuiltinOutOfBoundPossible(const CallExpr *expr,
clang::CIRGen::CIRGenModule &cgm,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe we can take the ASTContext as a parameter instead of the cgm, since that's all we're using? That'll let us potentially share this helper with CodeGen in the future.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yeah, it's a good idea, will change it. Also, now looking at it. I'm also thinking maybe I should pass argument expr of dstsize and size as parameters, instead of passing CallExpr so we have to do E->getArg(2) which assumes that size and dst size are 3rd and 4th argument.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yup, that's a good idea.

@bcardosolopes bcardosolopes merged commit ab9fbcf into llvm:main Nov 15, 2024
6 checks passed
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.

3 participants