Skip to content

Commit

Permalink
Generate LLVM debug information
Browse files Browse the repository at this point in the history
  • Loading branch information
nickg committed May 9, 2021
1 parent b5a17ce commit a6d7cc2
Show file tree
Hide file tree
Showing 15 changed files with 217 additions and 85 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ on: [push, pull_request]

jobs:
build-ubuntu:
name: Ubuntu 18.04
runs-on: ubuntu-18.04
name: Ubuntu 20.04
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Install dependencies
run: sudo apt-get install automake flex llvm-dev check lcov
run: sudo apt-get install automake flex llvm-dev check lcov libdw-dev
- name: Generate configure script
run: ./autogen.sh
- name: Configure
Expand Down
1 change: 1 addition & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
- Fixed a crash when a long running procedure suspends in a loop (#412).
- Fixed a stack overflow when a subprogram with unconstrained array
arguments is called repeatedly in a loop (#414).
- Compiled VHDL code now includes DWARF debug information.

## 1.5 - 2020-07-19
- IEEE library sources are now distributed
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ To build from a released tarball:
sudo make install

To use a specific version of LLVM add `--with-llvm=/path/to/llvm-config`
to the configure command. LLVM 7, 8, 9, 10, 11 and 12 have all been
tested.
to the configure command. The minimum supported LLVM version is 7.0.
Versions 7, 8, 9, 10, 11 and 12 have all been tested.

NVC also depends on Flex to generate the lexical analyser.

Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ AX_DEFINE_DIR([TESTDIR], [srcdir/test], [Location of testcases])
linker_path=
case $host_os in
linux*)
AC_PATH_PROG([linker_path], [ld])
AC_PATH_TARGET_TOOL([linker_path], [ld])
;;
esac

Expand Down
10 changes: 5 additions & 5 deletions m4/ax_llvm_c.m4
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@ AC_DEFUN([AX_LLVM_C], [
LLVM_CONFIG_BINDIR="$($ac_llvm_config $ac_llvm_config_flags --bindir | sed 's|\\|\\\\|g')"
LLVM_LIBDIR="$($ac_llvm_config --libdir | sed 's|\\|\\\\|g')"

if test "$llvm_ver_num" -lt "60"; then
AC_MSG_ERROR([LLVM version 6.0 or later required])
if test "$llvm_ver_num" -lt "70"; then
AC_MSG_ERROR([LLVM version 7.0 or later required])
fi

if test "$llvm_ver_num" -lt "70"; then
AC_DEFINE_UNQUOTED(LLVM_INTRINSIC_ALIGN, [1],
[LLVM intrinsics have alignment param])
if test "$llvm_ver_num" -ge "110"; then
AC_DEFINE_UNQUOTED(LLVM_CREATE_CU_HAS_SYSROOT, [1],
[LLVMDIBuilderCreateCompileUnit has SysRoot parameter])
fi

LLVM_OBJ_EXT="o"
Expand Down
5 changes: 5 additions & 0 deletions src/array.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ void _cleanup_array(void *ptr);
(a).items[(a).count++] = (item); \
} while (0)

#define APOP(a) ({ \
assert((a).count > 0); \
(a).items[(a).count--]; \
})

#define ACLEAR(a) do { \
free((a).items); \
(a).items = NULL; \
Expand Down
Loading

0 comments on commit a6d7cc2

Please sign in to comment.