diff options
author | Sean Silva <silvas@purdue.edu> | 2013-01-06 07:49:41 +0000 |
---|---|---|
committer | Sean Silva <silvas@purdue.edu> | 2013-01-06 07:49:41 +0000 |
commit | aa73d02032e0f3265d97716c0f9def3a91356c62 (patch) | |
tree | 13167918a91995dd75a8f2eca8e098116c4518e0 /clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp | |
parent | f950ce8e38a36220409f981bf769a10a793088c7 (diff) | |
download | llvm-aa73d02032e0f3265d97716c0f9def3a91356c62.zip llvm-aa73d02032e0f3265d97716c0f9def3a91356c62.tar.gz llvm-aa73d02032e0f3265d97716c0f9def3a91356c62.tar.bz2 |
use early returns to simplify and de-nest
llvm-svn: 171654
Diffstat (limited to 'clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp')
-rw-r--r-- | clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp b/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp index 8cc2592..ad8eb04 100644 --- a/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp +++ b/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp @@ -226,16 +226,14 @@ bool clang::ExecuteCompilerInvocation(CompilerInstance *Clang) { #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; } |