-
Notifications
You must be signed in to change notification settings - Fork 444
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
Refactor error_helper and around #4686
Conversation
This seems backwards as |
That's exactly the problem :(
So, maybe, we'd be explicit? And remove |
Ugh -- that would require rewriting all of the LOG statements everywhere, including all the backends (which tend to rely on them quite a bit). That was why we had Maybe we could add a |
@ChrisDodd Ok. I moved to opposite direction ( |
|
||
#include "big_int_util.h" | ||
// FIXME: Replace with big_int_fwd.h with Boost 1.84+ |
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.
#4663 could help with this.
Will you please take a look when you will have a chance? I am having other PRs in the pipeline that are related to various strings aspects and they are a bit conflicting with each other to keep everything downstream :) Thanks! |
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.
This should be ok, but I think the idea of unifying toString and dbprint with an additional flag in dbprint.h is a good way to go in the future.
Yes, I already opened #4698 to track this! |
- Use universal references - Consistently forward the packs - Ensure we move things passed by value - Use C++17 constructs
…lates. Removes some layers of indirection.
- prefer dbprint() method for operator<<(ostream&) when present - otherwise, fallback to toString(), if present
…ce amount of visible overload variants
This is a next step around messages emission refactoring. Essentially:
Things are a bit messy for the latter. We are having:
toString
,dbprint
(that are different) and sometimes explicitoperator<<
. Plus, we defineoperator<<
in a global namespace (inlog.g
, and some IR classes depend on this!) and calldbprint
from there. However, for error messages, etc. we do not want to useoperator<<
(that is default implementation forboost::format
for user-defined types) and use explicittoString
.So, this PR tries to do some consolidation of conversion to strings:
stringify.h
, solog.h
is all about loggingoperator<<
to usetoString
, if available. If not, we try to delegate todbprint