Lines Matching refs:Clang

54 void createMissingComponents(CompilerInstance &Clang) {
55 if (!Clang.hasDiagnostics())
56 Clang.createDiagnostics();
57 if (!Clang.hasFileManager())
58 Clang.createFileManager();
59 if (!Clang.hasSourceManager())
60 Clang.createSourceManager(Clang.getFileManager());
61 if (!Clang.hasTarget())
62 Clang.createTarget();
63 if (!Clang.hasPreprocessor())
64 Clang.createPreprocessor(TU_Complete);
65 if (!Clang.hasASTConsumer())
66 Clang.setASTConsumer(std::make_unique<ASTConsumer>());
67 if (!Clang.hasASTContext())
68 Clang.createASTContext();
69 if (!Clang.hasSema())
70 Clang.createSema(TU_Complete, /*CodeCompleteConsumer=*/nullptr);
76 Clang = std::make_unique<CompilerInstance>(
81 llvm::make_scope_exit([&] { createMissingComponents(*Clang); });
85 Clang->createDiagnostics(new StoreDiagnostics(Diagnostics, !ErrorOK));
96 Clang->setInvocation(std::make_unique<CompilerInvocation>());
97 if (!CompilerInvocation::CreateFromArgs(Clang->getInvocation(), Argv,
98 Clang->getDiagnostics(), "clang")) {
102 assert(!Clang->getInvocation().getFrontendOpts().DisableFree);
112 Clang->createFileManager(VFS);
116 EXPECT_TRUE(Clang->createTarget());
119 const FrontendInputFile &Main = Clang->getFrontendOpts().Inputs.front();
120 if (!Action->BeginSourceFile(*Clang, Main)) {
130 Clang->getPreprocessor().EndSourceFile();
132 Clang->getDiagnosticClient().EndSourceFile();
133 Clang->getDiagnostics().setClient(new DiagnosticConsumer(),
141 auto PP = Clang->getPreprocessorPtr(); // Keep PP alive for now.
142 Clang->setPreprocessor(nullptr); // Detach so we don't send EOF twice.
147 Clang.reset();
154 Clang = std::move(M.Clang);