LLVM - when to do a clean install?

Something that has tripped me up numerous times in the past is the need to do a clean re-install of LLVM when certain things change. For example, a header file gets moved from one subdirectory to another - since the “make install” script doesn’t remove anything, the old header will still exist in the include directory at its old location. Programs which compile against LLVM that attempt to load the include file from the old location may actually compile, but then get mysterious runtime errors. Similar problems can occur with static library files.

I’ve learned to always install LLVM with a custom prefix, to make it easy to blow away the old copy - otherwise uninstallation would be difficult, especially for the tool programs that would otherwise get mixed in with all the other programs that are installed in $PREFIX/bin. But even with that precaution, I sometimes don’t realize that a clean build and install is needed.

I don’t know if there’s a good solution to this problem. For header files, I suppose one could leave a tombstone header file with a #error directive in it, for a limited period of time - but how long? There are lots of LLVM users out there that don’t update very frequently.

I’d be interested in knowing if there’s a better workflow that I could be using to avoid this problem.