================
@@ -88,9 +89,10 @@ Expected<FileCache> llvm::localCache(const Twine 
&CacheNameRef,
             AddBuffer(std::move(AddBuffer)), TempFile(std::move(TempFile)),
             ModuleName(ModuleName), Task(Task) {}
 
-      ~CacheStream() {
-        // TODO: Manually commit rather than using non-trivial destructor,
-        // allowing to replace report_fatal_errors with a return Error.
+      Error commit() override {
+        if (Committed)
+          return Error::success();
----------------
kyulee-com wrote:

Intuitively, this doesn't seem correct. Shouldn't we fail if we attempt to 
commit more than once, rather than just returning a success?
Additionally, I'm curious about what happens if we use this CacheStream after a 
commit has been called. I suspect it will fail, but do we provide a proper 
error message in this case? It would be ideal to have a test case to cover 
these scenarios.

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

Reply via email to