diff options
author | Marshall Clow <mclow@qualcomm.com> | 2012-08-13 18:56:38 +0000 |
---|---|---|
committer | Marshall Clow <mclow@qualcomm.com> | 2012-08-13 18:56:38 +0000 |
commit | 37f7a3326791dd625a4aa9a097b5fad0a757c956 (patch) | |
tree | e36306b632a129931a20fffcffcfe60177f7ec2f | |
parent | a7846852ba8b2b53664a674a41d116e0419d8768 (diff) |
Minor rework of code example for clarity. No functionality change
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161776 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | docs/LibTooling.html | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/docs/LibTooling.html b/docs/LibTooling.html index 560d115489..ed0ad45e4e 100644 --- a/docs/LibTooling.html +++ b/docs/LibTooling.html @@ -141,13 +141,11 @@ int main(int argc, const char **argv) { cl::ParseCommandLineOptions(argc, argv); if (!Compilations) { std::string ErrorMessage; - if (!BuildPath.empty()) { - Compilations.reset( - CompilationDatabase::autoDetectFromDirectory(BuildPath, ErrorMessage)); - } else { - Compilations.reset(CompilationDatabase::autoDetectFromSource( - SourcePaths[0], ErrorMessage)); - } + Compilations.reset( + !BuildPath.empty() ? + CompilationDatabase::autoDetectFromDirectory(BuildPath, ErrorMessage) : + CompilationDatabase::autoDetectFromSource(SourcePaths[0], ErrorMessage) + ); if (!Compilations) llvm::report_fatal_error(ErrorMessage); } |