[PATCH] libclang.dll compat with Borland compilers

Reid Kleckner rnk at google.com
Wed Oct 15 16:10:51 PDT 2014


IIRC GCC and MSVC also disagree about how to pass and return structures by
value. Maybe libclang should not be returning structures by value instead?

On Wed, Oct 15, 2014 at 3:23 PM, Stephen Fewer <
stephen_fewer at harmonysecurity.com> wrote:

> Hi,
>
> This patch adds compatibility for using libclang.dll built with MSVC in
> Borland compiled code (C++ Builder). The 32bit Borland compiler returns
> structures > 4 bytes and < 9 bytes using a different ABI than MSVC
> emits, so to workaround this you must use a Borland specific keyword
> __msreturn as the calling convention [0].
>
> The patch adds a define CINDEX_CC to
> .\tools\clang\include\clang-c\Platform.h, when using a Borland compiler,
> in order to specify __msreturn and then applies CINDEX_CC to all
> functions in the clang-c headers. Should have no effect for any other
> compiler.
>
> Regards,
>
> - Stephen.
>
> [0] http://docwiki.embarcadero.com/RADStudio/XE7/en/Msreturn
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20141015/6fa3f50b/attachment.html>


More information about the cfe-commits mailing list