Skip to content

Commit

Permalink
merge to aslp-lifter project, distrubute src files, remove old cmakes
Browse files Browse the repository at this point in the history
  • Loading branch information
katrinafyi committed Apr 4, 2024
1 parent 50f0828 commit dccf0f5
Show file tree
Hide file tree
Showing 16 changed files with 64 additions and 122 deletions.
6 changes: 3 additions & 3 deletions libASL/cpp_backend.ml
Original file line number Diff line number Diff line change
Expand Up @@ -391,8 +391,8 @@ let init_st (genfns: cpp_fun_sig list) prefix file =
genvars; }

let export_dir = "aslp/generated"
let gen_prefix = "aslp-lifter-gen/include"
let instantiate_prefix = "aslp-lifter-instantiate/src"
let gen_prefix = "aslp-lifter/include"
let instantiate_prefix = "aslp-lifter/src"
let stdlib_deps = ["cassert"; "tuple"; "variant"; "vector"; "stdexcept"; "aslp/interface.hpp"]
let global_deps = stdlib_deps @ [export_dir^"/aslp_lifter.hpp"]

Expand All @@ -419,7 +419,7 @@ let write_test_file tests prefix dir =
close_out st.oc;
gens

(* Write the prefix decoder file *)
(* Write the decoder file *)
let write_decoder_file fn fnsig genfns prefix dir =
let m = name_of_FIdent fn in
let path = dir ^ "/" ^ m ^ ".hpp" in
Expand Down
9 changes: 8 additions & 1 deletion offlineASL-cpp/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,12 @@
set -o pipefail

# echo ":gen A64 aarch64_integer_arithmetic.+ cpp $(pwd)" | dune exec asli
echo ":gen A64 aarch64.+ cpp $(dirname "$0")" | dune exec asli
dir="$(dirname "$0")"
cd "$dir"
# echo ":gen A64 aarch64.+ cpp ./subprojects" | dune exec asli

meson setup --reconfigure build
pushd build
meson compile
DESTDIR=$(pwd)/prefix meson install
popd
12 changes: 10 additions & 2 deletions offlineASL-cpp/meson.build
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
project('offlineasl', 'cpp',
version : '0.1',
default_options : ['warning_level=3', 'cpp_std=c++20'])
default_options : [
'warning_level=3',
'cpp_std=c++20',
'buildtype=debug',
'strip=true',
]
)

subproject('aslp-lifter-gen')
# debug(get_option('buildtype'))

subproject('aslp-lifter')
subproject('aslp-lifter-instantiate')
76 changes: 0 additions & 76 deletions offlineASL-cpp/subprojects/aslp-lifter-gen/CMakeLists.txt

This file was deleted.

12 changes: 0 additions & 12 deletions offlineASL-cpp/subprojects/aslp-lifter-gen/aslp-lifter-gen.pc.in

This file was deleted.

14 changes: 0 additions & 14 deletions offlineASL-cpp/subprojects/aslp-lifter-gen/meson.build

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#pragma once
#include <charconv>
#include <llvm/ADT/APInt.h>
#include <llvm/IR/Value.h>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#pragma once
#include <aslp/interface.hpp>

#include <llvm/ADT/APInt.h>
Expand Down
23 changes: 9 additions & 14 deletions offlineASL-cpp/subprojects/aslp-lifter-instantiate/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,26 @@ project('aslp-lifter-instantiate', 'cpp',
version : '0.1',
default_options : [ 'warning_level=3', 'cpp_std=c++20' ])

version = meson.project_version()
llvm_dep = dependency('llvm')

gen_name = 'aslp-lifter-gen'
gen_proj = subproject(gen_name, version: meson.project_version())
gen_dep = gen_proj.get_variable('dep')
# gen_pc = gen_proj.get_variable('pc')
lifter_name = 'aslp-lifter'
lifter_proj = subproject(lifter_name, version: version)
instantiate_dep = lifter_proj.get_variable('instantiate_dep')

incdir = 'include'
install_subdir(incdir, install_dir : get_option('includedir'), strip_directory : true)

find = run_command('find', 'src', '-name', '*.cpp', check : true)
srcfiles = find.stdout().strip().split('\n')[0] # XXX for meson testing

lib = library(
'aslp-lifter-instantiate',
srcfiles,
meson.project_name(),
[],
include_directories : incdir,
dependencies: [ llvm_dep, gen_dep ],
dependencies: [ llvm_dep, instantiate_dep ],
cpp_args: [
'-Wno-unused-parameter',
'-includeaslp/llvm_lifter_traits.hpp',
'-DASLP_LIFTER_INSTANTIATE=llvm_lifter_traits'],
cpp_pch: 'pch/cpp_pch.hpp',
install : true)

dep = declare_dependency(link_with: lib, dependencies: gen_dep)

pkg = import('pkgconfig')
pkg.generate(lib, subdirs: 'aslp', requires: gen_name)
pkg.generate(lib, requires: lifter_name + '=' + version)
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include <cassert>
#include <tuple>
#include <variant>
#include <vector>
#include <stdexcept>
#include <aslp/interface.hpp>
#include <aslp/generated/aslp_lifter.hpp>
Empty file.
25 changes: 25 additions & 0 deletions offlineASL-cpp/subprojects/aslp-lifter/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
project('aslp-lifter', 'cpp',
version : '0.1',
default_options : ['warning_level=3', 'cpp_std=c++20'])

incdir = 'include'
srcdir = 'src'
install_srcdir = get_option('datadir') / 'aslp'

install_subdir(incdir, install_dir : get_option('includedir'), strip_directory : true)
gen_dep = declare_dependency(include_directories : incdir)

find = run_command('find', srcdir, '-name', '*.cpp', check : true)
srcfiles = files(find.stdout().strip().split('\n'))

install_subdir(srcdir, install_dir: install_srcdir, strip_directory : true)
instantiate_dep = declare_dependency(
sources: srcfiles,
dependencies: gen_dep,
compile_args: ['-Wno-unused-parameter'])

pkg = import('pkgconfig')
pkg.generate(
name: meson.project_name(),
description: 'offline aslp lifter library (template headers and explicit instantiation sources)',
variables: {'srcdir': '${prefix}' / install_srcdir})

0 comments on commit dccf0f5

Please sign in to comment.