support reading calls and symbols#45
Merged
Merged
Conversation
Coverage
Diff CoverageDiff CoverageDiff: origin/main...HEAD, staged and unstaged changes
Summary
jitir.hppLines 5094-5106 5094 error("Undefined value '" + value_name + "'");
5095 }
5096 return _value_labels[value_name];
5097 } else if (c == '@') {
! 5098 get_char(); // consume '@'
! 5099 std::string sym_name = get_word();
! 5100 expect_char(':');
! 5101 Type type = read_type();
! 5102 return _builder.section()->context().build_symbol(type, sym_name);
5103 } else {
5104 return read_const();
5105 }
5106 }Lines 5441-5449 5441 CallConv call_conv = read_call_conv();
5442 Inst* result = _builder.build_call(callee, args.size(), type, call_conv)
5443 ;
5444 for (size_t it = 0; it < args.size(); it++) {
! 5445 result->set_arg(it + 1, args[it]);
5446 }
5447 return result; } else if (opcode == "Branch") {
5448 Value* cond = read_value_arg();
5449 expect_char(','); skip_whitespace();Lines 5463-5471 5463 Block* block = read_block_argument();
5464 Inst* result = _builder.build_jump(args.size(), block)
5465 ;
5466 for (size_t it = 0; it < args.size(); it++) {
! 5467 result->set_arg(it + 0, args[it]);
5468 }
5469 return result; } else if (opcode == "Exit") {
5470 return _builder.build_exit()
5471 ;Lines 5568-5576 5568 if (!value_name.empty()) {
5569 _value_labels[value_name] = value;
5570 if (dynmatch(Inst, inst, value)) {
5571 if (inst->has_side_effect() && inst->type() == Type::Void) {
! 5572 error("Instructions with side effects and no return value cannot be named");
5573 }
5574 }
5575 } else {
5576 if (dynmatch(Inst, inst, value)) {Lines 5577-5586 5577 if (!inst->has_side_effect() && !inst->is_terminator() && !dynamic_cast<CommentInst*>(inst)) {
5578 error("Instructions without side effects must be named");
5579 }
5580 if (inst->has_side_effect() && inst->type() != Type::Void) {
! 5581 error("Instructions with side effects and a return value must be named");
! 5582 }
5583 }
5584 }
5585 if (dynmatch(Inst, inst, value)) {
5586 if (inst->is_terminator()) { |
Coverage
Diff CoverageDiff CoverageDiff: origin/main...HEAD, staged and unstaged changes
Summary
jitir.hppLines 5568-5576 5568 if (!value_name.empty()) {
5569 _value_labels[value_name] = value;
5570 if (dynmatch(Inst, inst, value)) {
5571 if (inst->has_side_effect() && inst->type() == Type::Void) {
! 5572 error("Instructions with side effects and no return value cannot be named");
5573 }
5574 }
5575 } else {
5576 if (dynmatch(Inst, inst, value)) {Lines 5577-5586 5577 if (!inst->has_side_effect() && !inst->is_terminator() && !dynamic_cast<CommentInst*>(inst)) {
5578 error("Instructions without side effects must be named");
5579 }
5580 if (inst->has_side_effect() && inst->type() != Type::Void) {
! 5581 error("Instructions with side effects and a return value must be named");
! 5582 }
5583 }
5584 }
5585 if (dynmatch(Inst, inst, value)) {
5586 if (inst->is_terminator()) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.