[cfe-commits] r171654 - /cfe/trunk/lib/FrontendTool/ExecuteCompilerInvocation.cpp

Sean Silva silvas at purdue.edu
Sat Jan 5 23:49:41 PST 2013


Author: silvas
Date: Sun Jan  6 01:49:41 2013
New Revision: 171654

URL: http://llvm.org/viewvc/llvm-project?rev=171654&view=rev
Log:
use early returns to simplify and de-nest

Modified:
    cfe/trunk/lib/FrontendTool/ExecuteCompilerInvocation.cpp

Modified: cfe/trunk/lib/FrontendTool/ExecuteCompilerInvocation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/FrontendTool/ExecuteCompilerInvocation.cpp?rev=171654&r1=171653&r2=171654&view=diff
==============================================================================
--- cfe/trunk/lib/FrontendTool/ExecuteCompilerInvocation.cpp (original)
+++ cfe/trunk/lib/FrontendTool/ExecuteCompilerInvocation.cpp Sun Jan  6 01:49:41 2013
@@ -226,16 +226,14 @@
 #endif
 
   // If there were errors in processing arguments, don't do anything else.
-  bool Success = false;
-  if (!Clang->getDiagnostics().hasErrorOccurred()) {
-    // Create and execute the frontend action.
-    OwningPtr<FrontendAction> Act(CreateFrontendAction(*Clang));
-    if (Act) {
-      Success = Clang->ExecuteAction(*Act);
-      if (Clang->getFrontendOpts().DisableFree)
-        Act.take();
-    }
-  }
-
+  if (Clang->getDiagnostics().hasErrorOccurred())
+    return false;
+  // Create and execute the frontend action.
+  OwningPtr<FrontendAction> Act(CreateFrontendAction(*Clang));
+  if (!Act)
+    return false;
+  bool Success = Clang->ExecuteAction(*Act);
+  if (Clang->getFrontendOpts().DisableFree)
+    Act.take();
   return Success;
 }





More information about the cfe-commits mailing list