Skip to content
This repository has been archived by the owner on Mar 20, 2024. It is now read-only.

Commit

Permalink
Dwarf for structs, functions, vectors (#402)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcivlin authored Jan 4, 2024
1 parent 22cfcca commit 305727f
Show file tree
Hide file tree
Showing 19 changed files with 1,411 additions and 57 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ target-out-docker
**/move-mv-llvm-compiler/**/cli-tests/basic-coin-build/absolute_path_results/*
**/move-mv-llvm-compiler/**/cli-tests/basic-coin-build/relative_path_results/*
**/move-mv-llvm-compiler/**/dwarf-tests/basic-coin-build/stored_results/*
**/move-mv-llvm-compiler/**/dwarf-tests/dwarf-struct-build/stored_results/*
**/move-mv-llvm-compiler/**/dwarf-tests/dwarf-struct-2-modules-build/stored_results/*
**/move-mv-llvm-compiler/**/dwarf-tests/dwarf-functions-build/stored_results/*
**/move-mv-llvm-compiler/**/rbpf-tests/**/*.mv
**/move-mv-llvm-compiler/**/rbpf-tests/**/*.o
**/move-mv-llvm-compiler/**/rbpf-tests/**/*.so
Expand Down
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions language/solana/move-to-solana/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ codespan-reporting = "0.11.1"
colored = "2.0.0"
env_logger = "0.8.3"
extension-trait = "1.0.1"
itertools = "0.10"
libc = "0.2"
llvm-extra-sys = { path = "../llvm-extra-sys" }
llvm-sys = "150.0.3"
Expand Down
17 changes: 9 additions & 8 deletions language/solana/move-to-solana/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -393,11 +393,18 @@ fn compile(global_env: &GlobalEnv, options: &Options) -> anyhow::Result<()> {
let entry_llmod = global_cx.llvm_cx.create_module("solana_entrypoint");
let entrypoint_generator =
EntrypointGenerator::new(&global_cx, &entry_llmod, &llmachine, options);
// Deserialization is only for one (the last) module.
let skip_cnt = if options.bytecode_file_path.is_some() {
global_env.get_modules().count() - 1
} else {
0
};
// Note: don't reverse order of modules, since DI may be inter module dependent and needs the direct order.
for mod_id in global_env
.get_modules()
.collect::<Vec<_>>()
.iter() // now the last is the first - use this in case of deserialization
.rev()
.iter()
.skip(skip_cnt)
.map(|m| m.get_id())
{
let module = global_env.get_module(mod_id);
Expand Down Expand Up @@ -439,12 +446,6 @@ fn compile(global_env: &GlobalEnv, options: &Options) -> anyhow::Result<()> {
if !(options.compile || options.llvm_ir) {
objects.push(Path::new(&output_file).to_path_buf());
}
// Deserialization is always for one module, and if global env returns many,
// after reversing the list the subject of interest is the first one.
// For Compilation we process all modules.
if options.bytecode_file_path.is_some() {
break;
}
}
if !(options.compile || options.llvm_ir) {
if entrypoint_generator.has_entries() {
Expand Down
Loading

0 comments on commit 305727f

Please sign in to comment.