2017-10-21 00:32:42 +02:00
|
|
|
#include "./frontendaction.h"
|
2017-10-25 15:38:45 +02:00
|
|
|
#include "./codefactory.h"
|
2017-10-21 00:32:42 +02:00
|
|
|
#include "./consumer.h"
|
|
|
|
|
|
|
|
#include <c++utilities/application/global.h>
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
namespace ReflectiveRapidJSON {
|
|
|
|
|
|
|
|
bool FrontendAction::hasCodeCompletionSupport() const
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
REFLECTIVE_RAPIDJSON_MAYBE_UNIQUE(clang::ASTConsumer)
|
|
|
|
FrontendAction::CreateASTConsumer(clang::CompilerInstance &compilerInstance, llvm::StringRef inputFile)
|
|
|
|
{
|
|
|
|
VAR_UNUSED(inputFile)
|
|
|
|
|
2017-10-24 01:00:40 +02:00
|
|
|
// propagate compiler instance to factory
|
|
|
|
m_factory.setCompilerInstance(&compilerInstance);
|
|
|
|
|
2017-10-21 00:32:42 +02:00
|
|
|
// turn some errors into warnings
|
|
|
|
compilerInstance.getDiagnostics().setClient(
|
|
|
|
new DiagConsumer(std::unique_ptr<clang::DiagnosticConsumer>(compilerInstance.getDiagnostics().takeClient())));
|
|
|
|
|
|
|
|
return maybe_unique(new Consumer(m_factory, compilerInstance));
|
|
|
|
}
|
|
|
|
} // namespace ReflectiveRapidJSON
|