=?utf-8?q?F=C3=A9lix?= Cloutier <fclout...@apple.com>,
=?utf-8?q?F=C3=A9lix?= Cloutier <fclout...@apple.com>,
=?utf-8?q?F=C3=A9lix?= Cloutier <fclout...@apple.com>,
=?utf-8?q?F=C3=A9lix?= Cloutier <fclout...@apple.com>,
=?utf-8?q?F=C3=A9lix?= Cloutier <fclout...@apple.com>,
=?utf-8?q?F=C3=A9lix?= Cloutier <fclout...@apple.com>,
=?utf-8?q?F=C3=A9lix?= Cloutier <fclout...@apple.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/135...@github.com>


================
@@ -791,10 +791,26 @@ class Expr : public ValueStmt {
                                  const Expr *PtrExpression, ASTContext &Ctx,
                                  EvalResult &Status) const;
 
-  /// If the current Expr can be evaluated to a pointer to a null-terminated
-  /// constant string, return the constant string (without the terminating
-  /// null).
-  std::optional<std::string> tryEvaluateString(ASTContext &Ctx) const;
+  class StringEvalResult {
+    std::string Storage;
+    const StringLiteral *SL;
+    uint64_t Offset;
+
+  public:
+    StringEvalResult(std::string Contents);
+    StringEvalResult(const StringLiteral *SL, uint64_t Offset);
+
+    llvm::StringRef getString() const;
+    bool getStringLiteral(const StringLiteral *&SL, uint64_t &Offset) const;
+  };
----------------
cor3ntin wrote:

Could that just an aggregate, that we could use with structured binding?

https://github.com/llvm/llvm-project/pull/135864
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to