-
Notifications
You must be signed in to change notification settings - Fork 25
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
Add option to start interactive server for Parser dialect conversion #768
base: master
Are you sure you want to change the base?
Conversation
63106ed
to
3d2f75d
Compare
3d2f75d
to
3965ce5
Compare
virtual size_t write_some(std::span< const char > dst) = 0; | ||
|
||
// Upon completion, `dst` is filled with data. | ||
void read_all(std::span< char > dst) { |
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 does not work as dst
is not output parameter and you overwrite it.
You are only lucky it is used with single character span.
Also why to introduce unnecessary complexity when only thing you use is read_byte? read_some
is also nowhere else used then in read of single byte.
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 understand the thing about dst
being overwritten
re read_some
: read_some
is the only semantic that most APIs offer, but for convenience sake I also want read_all
semantics, for example when reading a request's body.
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.
What do you expect to be in dst
at the end of read_all
? You rewrite it at every iteration what is invisible from outside.
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.
dst
is a span
-- it's essentially a pointer char*
. It's equivalent to
void read_all(char *start, char *end) {
while(start != end) {
do_something(start);
++start;
}
}
dst.subspan
returns a new span that points to the same data but nread
characters ahead
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.
Oh I misunderstood it. I guess it works :)
93c8cdc
to
ac5a274
Compare
} | ||
|
||
function_model | ||
ask_user_for_function_model(vast::server::server_base &server, hl::FuncOp op) { |
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.
use core::function_op_interface
everywhere instead of hl::FuncOp
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 can't find an equivalent of getSymName()
for FunctionOpInterface
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.
dyn_cast<SymbolOpInterface>(op.getOperation()).getName()
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.
and some checks you really have symbol
ac5a274
to
52492b7
Compare
52492b7
to
e6298fb
Compare
Cpp-Linter Report
|
Known issues:
shared_ptr
to the server in order to allow the pass to be cloneable -- it's not super elegant