3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-07-28 10:02:51 +00:00
yosys/kernel
Jannis Harder d8687e87b1 kernel: Avoid including files outside include guards
This adjusts the way the headers kernel/{yosys,rtlil,register,log}.h
include each other to avoid the need of including headers outside of
include guards as well as avoiding the inclusion of rtlil.h in the
middle of yosys.h with rtlil.h depending on the prefix of yosys.h, and
the suffix of yosys.h depending on rtlil.h.

To do this I moved some of the declaration in yosys.h into a new header
yosys_common.h. I'm not sure if that is strictly necessary.

Including any of these files still results in the declarations of all
these headers being included, so this shouldn't be a breaking change for
any passes or external plugins.

My main motivation for this is that ccls's (clang based language server)
include guard handling gets confused by the previous way the includes
were done. It often ends up treating the include guard as a generic
disabled preprocessor conditional, breaking navigation and highlighting
for the core RTLIL data structures.

Additionally I think avoiding cyclic includes in the middle of header
files that depend on includes being outside of include guards will also
be less confusing for developers reading the code, not only for tools
like ccls.
2024-04-02 16:53:56 +02:00
..
binding.cc
binding.h
bitpattern.h
calc.cc
cellaigs.cc
cellaigs.h
celledges.cc celledges: Register async FF paths 2024-03-11 10:45:36 +01:00
celledges.h
celltypes.h Add builtin celltype $scopeinfo 2024-02-06 17:51:24 +01:00
consteval.h
constids.inc Add new $check cell to represent assertions with a message. 2024-02-01 20:10:39 +01:00
cost.h
driver.cc driver: Fix crashes on missing cli arguments 2024-02-12 14:56:23 +01:00
ff.cc
ff.h
ffinit.h
ffmerge.cc
ffmerge.h
fmt.cc fmt: if enabled, group padding zeroes. 2024-04-02 12:13:22 +02:00
fmt.h fmt,cxxrtl: add option to group digits in numbers. 2024-04-02 12:13:22 +02:00
fstdata.cc
fstdata.h
hashlib.h hashlib: Add missing stdint.h include 2024-02-08 14:27:12 +00:00
json.cc
json.h
log.cc change verific log callback api 2023-11-01 08:13:27 +01:00
log.h kernel: Avoid including files outside include guards 2024-04-02 16:53:56 +02:00
macc.h
mem.cc mem: only import attributes from ports if the memory doesn't have them yet 2023-10-30 16:31:53 +01:00
mem.h
modtools.h
qcsat.cc
qcsat.h
register.cc Merge branch 'origin/master' into krys/docs 2024-03-18 10:39:30 +13:00
register.h kernel: Avoid including files outside include guards 2024-04-02 16:53:56 +02:00
rtlil.cc Add builtin celltype $scopeinfo 2024-02-06 17:51:24 +01:00
rtlil.h kernel: Avoid including files outside include guards 2024-04-02 16:53:56 +02:00
satgen.cc Add builtin celltype $scopeinfo 2024-02-06 17:51:24 +01:00
satgen.h
scopeinfo.cc Add scopeinfo index/lookup utils 2024-02-06 18:01:26 +01:00
scopeinfo.h Add scopeinfo index/lookup utils 2024-02-06 18:01:26 +01:00
sigtools.h
timinginfo.h
utils.h utils: Save detected loops with their nodes in-order 2024-03-11 10:43:49 +01:00
yosys.cc Tweak the FreeBSD version of proc_self_dirname() to work on NetBSD use it. 2024-03-03 07:54:39 -08:00
yosys.h kernel: Avoid including files outside include guards 2024-04-02 16:53:56 +02:00
yosys_common.h kernel: Avoid including files outside include guards 2024-04-02 16:53:56 +02:00
yw.cc
yw.h