-
Notifications
You must be signed in to change notification settings - Fork 435
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
s/IF_FALSE/UNLESS/ in ET_LOG macro names #8317
base: gh/swolchok/237/head
Are you sure you want to change the base?
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/8317
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New FailureAs of commit 8ee2441 with merge base 883d33a ( NEW FAILURE - The following job has failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
"do something unless X" reads much better than "do something if false X". ghstack-source-id: cae2fe0bf74e32e72179b3288bb610c1ae252afa ghstack-comment-id: 2644043544 Pull Request resolved: #8317
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.
Explicitly marking these as DEPRECATED will let us remove them in a couple of releases
do { \ | ||
if (!(cond)) { \ | ||
ET_LOG(Error, "Check failed (%s): ", #cond); \ | ||
return false; \ | ||
} \ | ||
} while (false) | ||
|
||
/** | ||
* Backward compatibility shim for the old name of ET_LOG_AND_RETURN_UNLESS. |
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.
* Backward compatibility shim for the old name of ET_LOG_AND_RETURN_UNLESS. | |
* DEPRECATED: Please use ET_LOG_AND_RETURN_UNLESS instead. |
do { \ | ||
if (!(cond)) { \ | ||
ET_LOG(Error, "Check failed (%s): " message, #cond, ##__VA_ARGS__); \ | ||
return false; \ | ||
} \ | ||
} while (false) | ||
|
||
/** | ||
* Backward compatibility shim for the old name of ET_LOG_MSG_AND_RETURN_UNLESS |
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.
* Backward compatibility shim for the old name of ET_LOG_MSG_AND_RETURN_UNLESS | |
* DEPRECATED: Please use ET_LOG_MSG_AND_RETURN_UNLESS instead. |
@@ -338,14 +338,19 @@ | |||
* | |||
* @param[in] cond the condition to check | |||
*/ | |||
#define ET_LOG_AND_RETURN_IF_FALSE(cond) \ | |||
#define ET_LOG_AND_RETURN_UNLESS(cond) \ |
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.
These feel like they should live near
executorch/runtime/core/error.h
Line 121 in d99970b
#define ET_CHECK_OR_RETURN_ERROR(cond__, error__, message__, ...) \ |
"do something unless X" reads much better than "do something if false X".