-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[WebKit checkers] Add the support for OSObjectPtr #159484
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 3 commits
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 |
|---|---|---|
|
|
@@ -130,7 +130,8 @@ bool isRefType(const std::string &Name) { | |
| } | ||
|
|
||
| bool isRetainPtr(const std::string &Name) { | ||
| return Name == "RetainPtr" || Name == "RetainPtrArc"; | ||
| return Name == "RetainPtr" || Name == "RetainPtrArc" || | ||
| Name == "OSObjectPtr" || Name == "OSObjectPtrArc"; | ||
| } | ||
|
|
||
| bool isCheckedPtr(const std::string &Name) { | ||
|
|
@@ -170,7 +171,8 @@ bool isCtorOfRetainPtr(const clang::FunctionDecl *F) { | |
| const std::string &FunctionName = safeGetName(F); | ||
| return FunctionName == "RetainPtr" || FunctionName == "adoptNS" || | ||
| FunctionName == "adoptCF" || FunctionName == "retainPtr" || | ||
| FunctionName == "RetainPtrArc" || FunctionName == "adoptNSArc"; | ||
| FunctionName == "RetainPtrArc" || FunctionName == "adoptNSArc" || | ||
| FunctionName == "adoptOSObject" || FunctionName == "adoptOSObjectArc"; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: Same as above - rename function to reflect the new functionality.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Renamed to |
||
| } | ||
|
|
||
| bool isCtorOfSafePtr(const clang::FunctionDecl *F) { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,22 @@ | ||
| #ifndef std_move | ||
| #define std_move | ||
|
|
||
| namespace std { | ||
|
|
||
| template <typename T> struct remove_reference { | ||
| typedef T type; | ||
| }; | ||
|
|
||
| template <typename T> struct remove_reference<T&> { | ||
| typedef T type; | ||
| }; | ||
|
|
||
| template<typename T> typename remove_reference<T>::type&& move(T&& t); | ||
|
|
||
| } | ||
|
|
||
| #endif | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice job refactoring our common code! |
||
| #ifndef mock_types_1103988513531 | ||
| #define mock_types_1103988513531 | ||
|
|
||
|
|
||
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.
Nit: Maybe rename
isRetainPtrto indicate its new functionality.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.
Renamed to
isRetainPtrOrOSPtr.