<div dir="ltr">Hello all,<div><br></div><div>LLVM's API varies a lot from version to version. Take a example, header <span style="font-family:arial,sans-serif;font-size:14px">llvm/Target/</span><span style="font-family:arial,sans-serif;font-size:14px">TargetData.h changed to </span><span style="font-family:arial,sans-serif;font-size:14px">llvm/</span><span style="font-family:arial,sans-serif;font-size:14px">DataLayout.h from LLVM version 3.1 to version 3.2. This sliced the program just like:</span></div>
<div><span style="font-family:arial,sans-serif;font-size:14px"><br></span></div><div><font face="arial, sans-serif"><span style="font-size:14px">#if defined(LLVM_V31)</span></font></div><div><span style="font-family:arial,sans-serif;font-size:14px"> #include llvm/Target/</span><span style="font-family:arial,sans-serif;font-size:14px">TargetData.h </span><font face="arial, sans-serif"><span style="font-size:14px"><br>
</span></font></div><div><font face="arial, sans-serif"><span style="font-size:14px">#elif defined(LLVM_V32)</span></font></div><div><font face="arial, sans-serif"><span style="font-size:14px"> #include </span></font><span style="font-family:arial,sans-serif;font-size:14px">llvm/</span><span style="font-family:arial,sans-serif;font-size:14px">DataLayout.h</span></div>
<div><span style="font-family:arial,sans-serif;font-size:14px">#else</span></div><div><span style="font-family:arial,sans-serif;font-size:14px"> #error NEED HEADER</span></div><div><span style="font-family:arial,sans-serif;font-size:14px"><br>
</span></div><div><span style="font-family:arial,sans-serif;font-size:14px">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?</span></div>
<div><span style="font-family:arial,sans-serif;font-size:14px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:14px">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 </span><span style="font-family:arial,sans-serif;font-size:14px">AC_CHECK_HEADER to detect whether the header exist during configuration?</span></div>
<div><span style="font-family:arial,sans-serif;font-size:14px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:14px">Thanks a lot</span></div></div>