Instantiator
Generate c++ template instantiations
Loading...
Searching...
No Matches
AllASTBuilderAction.cpp
Go to the documentation of this file.
2
3#include "spdlog/spdlog.h"
4
5#include "clang/Basic/FileManager.h"
6
7bool AllASTBuilderAction::runInvocation(std::shared_ptr<clang::CompilerInvocation> Invocation,
8 clang::FileManager* Files,
9 std::shared_ptr<clang::PCHContainerOperations> PCHContainerOps,
10 clang::DiagnosticConsumer* DiagConsumer)
11{
12 std::unique_ptr<clang::ASTUnit> AST =
13 clang::ASTUnit::LoadFromCompilerInvocation(Invocation,
14 std::move(PCHContainerOps),
15 clang::CompilerInstance::createDiagnostics(&Invocation->getDiagnosticOpts(),
16 DiagConsumer,
17 /*ShouldOwnClient=*/false),
18 Files);
19 if(!AST or AST->getDiagnostics().hasUncompilableErrorOccurred()) return false;
20
21 spdlog::debug("Parsed AST for {}", AST->getOriginalSourceFileName().str());
22 ASTs.push_back(std::move(AST));
23 return true;
24}
std::vector< std::unique_ptr< clang::ASTUnit > > & ASTs
bool runInvocation(std::shared_ptr< clang::CompilerInvocation > Invocation, clang::FileManager *Files, std::shared_ptr< clang::PCHContainerOperations > PCHContainerOps, clang::DiagnosticConsumer *DiagConsumer) override