File tree Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -91,7 +91,8 @@ Expected<FileCache> llvm::localCache(const Twine &CacheNameRef,
9191
9292 Error commit () override {
9393 if (Committed)
94- return Error::success ();
94+ return createStringError (std::errc::invalid_argument,
95+ Twine (" CacheStream already committed." ));
9596 Committed = true ;
9697
9798 // Make sure the stream is closed before committing it.
@@ -145,15 +146,8 @@ Expected<FileCache> llvm::localCache(const Twine &CacheNameRef,
145146 }
146147
147148 ~CacheStream () {
148- // In Debug builds, try to track down places where commit() was not
149- // called before destruction.
150- assert (Committed);
151- // In Release builds, fall back to the previous behaviour of committing
152- // during destruction and reporting errors with report_fatal_error.
153- if (Committed)
154- return ;
155- if (Error Err = commit ())
156- report_fatal_error (Twine (toString (std::move (Err))));
149+ if (!Committed)
150+ report_fatal_error (Twine (" CacheStream was not committed.\n " );
157151 }
158152 };
159153
You can’t perform that action at this time.
0 commit comments