aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/AST/ByteCode/MemberPointer.h
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/AST/ByteCode/MemberPointer.h')
-rw-r--r--clang/lib/AST/ByteCode/MemberPointer.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/AST/ByteCode/MemberPointer.h b/clang/lib/AST/ByteCode/MemberPointer.h
index b17ce25..8dd75ca 100644
--- a/clang/lib/AST/ByteCode/MemberPointer.h
+++ b/clang/lib/AST/ByteCode/MemberPointer.h
@@ -51,6 +51,12 @@ public:
FunctionPointer toFunctionPointer(const Context &Ctx) const;
+ bool isBaseCastPossible() const {
+ if (PtrOffset < 0)
+ return true;
+ return static_cast<uint64_t>(PtrOffset) <= Base.getByteOffset();
+ }
+
Pointer getBase() const {
if (PtrOffset < 0)
return Base.atField(-PtrOffset);