15
15
#include " clang/Tooling/DependencyScanning/DependencyScanningTool.h"
16
16
#include " clang/Tooling/DependencyScanning/DependencyScanningWorker.h"
17
17
#include " clang/Tooling/JSONCompilationDatabase.h"
18
+ #include " clang/Tooling/Tooling.h"
18
19
#include " llvm/ADT/STLExtras.h"
19
20
#include " llvm/ADT/Twine.h"
20
21
#include " llvm/Support/CommandLine.h"
24
25
#include " llvm/Support/LLVMDriver.h"
25
26
#include " llvm/Support/Program.h"
26
27
#include " llvm/Support/Signals.h"
28
+ #include " llvm/Support/TargetSelect.h"
27
29
#include " llvm/Support/ThreadPool.h"
28
30
#include " llvm/Support/Threading.h"
29
31
#include " llvm/Support/Timer.h"
@@ -795,6 +797,7 @@ getCompilationDatabase(int argc, char **argv, std::string &ErrorMessage) {
795
797
}
796
798
797
799
int clang_scan_deps_main (int argc, char **argv, const llvm::ToolContext &) {
800
+ llvm::InitializeAllTargetInfos ();
798
801
std::string ErrorMessage;
799
802
std::unique_ptr<tooling::CompilationDatabase> Compilations =
800
803
getCompilationDatabase (argc, argv, ErrorMessage);
@@ -810,6 +813,8 @@ int clang_scan_deps_main(int argc, char **argv, const llvm::ToolContext &) {
810
813
Compilations = expandResponseFiles (std::move (Compilations),
811
814
llvm::vfs::getRealFileSystem ());
812
815
816
+ Compilations = inferTargetAndDriverMode (std::move (Compilations));
817
+
813
818
// The command options are rewritten to run Clang in preprocessor only mode.
814
819
auto AdjustingCompilations =
815
820
std::make_unique<tooling::ArgumentsAdjustingCompilations>(
0 commit comments