Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

Commit

Permalink
Merge pull request #91 from seq-lang/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
arshajii authored Jan 21, 2020
2 parents ad2bc5b + ae7b803 commit a86be08
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ project(Seq)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility-inlines-hidden -pedantic -Wall -Wno-return-type-c-linkage")
set(CMAKE_CXX_FLAGS_DEBUG "-g")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -march=native")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
include_directories(compiler/include)
include_directories(runtime)

Expand Down Expand Up @@ -45,6 +45,7 @@ add_library(seqrt SHARED runtime/lib.h
runtime/ksw2/ksw2_extz2_sse.cpp
runtime/ksw2/ksw2_gg2_sse.cpp)
target_link_libraries(seqrt PUBLIC bz2 lzma ${ZLIB_LIBRARIES} ${GC_LIB} ${HTS_LIB} Threads::Threads)
set_source_files_properties(runtime/align.cpp PROPERTIES COMPILE_FLAGS "-march=native")

if(SEQ_THREADED)
find_package(OpenMP REQUIRED)
Expand Down
7 changes: 7 additions & 0 deletions compiler/util/ocaml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,13 @@ FOREIGN void set_pos(SrcObject *obj, char *f, int l, int c, int len) {
free(f);
}

FOREIGN void set_func_pos(Func *func, char *f, int l, int c, int len) {
if (!func)
return;
func->setSrcInfo(SrcInfo(string(f), l, c, len));
free(f);
}

FOREIGN seq_srcinfo get_pos(SrcObject *obj) {
if (!obj) {
return seq_srcinfo{(char *)"", 0, 0, 0};
Expand Down
1 change: 1 addition & 0 deletions parser/seqaml/codegen_stmt.ml
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,7 @@ module Codegen (E : Codegen_intf.Expr) : Codegen_intf.Stmt = struct
( if ctx.base <> ctx.mdl then Llvm.Func.set_enclosing fn ctx.base );
fn
in
Llvm.Func.set_pos fn pos;
let flags = Stack.create () in
List.iter fn_attrs ~f:(fun (_, x) ->
if is_none cls
Expand Down
11 changes: 11 additions & 0 deletions parser/seqaml/llvm.ml
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,17 @@ module Func = struct

(* Getters & Setters *)

let set_pos expr (pos : Ast.Ann.t) =
foreign
"set_func_pos"
Ctypes.(t @-> cstring @-> int @-> int @-> int @-> returning void)
expr
(strdup pos.file)
pos.line
pos.col
pos.len


let set_args fn names types =
assert (List.length names = List.length types);
let names = array_of_string_list names in
Expand Down

0 comments on commit a86be08

Please sign in to comment.