[Compilation Error] Build Thunklibs fails with LLVM-19 # Description Building main trunk after upgrading to LLVM-19 is failing with this log: ``` % ninja [0/2] Re-checking globbed directories... [1/67] Building CXX object ThunkLibs/Generator/CMakeFiles/thunkgenlib.dir/analysis.cpp.o FAILED: ThunkLibs/Generator/CMakeFiles/thunkgenlib.dir/analysis.cpp.o /usr/bin/clang++ -DFEX_HAS_PRESERVE_ALL_ATTR=1 -DFEX_PRESERVE_ALL_ATTR="__attribute__((preserve_all))" -DGDB_SYMBOLS_ENABLED=1 -DGLOBAL_DATA_DIRECTORY=\"/usr/share/fex-emu/\" -D_M_ARM_64=1 -I/home/ektor5/FEX/build/ThunkLibs/Generator -I/home/ektor5/FEX/ThunkLibs/Generator -I/home/ektor5/FEX/External/robin-map/include -I/home/ektor5/FEX/External/tiny-json -I/home/ektor5/FEX/Source -I/home/ektor5/FEX/build/Source -I/home/ektor5/FEX/External/fmt/include -isystem /usr/lib/llvm-19/include -O3 -DNDEBUG -fomit-frame-pointer -std=gnu++20 -flto=thin -fPIC -Wno-trigraphs -fdiagnostics-color=always -fcolor-diagnostics -Wno-deprecated-enum-enum-conversion -Wall -MD -MT ThunkLibs/Generator/CMakeFiles/thunkgenlib.dir/analysis.cpp.o -MF ThunkLibs/Generator/CMakeFiles/thunkgenlib.dir/analysis.cpp.o.d -o ThunkLibs/Generator/CMakeFiles/thunkgenlib.dir/analysis.cpp.o -c /home/ektor5/FEX/ThunkLibs/Generator/analysis.cpp /home/ektor5/FEX/ThunkLibs/Generator/analysis.cpp:248:36: error: no member named 'getTypeAsWritten' in 'clang::ClassTemplateSpecializationDecl' 248 | throw report_error(decl->getTypeAsWritten()->getTypeLoc().getAs().getArgLoc(1).getLocation(), | ~~~~ ^ /home/ektor5/FEX/ThunkLibs/Generator/analysis.cpp:257:36: error: no member named 'getTypeAsWritten' in 'clang::ClassTemplateSpecializationDecl' 257 | throw report_error(decl->getTypeAsWritten()->getTypeLoc().getAs().getArgLoc(2).getLocation(), | ~~~~ ^ /home/ektor5/FEX/ThunkLibs/Generator/analysis.cpp:300:17: error: no member named 'getTypeAsWritten' in 'clang::ClassTemplateSpecializationDecl' 300 | decl->getTypeAsWritten()->getTypeLoc().castAs().getArgLoc(0).getLocation(); | ~~~~ ^ /home/ektor5/FEX/ThunkLibs/Generator/analysis.cpp:302:18: warning: variable 'emitted_function' set but not used [-Wunused-but-set-variable] 302 | if (auto emitted_function = llvm::dyn_cast(template_args[0].getAsDecl())) { | ^ /home/ektor5/FEX/ThunkLibs/Generator/analysis.cpp:337:17: error: no member named 'getTypeAsWritten' in 'clang::ClassTemplateSpecializationDecl' 337 | decl->getTypeAsWritten()->getTypeLoc().castAs().getArgLoc(0).getLocation(); | ~~~~ ^ 1 warning and 4 errors generated. ninja: build stopped: subcommand failed. ``` # Environment Machine: Snapdragon X Elite X1E80100 ARM64 Kernel: 6.11.0-rc6-gf60a0fc0c2a7 arch: aarch64 bits: 64 Distro: Debian Sid Compiler: Clang ``` Debian clang version 19.1.1 (1) Target: aarch64-unknown-linux-gnu Thread model: posix InstalledDir: /usr/lib/llvm-19/bin ``` FEX Build Configuration: ``` CC=clang CXX=clang++ cmake \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_BUILD_TYPE=Release \ -DUSE_LINKER=lld \ -DENABLE_LTO=True \ -DBUILD_TESTS=False \ -DENABLE_ASSERTIONS=False \ -DBUILD_THUNKS=True \ -G Ninja .. ``` # Other Information Removed `build` directory completely and compiled from scratch. Compilation works fine with LLVM-18 or disabling Thunks.