[PATCH] D23378: Explicitly specify MSVC mangling of iostream globals

Saleem Abdulrasool via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 4 23:09:49 PST 2017


compnerd added inline comments.


================
Comment at: src/iostream.cpp:18-19
+_ALIGNAS_TYPE (istream) _LIBCPP_FUNC_VIS char cin[sizeof(istream)]
+#if defined(_MSC_VER)
+__asm__("?cin at __1@std@@3V?$basic_istream at DU?$char_traits at D@__1 at std@@@12 at A")
+#endif
----------------
EricWF wrote:
> smeenai wrote:
> > EricWF wrote:
> > > Please guard these changes with `#if defined(_LIBCPP_OBJECT_FORMAT_COFF)` instead.
> > I don't think that'll be correct, since it's an ABI issue (Itanium vs Microsoft) not an object format issue. `_MSC_VER` isn't great either though, because for example you can compile with `-target i686-windows-itanium -fmsc-version-1900` and still end up with `_MSC_VER` defined even though you're targeting the Itanium ABI. Idk how to check for the ABI specifically.
> Ah thanks for the correct. I added this was a limitation of the object format.
A similar problem exists with the MS ABI RTTI implementation.

I think it may be high time to introduce a `_LIBCPP_ABI_IA` and `_LIBCPP_ABI_MS`.  Thoughts?


https://reviews.llvm.org/D23378





More information about the llvm-commits mailing list