[PATCH] D67308: [clang][DependencyFileGenerator] Fix missing -MT option handling

Jan Korous via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 6 17:59:52 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL371279: [clang][DependencyFileGenerator] Fix missing -MT option handling (authored by jkorous, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D67308?vs=219199&id=219210#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D67308/new/

https://reviews.llvm.org/D67308

Files:
  cfe/trunk/lib/Frontend/CompilerInvocation.cpp
  cfe/trunk/lib/Frontend/DependencyFile.cpp


Index: cfe/trunk/lib/Frontend/DependencyFile.cpp
===================================================================
--- cfe/trunk/lib/Frontend/DependencyFile.cpp
+++ cfe/trunk/lib/Frontend/DependencyFile.cpp
@@ -192,11 +192,6 @@
 }
 
 void DependencyFileGenerator::attachToPreprocessor(Preprocessor &PP) {
-  if (Targets.empty()) {
-    PP.getDiagnostics().Report(diag::err_fe_dependency_file_requires_MT);
-    return;
-  }
-
   // Disable the "file not found" diagnostic if the -MG option was given.
   if (AddMissingHeaderDeps)
     PP.SetSuppressIncludeNotFoundError(true);
Index: cfe/trunk/lib/Frontend/CompilerInvocation.cpp
===================================================================
--- cfe/trunk/lib/Frontend/CompilerInvocation.cpp
+++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp
@@ -3406,6 +3406,11 @@
   Success &= ParseAnalyzerArgs(*Res.getAnalyzerOpts(), Args, Diags);
   Success &= ParseMigratorArgs(Res.getMigratorOpts(), Args);
   ParseDependencyOutputArgs(Res.getDependencyOutputOpts(), Args);
+  if (!Res.getDependencyOutputOpts().OutputFile.empty() &&
+      Res.getDependencyOutputOpts().Targets.empty()) {
+    Diags.Report(diag::err_fe_dependency_file_requires_MT);
+    Success = false;
+  }
   Success &=
       ParseDiagnosticArgs(Res.getDiagnosticOpts(), Args, &Diags,
                           false /*DefaultDiagColor*/, false /*DefaultShowOpt*/);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67308.219210.patch
Type: text/x-patch
Size: 1388 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190907/414a882f/attachment.bin>


More information about the llvm-commits mailing list