This commit enables compiling DAPHNE with Clang (tested version 18.1.3 from Ubuntu 24 LTS). Below is the collected change log of the pre-squash commits:
[DAPHNE-daphne-eu#830] Fix duplicate symbol linker issue
Compiling with Clang/LLD complains about duplicate symbols of supportsUnaryOp and supportsBinaryOp.
The definition of supportsBinaryOp would need to be declared static if left i the BinaryOpCode.h header which is included in several places.
Since this definition is not allowed and there is only one use, it is moved to its own file.
[DAPHNE-daphne-eu#830] Replace lambda function using invalid C++ with local static template function
std::pair<bool, auto> was used as a convenience function in DaphneDSLVisitor.cpp. According to [1] this is invalid and only works with GCC. Replacing it with a templated local function makes Clang compile it too. Further improvements to this file will be considered in future commit.
[1] https://stackoverflow.com/questions/59578575/stdpairauto-auto-return-type
[DAPHNE-daphne-eu#830] Fix anonymous namespace issue when compiling with Clang
When compiling with clang, there is a issue at runtime (LLVM complaining about anonymous namespaces not allowed in various places). These are hereby replaced with a non-anonymous namespace. For the lack of creativity these are all called "file_local".
[DAPHNE-daphne-eu#830] Fix compilation error (with clang) in json dependency
The use of EOF in our json dependency makes compilation fail with Clang.
Patch is based on nlohmannjson version 3.11.3
[DAPHNE-daphne-eu#830] Silence warning when using LLD
With this new CMake configuration, we silence a lot of warnings when using the LLD linker in combination with clang:
``clang++: warning: argument unused during compilation: '-fuse-ld=lld' [-Wunused-command-line-argument]``
A CMake version bump to 3.29 is necessary for this config option. Ubuntu 24 users need to switch to the snap version of CMake. The Docker images already provide CMake 3.30
[DAPHNE-daphne-eu#830] Clang option for build.sh
This commit adds the convenience option to build with Clang to the build.sh script
Resolves daphne-eu#830, Closes daphne-eu#831