template<> struct IsResultPtrLowBitFree<1> { static const bool value = true;};
template<> struct IsResultPtrLowBitFree<3> { static const bool value = true;};
template<> struct IsResultPtrLowBitFree<4> { static const bool value = true;};
-//template<> struct IsResultPtrLowBitFree<5> { static const bool value = true;};
+ template<> struct IsResultPtrLowBitFree<5> { static const bool value = true;};
/// Action - As the parser reads the input file and recognizes the productions
/// of the grammar, it invokes methods on this class to turn the parsed input
PtrWithInvalid = reinterpret_cast<uintptr_t>(VP);
assert((PtrWithInvalid & 0x01) == 0 && "Badly aligned pointer");
}
-
+
+ ActionResult(PtrTy V) {
+ void *VP = PtrTraits::getAsVoidPointer(V);
+ PtrWithInvalid = reinterpret_cast<uintptr_t>(VP);
+ assert((PtrWithInvalid & 0x01) == 0 && "Badly aligned pointer");
+ }
+
ActionResult(const DiagnosticBuilder &) : PtrWithInvalid(0x01) { }
PtrTy get() const {
bool isInvalid() const { return PtrWithInvalid & 0x01; }
- const ActionResult &operator=(void *RHS) {
- PtrWithInvalid = reinterpret_cast<uintptr_t>(RHS);
+ const ActionResult &operator=(PtrTy RHS) {
+ void *VP = PtrTraits::getAsVoidPointer(RHS);
+ PtrWithInvalid = reinterpret_cast<uintptr_t>(VP);
assert((PtrWithInvalid & 0x01) == 0 && "Badly aligned pointer");
return *this;
}