Category : llvm

I have a simple setup where CMake produces the following compile command: cd /workspaces/cmake-general/tests/project/build/examples/hello-world && /usr/local/bin/cmake -E __run_co_compile –iwyu=/usr/local/bin/include-what-you-use –tidy="/usr/bin/clang-tidy;-extra-arg=-Wno-unknown-warning-option;-warnings-as-errors=*;–extra-arg-before=–driver-mode=g++" –source=/workspaces/cmake-general/tests/project/build/examples/hello-world/CMakeFiles/example-hello-world.dir/cmake_pch.hxx.cxx — /usr/bin/c++ -I/workspaces/cmake-general/tests/project/examples/hello-world/src -I/workspaces/cmake-general/tests/project/build -O3 -DNDEBUG -stdlib=libc++ -fcolor-diagnostics -Wall -Wextra -Wshadow -Wnon-virtual-dtor -Wold-style-cast -Wcast-align -Wunused -Woverloaded-virtual -Wpedantic -Wconversion -Wsign-conversion -Wnull-dereference -Wdouble-promotion -Wformat=2 -Werror -std=c++20 -Winvalid-pch -fpch-instantiate-templates -Xclang -emit-pch -Xclang -include -Xclang /workspaces/cmake-general/tests/project/build/examples/hello-world/CMakeFiles/example-hello-world.dir/cmake_pch.hxx -x c++-header ..

Read more

Is it possible to get all fields that are defined explicitly and implicitly (inherited from parent classes) apart from iterating over a CXXRecordDecl’s bases recursively and evaluating along the way, using C++’s inheritance and access rules, whether a given member of a base class is accessible in the class I started searching for members? This ..

Read more

I have an LLVM based JIT compiler and am having trouble optimizing functions with the pattern func1(func2(x)). The issue can be demonstrated with the following example: #include <cmath> extern "C" double transform_4326_900913_x(const double x) { return x * 111319.490778; } extern "C" double transform_4326_900913_y(const double y) { return 6378136.99911 * tan(log(.00872664626 * y + .785398163397)); ..

Read more

Clang-tidy checks are divided into two stages: (1) matching – define a matcher which will hopefully find something that the check function can work with (2) checking – taking the match and doing whatever you want to achieve In the second stage, however, you don’t have the easy and relatively straight-forward declaration style of the ..

Read more

I’ve been trying to include the llvm library in my cpp files, but it isn’t working. ./nodes.h:11:10: fatal error: ‘llvm/IR/BasicBlock.h’ file not found #include "llvm/IR/BasicBlock.h" ^~~~~~~~~~~~~~~~~~~~~~ This is the relevant part of the nodes.h file: #ifndef T_NODES_H #define T_NODES_H #include <memory> #include <vector> #include <string> #include "llvm/IR/BasicBlock.h" #include "llvm/IR/Constants.h" #include "llvm/IR/DerivedTypes.h" #include "llvm/IR/Function.h" #include "llvm/IR/IRBuilder.h" ..

Read more