Hello all,
LLVM’s API varies a lot from version to version. Take a example, header llvm/Target/TargetData.h changed to llvm/DataLayout.h from LLVM version 3.1 to version 3.2. This sliced the program just like:
#if defined(LLVM_V31)
#include llvm/Target/TargetData.h
#elif defined(LLVM_V32)
#include llvm/DataLayout.h
#else
#error NEED HEADER
The code is in a mess if I want to support previous LLVM version. I am wondering how do you support different LLVM versions and keep the code clean as well?
On the other hand, consider the example above. Do you usually check for LLVM version (ex. LLVM_V31, LLVM_V32) or check for feature instead, which use m4 AC_CHECK_HEADER to detect whether the header exist during configuration?
Thanks a lot