[PATCH] D15844: [ADT] Add an abstraction for embedding an integer within a pointer-like type.

Jordan Rose via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 8 09:41:41 PST 2016


jordan_rose added a subscriber: jordan_rose.
jordan_rose added a comment.

Ha, I wrote the same thing, but it's only used for Swift-Clang's "API notes" feature that hasn't been upstreamed, so it's still sitting in our repository. I called it Fixnum <https://github.com/apple/swift-llvm/blob/upstream-with-swift/include/llvm/ADT/Fixnum.h>. Sorry about that.

Differences:

- when stored outside a PointerIntPair, it uses the smallest storage possible
- safe upcasting is implicitly allowed
- assignment/construction between bit widths is permitted but checked
- I hadn't written special DenseMapInfo (because we never used it in a DenseMap)

I'm fine switching ours over to yours, or you taking ours as is. I really thought we had tests for it too but I can't find them.


http://reviews.llvm.org/D15844





More information about the llvm-commits mailing list