Skip to content

Commit c8b3ba7

Browse files
committed
small fix for imm and const expr
Signed-off-by: Luke Quinn <[email protected]>
1 parent b795b2e commit c8b3ba7

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

backends/cpp_hart_gen/lib/gen_cpp.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,8 @@ def gen_cpp(symtab, indent = 0, indent_spaces: 2)
301301
else
302302
"#{' ' * indent}__UDB_MUTABLE_GLOBAL(#{text_value})"
303303
end
304+
elsif text_value == "imm"
305+
"#{' ' * indent} imm()"
304306
else
305307
"#{' ' * indent}#{text_value}"
306308
end

backends/cpp_hart_gen/templates/inst.hxx.erb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,12 @@ namespace udb {
7777
#define __UDB_SET_PC(new_pc) m_parent->set_next_pc(new_pc)
7878
#define __UDB_PC m_parent->pc()
7979
#define __UDB_MUTABLE_GLOBAL(x) m_parent->x
80-
#define __UDB_CONSTEXPR_FUNC_CALL
81-
80+
#define __UDB_CONSTEXPR_FUNC_CALL <%= name_of(:hart, cfg_arch)%>::
8281

8382
void execute() override {
8483

8584
<%- if inst.operation_ast(cfg_arch.symtab).nil? -%>
86-
assert(!"There is no operation() defined for this instruction");
85+
m_parent->udb_assert(false, "There is no operation() defined for this instruction");
8786
<%- else -%>
8887
<%- if !inst.base.nil? -%>
8988
<%- pruned_ast = inst.pruned_operation_ast(cfg_arch.symtab, inst.base) -%>

0 commit comments

Comments
 (0)