45{
47
48 try {
50
51 if (res == cli::cli_flow_t::kExit)
52 return 0;
53
54 if (res == cli::cli_flow_t::kError)
55 return 1;
56
57#if !defined(NDEBUG)
58
59 spdlog::set_error_handler([](const std::string & ) {
60 assert(0 == 1);
61 });
62#endif
63
64 const auto db =
67
68 const auto compilation_database_files = db->getAllFiles();
69
70 std::map<std::string ,
71 std::vector<std::string> >
72 translation_units_map;
73
74
75
76
79 translation_units_map);
80
82
83
84
85 llvm::errs().close();
86 }
87
90 }
93 fmt::println(
94 "ERROR: Failed to load compilation database from {} due to: {}",
96 }
97 else {
98 LOG_ERROR(
"Failed to load compilation database from {} due to: {}",
100 }
101 return 1;
102 }
105 fmt::println(
106 "ERROR: Querying provided compiler driver {} did not provide "
107 "any "
108 "paths, please make sure the path is correct and that your "
109 "compiler is GCC-compatible: {}",
111 }
112 else {
114 "Querying provided compiler driver {} did not provide any "
115 "paths, please make sure the path is correct and that your "
116 "compiler is GCC-compatible: {}",
118 }
119 return 1;
120 }
123 fmt::println(
"ERROR: {}", e.
what());
124 else
126 return 1;
127 }
128 catch (std::exception &e) {
130 fmt::println("ERROR: {}", e.what());
131 else
133 return 1;
134 }
135
136 return 0;
137}