diff options
Diffstat (limited to 'clang/lib/AST/ByteCode/Pointer.cpp')
-rw-r--r-- | clang/lib/AST/ByteCode/Pointer.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/lib/AST/ByteCode/Pointer.cpp b/clang/lib/AST/ByteCode/Pointer.cpp index 6c2566b..50453c7 100644 --- a/clang/lib/AST/ByteCode/Pointer.cpp +++ b/clang/lib/AST/ByteCode/Pointer.cpp @@ -571,6 +571,17 @@ bool Pointer::pointsToLiteral() const { return E && !isa<MaterializeTemporaryExpr, StringLiteral>(E); } +bool Pointer::pointsToStringLiteral() const { + if (isZero() || !isBlockPointer()) + return false; + + if (block()->isDynamic()) + return false; + + const Expr *E = block()->getDescriptor()->asExpr(); + return E && isa<StringLiteral>(E); +} + std::optional<std::pair<Pointer, Pointer>> Pointer::computeSplitPoint(const Pointer &A, const Pointer &B) { if (!A.isBlockPointer() || !B.isBlockPointer()) |