We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f64f698 commit 452436bCopy full SHA for 452436b
source/AST/AbsoluteCompilationDatabase.cpp
@@ -27,6 +27,16 @@
27
namespace clang {
28
namespace mrdox {
29
30
+static
31
+bool
32
+isCXXSrcFile(
33
+ std::string_view filename)
34
+{
35
+ return driver::types::isCXX(
36
+ driver::types::lookupTypeForExtension(
37
+ llvm::sys::path::extension(filename).drop_front()));
38
+}
39
+
40
template<typename... Opts>
41
static
42
bool
@@ -219,6 +229,10 @@ AbsoluteCompilationDatabase(
219
229
cmd.Filename = static_cast<std::string>(temp);
220
230
}
221
231
232
+ // non-C++ input file; skip
233
+ if(! isCXXSrcFile(cmd.Filename))
234
+ continue;
235
222
236
std::size_t i = AllCommands_.size();
223
237
auto result = IndexByFile_.try_emplace(cmd.Filename, i);
224
238
AllCommands_.emplace_back(std::move(cmd));
0 commit comments