Skip to content
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

Merge bytecodealliance:main into wenyongh:main #776

Merged
merged 12 commits into from
Jun 10, 2023
Prev Previous commit
Next Next commit
dwarf_extractor: Constify a bit (bytecodealliance#2278)
  • Loading branch information
yamt authored Jun 9, 2023
commit cabcb177c88dac1961c69ac33026fab5794ec024
25 changes: 14 additions & 11 deletions core/iwasm/compilation/debug/dwarf_extractor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ destroy_dwarf_extractor(dwar_extractor_handle_t handle)
}

LLVMMetadataRef
dwarf_gen_file_info(AOTCompContext *comp_ctx)
dwarf_gen_file_info(const AOTCompContext *comp_ctx)
{
dwar_extractor *extractor;
int units_number;
Expand Down Expand Up @@ -191,7 +191,7 @@ dwarf_gen_mock_vm_info(AOTCompContext *comp_ctx)
#endif

LLVMMetadataRef
dwarf_gen_comp_unit_info(AOTCompContext *comp_ctx)
dwarf_gen_comp_unit_info(const AOTCompContext *comp_ctx)
{
dwar_extractor *extractor;
int units_number;
Expand Down Expand Up @@ -257,7 +257,7 @@ lldb_get_basic_type_encoding(BasicType basic_type)
}

static LLVMMetadataRef
lldb_type_to_type_dbi(AOTCompContext *comp_ctx, SBType &type)
lldb_type_to_type_dbi(const AOTCompContext *comp_ctx, SBType &type)
{
LLVMMetadataRef type_info = NULL;
BasicType basic_type = type.GetBasicType();
Expand All @@ -282,8 +282,9 @@ lldb_type_to_type_dbi(AOTCompContext *comp_ctx, SBType &type)
}

static LLVMMetadataRef
lldb_function_to_function_dbi(AOTCompContext *comp_ctx, SBSymbolContext &sc,
AOTFuncContext *func_ctx)
lldb_function_to_function_dbi(const AOTCompContext *comp_ctx,
SBSymbolContext &sc,
const AOTFuncContext *func_ctx)
{
SBFunction function(sc.GetFunction());
const char *function_name = function.GetName();
Expand Down Expand Up @@ -388,7 +389,8 @@ lldb_function_to_function_dbi(AOTCompContext *comp_ctx, SBSymbolContext &sc,
}

LLVMMetadataRef
dwarf_gen_func_info(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx)
dwarf_gen_func_info(const AOTCompContext *comp_ctx,
const AOTFuncContext *func_ctx)
{
LLVMMetadataRef func_info = NULL;
dwar_extractor *extractor;
Expand Down Expand Up @@ -417,8 +419,8 @@ dwarf_gen_func_info(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx)
}

void
dwarf_get_func_name(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
char *name, int len)
dwarf_get_func_name(const AOTCompContext *comp_ctx,
const AOTFuncContext *func_ctx, char *name, int len)
{
LLVMMetadataRef func_info = NULL;
dwar_extractor *extractor;
Expand Down Expand Up @@ -448,8 +450,8 @@ dwarf_get_func_name(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
}

LLVMMetadataRef
dwarf_gen_location(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
uint64_t vm_offset)
dwarf_gen_location(const AOTCompContext *comp_ctx,
const AOTFuncContext *func_ctx, uint64_t vm_offset)
{
LLVMMetadataRef location_info = NULL;
dwar_extractor *extractor;
Expand Down Expand Up @@ -487,7 +489,8 @@ dwarf_gen_location(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
}

LLVMMetadataRef
dwarf_gen_func_ret_location(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx)
dwarf_gen_func_ret_location(const AOTCompContext *comp_ctx,
const AOTFuncContext *func_ctx)
{
LLVMMetadataRef func_info = NULL;
dwar_extractor *extractor;
Expand Down
18 changes: 10 additions & 8 deletions core/iwasm/compilation/debug/dwarf_extractor.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,26 @@ dwar_extractor_handle_t
create_dwarf_extractor(aot_comp_data_t comp_data, char *file_name);

LLVMMetadataRef
dwarf_gen_file_info(AOTCompContext *comp_ctx);
dwarf_gen_file_info(const AOTCompContext *comp_ctx);

LLVMMetadataRef
dwarf_gen_comp_unit_info(AOTCompContext *comp_ctx);
dwarf_gen_comp_unit_info(const AOTCompContext *comp_ctx);

LLVMMetadataRef
dwarf_gen_func_info(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx);
dwarf_gen_func_info(const AOTCompContext *comp_ctx,
const AOTFuncContext *func_ctx);

LLVMMetadataRef
dwarf_gen_location(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
uint64_t vm_offset);
dwarf_gen_location(const AOTCompContext *comp_ctx,
const AOTFuncContext *func_ctx, uint64_t vm_offset);

LLVMMetadataRef
dwarf_gen_func_ret_location(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx);
dwarf_gen_func_ret_location(const AOTCompContext *comp_ctx,
const AOTFuncContext *func_ctx);

void
dwarf_get_func_name(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
char *name, int len);
dwarf_get_func_name(const AOTCompContext *comp_ctx,
const AOTFuncContext *func_ctx, char *name, int len);

#ifdef __cplusplus
}
Expand Down