<div dir="ltr">Ben Kramer already fixed this, sorry for the trouble. I didn't see the build bot break (likely something else was going on at the time).<div><br></div><div>-Chandler</div><br><div class="gmail_quote"><div dir="ltr">On Sun, Jan 10, 2016 at 5:06 AM Ismail Donmez via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
On Sun, Jan 10, 2016 at 11:40 AM, Chandler Carruth via llvm-commits<br>
<<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:<br>
> Author: chandlerc<br>
> Date: Sun Jan 10 03:40:13 2016<br>
> New Revision: 257284<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=257284&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=257284&view=rev</a><br>
> Log:<br>
> [ADT] Add an abstraction for embedding an integer within a pointer-like<br>
> type.<br>
><br>
> This makes it easy and safe to use a set of flags as one elmenet of<br>
> a tagged union with pointers. There is quite a bit of code that has<br>
> historically done this by casting arbitrary integers to "pointers" and<br>
> assuming that this was safe and reliable. It is neither, and has started<br>
> to rear its head by triggering safety asserts in various abstractions<br>
> like PointerLikeTypeTraits when the integers chosen are invariably poor<br>
> choices for *some* platform and *some* situation. Not to mention the<br>
> (hopefully unlikely) prospect of one of these integers actually getting<br>
> allocated!<br>
><br>
> With this, it will be straightforward to build type safe abstractions<br>
> like this without being error prone. The abstraction itself is also<br>
> remarkably simple thanks to the implicit conversion.<br>
><br>
> This use case and pattern was also independently created by the folks<br>
> working on Swift, and they're going to incrementally add any missing<br>
> functionality they find.<br>
><br>
> Differential Revision: <a href="http://reviews.llvm.org/D15844" rel="noreferrer" target="_blank">http://reviews.llvm.org/D15844</a><br>
><br>
> Added:<br>
>     llvm/trunk/include/llvm/ADT/PointerEmbeddedInt.h<br>
>     llvm/trunk/unittests/ADT/PointerEmbeddedIntTest.cpp<br>
> Modified:<br>
>     llvm/trunk/unittests/ADT/CMakeLists.txt<br>
<br>
VS2015 doesn't like it:<br>
<br>
[2474/2645] Building CXX object<br>
unittests\ADT\CMakeFiles\ADTTests.dir\PointerIntPairTest.cpp.obj<br>
FAILED: C:\PROGRA~2\MICROS~1.0\VC\BIN\amd64\cl.exe   /nologo /TP<br>
-DGTEST_HAS_RTTI=0 -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC<br>
_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS<br>
-D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE<br>
_NO_WARNINGS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS<br>
-D__STDC_LIMIT_MACROS -Iunittests\ADT -I..\unittests\ADT -Iinclud<br>
e -I..\include -I..\utils\unittest\googletest\include /DWIN32<br>
/D_WINDOWS   /W4 -wd4141 -wd4146 -wd4180 -wd4244 -wd4258 -wd4267<br>
 -wd4291 -wd4345 -wd4351 -wd4355 -wd4456 -wd4457 -wd4458 -wd4459<br>
-wd4503 -wd4624 -wd4722 -wd4800 -wd4100 -wd4127 -wd4512 -wd45<br>
05 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703<br>
-wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd<br>
4324 -w14062 -we4238 /Zc:inline /Zc:sizedDealloc- /MT /O2 /Ob2<br>
-UNDEBUG  /EHs-c- /GR- /showIncludes /Founittests\ADT\CMakeFi<br>
les\ADTTests.dir\PointerEmbeddedIntTest.cpp.obj<br>
/Fdunittests\ADT\CMakeFiles\ADTTests.dir\ /FS -c<br>
..\unittests\ADT\PointerEmbed<br>
dedIntTest.cpp<br>
..\include\llvm/ADT/PointerEmbeddedInt.h(33): error C2327:<br>
'llvm::PointerEmbeddedInt<IntT,Bits>::Value': is not a type name, s<br>
tatic, or enumerator<br>
..\include\llvm/ADT/PointerEmbeddedInt.h(64): note: see reference to<br>
class template instantiation 'llvm::PointerEmbeddedInt<In<br>
tT,Bits>' being compiled<br>
..\include\llvm/ADT/PointerEmbeddedInt.h(33): error C2065: 'Value':<br>
undeclared identifier<br>
..\include\llvm/ADT/PointerEmbeddedInt.h(33): error C2327:<br>
'llvm::PointerEmbeddedInt<int,8>::Value': is not a type name, stati<br>
c, or enumerator<br>
..\unittests\ADT\PointerEmbeddedIntTest.cpp(17): note: see reference<br>
to class template instantiation 'llvm::PointerEmbeddedInt<br>
<int,8>' being compiled<br>
..\include\llvm/ADT/PointerEmbeddedInt.h(34): error C2338: Cannot<br>
embed more bits than we have in a pointer!<br>
..\include\llvm/ADT/PointerEmbeddedInt.h(39): error C2327:<br>
'llvm::PointerEmbeddedInt<int,8>::Value': is not a type name, stati<br>
c, or enumerator<br>
..\include\llvm/ADT/PointerEmbeddedInt.h(39): error C2065: 'Value':<br>
undeclared identifier<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div></div>