Page MenuHomePhabricator

[CMake] Remove unused variable LLDB_TEST_CXX_COMPILER
ClosedPublic

Authored by JDevlieghere on Thu, Oct 24, 12:55 PM.

Details

Summary

CMake allows you to set a custom CXX compiler for the API test suite.
However, this variable is never used, because dotest uses the same
compiler to build C and CXX sources.

I'm not sure if this variable was added with the intention of supporting
a different compiler or if this is just a remnant of old functionality.
Given that this hasn't been working for a while, I assume it's safe to
remove.

Diff Detail

Event Timeline

JDevlieghere created this revision.Thu, Oct 24, 12:55 PM
Herald added a project: Restricted Project. · View Herald TranscriptThu, Oct 24, 12:55 PM

I did a bit of digging and there's more context in https://reviews.llvm.org/D39215. It sounds to me like the motivation for the two variables isn't relevant anymore, so I still think removing the CXX variant is desirable.

labath accepted this revision.Thu, Oct 24, 2:02 PM

Overall, I think it would be better to just pass the c++ compiler instead of having dotest try to guess it from the c compiler name. But, it's easy to reintroduce this option once we get to that point.

This revision is now accepted and ready to land.Thu, Oct 24, 2:02 PM

I thought this option was so that you could specify which compilers to use to build from a cache or command line? I don't think you just want to set LLDB_TEST_COMPILER to clang since clang++ is what is used to compile C++ code. Maybe I'm mis-remembering or mistaken here.

I thought this option was so that you could specify which compilers to use to build from a cache or command line? I don't think you just want to set LLDB_TEST_COMPILER to clang since clang++ is what is used to compile C++ code. Maybe I'm mis-remembering or mistaken here.

Yes, that's indeed the point. However, dotest expects you to set the C compiler and then infers the C++ compiler from it, which for clang is just appending ++ at the end. I'm sure it must do something sensible for gcc as well, as I believe people are running the test suite with that compiler.

xiaobai accepted this revision.Thu, Oct 24, 2:40 PM

I thought this option was so that you could specify which compilers to use to build from a cache or command line? I don't think you just want to set LLDB_TEST_COMPILER to clang since clang++ is what is used to compile C++ code. Maybe I'm mis-remembering or mistaken here.

Yes, that's indeed the point. However, dotest expects you to set the C compiler and then infers the C++ compiler from it, which for clang is just appending ++ at the end. I'm sure it must do something sensible for gcc as well, as I believe people are running the test suite with that compiler.

Right, I see. I'm not sure I like the inference in dotest, and I assume cl is left untouched here (if it's even possible to use cl as the compiler on windows for tests). I do like the simplification to the build though so ship it!

This revision was automatically updated to reflect the committed changes.