================
@@ -327,6 +327,35 @@ bool Context::evaluateStrlen(State &Parent, const Expr *E, 
uint64_t &Result) {
   return true;
 }
 
+bool Context::tryEvaluateObjectSize(State &Parent, const Expr *E, unsigned 
Kind,
+                                    uint64_t &Result) {
+  assert(Stk.empty());
+  Compiler<EvalEmitter> C(*this, *P, Parent, Stk);
+
+  auto PtrRes = C.interpretAsPointer(E, [&](const Pointer &Ptr) {
+    const Descriptor *DeclDesc = Ptr.getDeclDesc();
+    assert(DeclDesc);
+    QualType T = DeclDesc->getType().getNonReferenceType();
+    if (T->isIncompleteType() || T->isFunctionType() ||
+        !T->isConstantSizeType())
+      return false;
+
+    Pointer P = Ptr;
----------------
tbaederr wrote:

Why this variable?

https://github.com/llvm/llvm-project/pull/179033
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to