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

Shoaib Meenai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 4 23:01:49 PST 2017


smeenai 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:
> 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.


https://reviews.llvm.org/D23378





More information about the llvm-commits mailing list