Lines Matching defs:Clang

56 void createMissingComponents(CompilerInstance &Clang) {
57 if (!Clang.hasDiagnostics())
58 Clang.createDiagnostics(*llvm::vfs::getRealFileSystem());
59 if (!Clang.hasFileManager())
60 Clang.createFileManager();
61 if (!Clang.hasSourceManager())
62 Clang.createSourceManager(Clang.getFileManager());
63 if (!Clang.hasTarget())
64 Clang.createTarget();
65 if (!Clang.hasPreprocessor())
66 Clang.createPreprocessor(TU_Complete);
67 if (!Clang.hasASTConsumer())
68 Clang.setASTConsumer(std::make_unique<ASTConsumer>());
69 if (!Clang.hasASTContext())
70 Clang.createASTContext();
71 if (!Clang.hasSema())
72 Clang.createSema(TU_Complete, /*CodeCompleteConsumer=*/nullptr);
78 Clang = std::make_unique<CompilerInstance>(
83 llvm::make_scope_exit([&] { createMissingComponents(*Clang); });
102 Clang->createDiagnostics(*VFS, new StoreDiagnostics(Diagnostics, !ErrorOK));
112 Clang->setInvocation(std::make_unique<CompilerInvocation>());
113 if (!CompilerInvocation::CreateFromArgs(Clang->getInvocation(), Argv,
114 Clang->getDiagnostics(), "clang")) {
118 assert(!Clang->getInvocation().getFrontendOpts().DisableFree);
120 Clang->createFileManager(VFS);
124 EXPECT_TRUE(Clang->createTarget());
127 const FrontendInputFile &Main = Clang->getFrontendOpts().Inputs.front();
128 if (!Action->BeginSourceFile(*Clang, Main)) {
138 Clang->getPreprocessor().EndSourceFile();
140 Clang->getDiagnosticClient().EndSourceFile();
141 Clang->getDiagnostics().setClient(new DiagnosticConsumer(),
149 auto PP = Clang->getPreprocessorPtr(); // Keep PP alive for now.
150 Clang->setPreprocessor(nullptr); // Detach so we don't send EOF twice.
155 Clang.reset();
162 Clang = std::move(M.Clang);