MCPcopy Create free account
hub / github.com/KDAB/codebrowser / BrowserAction

Class BrowserAction

generator/main.cpp:203–229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

201};
202
203class BrowserAction : public clang::ASTFrontendAction {
204 static std::set<std::string> processed;
205 DatabaseType WasInDatabase;
206protected:
207#if CLANG_VERSION_MAJOR == 3 && CLANG_VERSION_MINOR <= 5
208 virtual clang::ASTConsumer *
209#else
210 virtual std::unique_ptr<clang::ASTConsumer>
211#endif
212 CreateASTConsumer(clang::CompilerInstance &CI,
213 llvm::StringRef InFile) override {
214 if (processed.count(InFile.str())) {
215 std::cerr << "Skipping already processed " << InFile.str()<< std::endl;
216 return nullptr;
217 }
218 processed.insert(InFile.str());
219
220 CI.getFrontendOpts().SkipFunctionBodies = true;
221
222 return maybe_unique(new BrowserASTConsumer(CI, *projectManager, WasInDatabase));
223 }
224
225public:
226 BrowserAction(DatabaseType WasInDatabase = DatabaseType::InDatabase) : WasInDatabase(WasInDatabase) {}
227 virtual bool hasCodeCompletionSupport() const override { return true; }
228 static ProjectManager *projectManager;
229};
230
231
232std::set<std::string> BrowserAction::processed;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected