Lines Matching defs:Clang
56 void createMissingComponents(CompilerInstance &Clang) {
57 if (!Clang.hasDiagnostics())
58 Clang.createDiagnostics();
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); });
87 Clang->createDiagnostics(new StoreDiagnostics(Diagnostics, !ErrorOK));
100 Clang->setInvocation(std::make_unique<CompilerInvocation>());
101 if (!CompilerInvocation::CreateFromArgs(Clang->getInvocation(), Argv,
102 Clang->getDiagnostics(), "clang")) {
106 assert(!Clang->getInvocation().getFrontendOpts().DisableFree);
118 Clang->createFileManager(VFS);
122 EXPECT_TRUE(Clang->createTarget());
125 const FrontendInputFile &Main = Clang->getFrontendOpts().Inputs.front();
126 if (!Action->BeginSourceFile(*Clang, Main)) {
136 Clang->getPreprocessor().EndSourceFile();
138 Clang->getDiagnosticClient().EndSourceFile();
139 Clang->getDiagnostics().setClient(new DiagnosticConsumer(),
147 auto PP = Clang->getPreprocessorPtr(); // Keep PP alive for now.
148 Clang->setPreprocessor(nullptr); // Detach so we don't send EOF twice.
153 Clang.reset();
160 Clang = std::move(M.Clang);