-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[clang][PAC] Add __builtin_get_vtable_pointer #139790
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
Changes from 1 commit
a933679
1c541ff
6767751
ba361e7
d61da13
8c0150c
f9cc288
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -1825,6 +1825,37 @@ static ExprResult PointerAuthStringDiscriminator(Sema &S, CallExpr *Call) { | |||||
| return Call; | ||||||
| } | ||||||
|
|
||||||
| static ExprResult GetVTablePointer(Sema &S, CallExpr *Call) { | ||||||
| if (S.checkArgCount(Call, 1)) | ||||||
| return ExprError(); | ||||||
| ExprResult ThisArg = S.DefaultFunctionArrayLvalueConversion(Call->getArg(0)); | ||||||
| if (ThisArg.isInvalid()) | ||||||
| return ExprError(); | ||||||
| Call->setArg(0, ThisArg.get()); | ||||||
| const Expr *Subject = Call->getArg(0); | ||||||
|
||||||
| const Expr *Subject = Call->getArg(0); | |
| const Expr *Subject = ThisArg.get(); |
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.
FirstArg would be a better name, or jusst Arg
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.
goddammit forgot this change
Outdated
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.
| << 0 << SubjectType; | |
| << /*Class* /0 << SubjectType; |
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.
@cor3ntin for both of these (/Class/ and /Polymorpic/) should that be using =*/? and also I wonder if we can make clang format aware of the /*ParameterName=*/ idiom for parameters of bool and (maybe) integer types? (recognizing that in the context of operator << in diags this is a different problem)
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.
We don't use = there (or not consistently). The important bit is to know what's happening.
You could look into %enum_select as a better solution
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.
or we could make every diag encode the type of the diag as a function type, and have things fail at compile time when possible. This would be super great as it would provide a great stress test for clangs template code :D :D :D
Outdated
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.
| << 1 << SubjectRecord; | |
| << /* Polymorphic*/1 << SubjectRecord; |
Uh oh!
There was an error while loading. Please reload this page.