Reflection for RapidJSON 0.0.17
Reflection for serializing/deserializing with RapidJSON
Loading...
Searching...
No Matches
frontendaction.cpp
Go to the documentation of this file.
1#include "./frontendaction.h"
2#include "./codefactory.h"
3#include "./consumer.h"
4
5#include <c++utilities/application/global.h>
6
7using namespace std;
8
9namespace ReflectiveRapidJSON {
10
12{
13 return true;
14}
15
16REFLECTIVE_RAPIDJSON_MAYBE_UNIQUE(clang::ASTConsumer)
17FrontendAction::CreateASTConsumer(clang::CompilerInstance &compilerInstance, llvm::StringRef inputFile)
18{
19 CPP_UTILITIES_UNUSED(inputFile)
20
21 // propagate compiler instance to factory
22 m_factory.setCompilerInstance(&compilerInstance);
23
24 // turn some errors into warnings
25 compilerInstance.getDiagnostics().setClient(
26 new DiagConsumer(std::unique_ptr<clang::DiagnosticConsumer>(compilerInstance.getDiagnostics().takeClient()), m_factory.isErrorResilient()));
27
28 return maybe_unique(new Consumer(m_factory, compilerInstance));
29}
30} // namespace ReflectiveRapidJSON
#define REFLECTIVE_RAPIDJSON_MAYBE_UNIQUE(t)
The REFLECTIVE_RAPIDJSON_MAYBE_UNIQUE macro either expands to a std::unique_ptr or a raw pointer depe...
Consumer(CodeFactory &factory, clang::CompilerInstance &compilerInstance)
Definition consumer.h:41
DiagConsumer(std::unique_ptr< DiagnosticConsumer > previous, bool errorResilient)
Definition consumer.h:71
CreateASTConsumer(clang::CompilerInstance &compilerInstance, llvm::StringRef inputFile) override
FrontendAction(CodeFactory &factory)
bool hasCodeCompletionSupport() const override
MaybeUnique< T > maybe_unique(T *val)