- Why is this tool compiler-dependent and not "cross-platform" for compilers? Why didn't the creators of the tool make it compiler-independent from the beginning? Is it related to the special implementation it has or something like that?
Reason is simple. Clang is more modern, fresh and has a better modular architecture. As a result, it is much easier to create tools using Clang modules.
That is why Clang was the first which had an address sanitizer and have more cool sanitizers. And this is why when someone creates a new tool for C++, it starts from Clang.
If I want to take a version of the tool compatible for LLVM and I want to make it compatible with GCC (since I'm working with GCC), what do I have to do for that?
Clang was created since Apple was not happy with GCC. So when it was written, it was supposed to be as much compatible with GCC as possible, since there was lots of code which was verified with GCC.
Since Clang is mature now and provides new own features, there might be small differences with GCC (for example, different bugs in implementations of new C++ standards), but in most common code there shouldn't be any problem.
Include What You Use should work without problems on both compilers. My coworker used it on a large project build with three compilers (Clang, GCC, and Visual Studio) and it worked like a charm.