Reputation: 587
I'm exploring the LLVM/Clang source code and interested in understanding how LLVM distinguishes between clang and clang++ commands, knowing that clang++ is often considered an alias of clang. Which files or functions in the llvm-project/clang directory handle this analysis? Any guidance on where to look for this specific logic would be appreciated.
Thank you!
Upvotes: 0
Views: 27
Reputation: 587
I finally found it in ToolChain.cpp
static const DriverSuffix DriverSuffixes[] = {
{"clang", nullptr},
{"clang++", "--driver-mode=g++"},
{"clang-c++", "--driver-mode=g++"},
{"clang-cc", nullptr},
{"clang-cpp", "--driver-mode=cpp"},
{"clang-g++", "--driver-mode=g++"},
{"clang-gcc", nullptr},
{"clang-cl", "--driver-mode=cl"},
{"cc", nullptr},
{"cpp", "--driver-mode=cpp"},
{"cl", "--driver-mode=cl"},
{"++", "--driver-mode=g++"},
{"flang", "--driver-mode=flang"},
{"clang-dxc", "--driver-mode=dxc"},
};
Upvotes: 0