================
@@ -241,18 +243,13 @@ int main(int argc, const char **argv) {
         break;
       }
       if (Input == R"(%undo)") {
-        if (auto Err = Interp->Undo()) {
+        if (auto Err = Interp->Undo())
           llvm::logAllUnhandledErrors(std::move(Err), llvm::errs(), "error: ");
-          HasError = true;
-        }
       } else if (Input.rfind("%lib ", 0) == 0) {
-        if (auto Err = Interp->LoadDynamicLibrary(Input.data() + 5)) {
+        if (auto Err = Interp->LoadDynamicLibrary(Input.data() + 5))
           llvm::logAllUnhandledErrors(std::move(Err), llvm::errs(), "error: ");
-          HasError = true;
----------------
vgvassilev wrote:

The idea is that when you use interactive mode and it recovers from errors 
properly to return success as exit code. However, for the when run it in non 
interactive mode people might use clang-repl as a calculator eg `clang-repl 
"printf(...)"` and can be put in scripts. There we want to get exit code 1 if 
it miscompiled something.

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

Reply via email to