Skip to content

Commit ce2f5da

Browse files
committed
Some fix.
1 parent 3c8f4bc commit ce2f5da

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

include/Test/Tester.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ struct Tester {
3535
auto command = std::format("clang++ {} {} -fms-extensions", standard, src_path);
3636

3737
database.update_command("fake", src_path, command);
38+
params.kind = CompilationUnit::Content;
3839
params.arguments = database.get_command(src_path, true, true).arguments;
3940

4041
for(auto& [file, source]: sources.all_files) {
@@ -65,6 +66,7 @@ struct Tester {
6566
auto command = std::format("clang++ {} {} -fms-extensions", standard, src_path);
6667

6768
database.update_command("fake", src_path, command);
69+
params.kind = CompilationUnit::Preamble;
6870
params.arguments = database.get_command(src_path, true, true).arguments;
6971

7072
auto path = fs::createTemporaryFile("clice", "pch");
@@ -100,6 +102,7 @@ struct Tester {
100102

101103
/// Build AST
102104
params.output_file.clear();
105+
params.kind = CompilationUnit::Content;
103106
params.pch = {info.path, info.preamble.size()};
104107
for(auto& [file, source]: sources.all_files) {
105108
if(file == src_path) {

src/Compiler/Compilation.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,6 @@ class ProxyAction final : public clang::WrapperFrontendAction {
8484
using clang::WrapperFrontendAction::EndSourceFile;
8585

8686
private:
87-
/// Whether we need to collect top level declarations.
88-
bool need_collect;
8987
std::vector<clang::Decl*>* top_level_decls;
9088
std::shared_ptr<std::atomic_bool> stop;
9189
};
@@ -271,7 +269,6 @@ CompilationResult preprocess(CompilationParams& params) {
271269
}
272270

273271
CompilationResult compile(CompilationParams& params) {
274-
const bool collect_top_level_decls = params.output_file.empty();
275272
return run_clang<clang::SyntaxOnlyAction>(params);
276273
}
277274

src/Server/Indexer.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ async::Task<> Indexer::index(CompilationUnit& unit) {
4747

4848
async::Task<> Indexer::index(llvm::StringRef file) {
4949
CompilationParams params;
50+
params.kind = CompilationUnit::Indexing;
5051
params.arguments = database.get_command(file).arguments;
5152

5253
auto AST = co_await async::submit([&] { return compile(params); });

0 commit comments

Comments
 (0)