r348125 - [Analyzer] Actually check for -model-path being a directory

Ilya Biryukov via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 3 03:34:08 PST 2018


Author: ibiryukov
Date: Mon Dec  3 03:34:08 2018
New Revision: 348125

URL: http://llvm.org/viewvc/llvm-project?rev=348125&view=rev
Log:
[Analyzer] Actually check for -model-path being a directory

The original patch (r348038) clearly contained a typo and checked
for '-ctu-dir' twice.

Modified:
    cfe/trunk/lib/Frontend/CompilerInvocation.cpp

Modified: cfe/trunk/lib/Frontend/CompilerInvocation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=348125&r1=348124&r2=348125&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/CompilerInvocation.cpp (original)
+++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp Mon Dec  3 03:34:08 2018
@@ -456,12 +456,13 @@ static void parseAnalyzerConfigs(Analyze
     return;
 
   if (!AnOpts.CTUDir.empty() && !llvm::sys::fs::is_directory(AnOpts.CTUDir))
-    Diags->Report(diag::err_analyzer_config_invalid_input)
-      << "ctu-dir" << "a filename";
+    Diags->Report(diag::err_analyzer_config_invalid_input) << "ctu-dir"
+                                                           << "a filename";
 
-  if (!AnOpts.CTUDir.empty() && !llvm::sys::fs::is_directory(AnOpts.CTUDir))
-    Diags->Report(diag::err_analyzer_config_invalid_input)
-      << "model-path" << "a filename";
+  if (!AnOpts.ModelPath.empty() &&
+      !llvm::sys::fs::is_directory(AnOpts.ModelPath))
+    Diags->Report(diag::err_analyzer_config_invalid_input) << "model-path"
+                                                           << "a filename";
 }
 
 static bool ParseMigratorArgs(MigratorOptions &Opts, ArgList &Args) {




More information about the cfe-commits mailing list