-
Notifications
You must be signed in to change notification settings - Fork 100
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
Conversation
There was a problem hiding this 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, |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
No description provided.