Skip to content

support reading calls and symbols#45

Merged
cfbolz merged 2 commits into
mainfrom
call-symbol-reader
Jun 3, 2026
Merged

support reading calls and symbols#45
cfbolz merged 2 commits into
mainfrom
call-symbol-reader

Conversation

@cfbolz

@cfbolz cfbolz commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown

Coverage

File Lines Functions Regions Branches
genext.hpp 🔴 54.42% 🟡 83.33% 🟡 76.14% 🟡 76.81%
jitir.hpp 🔴 49.08% 🔴 59.29% 🔴 54.34% 🔴 53.42%
jitir_llvmapi.hpp 🔴 56.19% 🔴 66.67% 🟢 92.98% 🔴 66.67%
llvmgen.hpp 🔴 62.94% 🟡 70.00% 🟡 76.55% 🟡 76.32%
lowerllvm.hpp 🔴 63.60% 🟡 75.00% 🔴 41.32% 🔴 56.49%
x86gen.hpp 🟡 74.12% 🟡 81.82% 🟡 75.78% 🟡 83.30%
x86insts.inc.hpp - - - -
TOTAL 🔴 54.88% 🔴 64.10% 🔴 63.32% 🔴 64.50%
Diff Coverage

Diff Coverage

Diff: origin/main...HEAD, staged and unstaged changes

  • jitir.hpp (23.1%): Missing lines 5098-5102,5445,5467,5572,5581-5582

Summary

  • Total: 13 lines
  • Missing: 10 lines
  • Coverage: 23%

jitir.hpp

Lines 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()) {

@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown

Coverage

File Lines Functions Regions Branches
genext.hpp 🔴 54.42% 🟡 83.33% 🟡 76.14% 🟡 76.81%
jitir.hpp 🔴 49.88% 🔴 59.75% 🔴 54.90% 🔴 54.18%
jitir_llvmapi.hpp 🔴 56.19% 🔴 66.67% 🟢 92.98% 🔴 66.67%
llvmgen.hpp 🔴 62.94% 🟡 70.00% 🟡 76.55% 🟡 76.32%
lowerllvm.hpp 🔴 63.60% 🟡 75.00% 🔴 41.32% 🔴 56.49%
x86gen.hpp 🟡 74.12% 🟡 81.82% 🟡 75.78% 🟡 83.30%
x86insts.inc.hpp - - - -
TOTAL 🔴 55.37% 🔴 64.45% 🔴 63.62% 🔴 64.95%
Diff Coverage

Diff Coverage

Diff: origin/main...HEAD, staged and unstaged changes

  • jitir.hpp (76.9%): Missing lines 5572,5581-5582

Summary

  • Total: 13 lines
  • Missing: 3 lines
  • Coverage: 76%

jitir.hpp

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()) {

@cfbolz
cfbolz merged commit 92d405a into main Jun 3, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant