Commit Graph

5 Commits

Author SHA1 Message Date
practicalswift
1339b5403b Consistent use of header comment format.
Correct format:
//===--- Name of file - Description ----------------------------*- Lang -*-===//
2016-01-04 13:26:31 +01:00
Zach Panzarino
e3a4147ac9 Update copyright date 2015-12-31 23:28:40 +00:00
David Farler
3b9f1bd77f FlaggedPointer should only compose with itself
<rdar://problem/19104060>

LLVM's PointerIntPair always picks the highest bits of the available low
order free bits but NumLowBitsAvailable is the number of *lowest* bits
available from the LSB. This could cause problems with overwriting when
putting a FlaggedPointer inside a PointerIntPair. Just don't allow it.

Add a static assert to make sure there are enough bits to support the
number of nested FlaggedPointers.

Add a helper constexpr min function which isn't available until C++14.

Swift SVN r23597
2014-12-01 20:05:44 +00:00
David Farler
f92112256d Wrong comment header for FlaggedPointer.h
Swift SVN r23558
2014-11-22 22:03:32 +00:00
David Farler
3c4428dd78 Emit unique metadata for functions with inout
References to functions that take inout parameters crash the compiler
because InOutType isn't a "real" type in itself and has no special type
metadata to emit. It merely further qualifies the function's input
types.

For example, we would like to have a unique entry in the cache for:

var f: (T, T) -> ()

and

var f2: (inout T, T) -> ()

For each argument type metadata pointer in the function's input, take
advantage of pointer alignment and mark the lowest bit if it is inout.
Since the metadata cache uses pointers to create the key, this creates a
unique entry while still being able to extract the actual pointer.

This fixes <rdar://problem/17655125>, and a couple of other similar
crashes.

Swift SVN r23557
2014-11-22 22:01:23 +00:00