mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-26 15:11:00 +00:00
Update to r245397.
`ast_transformer` could be null, in which case we should initialize `m_code_generator` with the ASTContext. llvm-svn: 245398
This commit is contained in:
parent
453930d7c3
commit
57998de165
@ -410,15 +410,20 @@ ClangExpressionParser::Parse (Stream &stream)
|
||||
diag_buf->BeginSourceFile(m_compiler->getLangOpts(), &m_compiler->getPreprocessor());
|
||||
|
||||
ASTConsumer *ast_transformer = m_expr.ASTTransformer(m_code_generator.get());
|
||||
ast_transformer->Initialize(m_compiler->getASTContext());
|
||||
|
||||
if (ClangExpressionDeclMap *decl_map = m_expr.DeclMap())
|
||||
decl_map->InstallCodeGenerator(m_code_generator.get());
|
||||
|
||||
|
||||
if (ast_transformer)
|
||||
{
|
||||
ast_transformer->Initialize(m_compiler->getASTContext());
|
||||
ParseAST(m_compiler->getPreprocessor(), ast_transformer, m_compiler->getASTContext());
|
||||
}
|
||||
else
|
||||
{
|
||||
m_code_generator->Initialize(m_compiler->getASTContext());
|
||||
ParseAST(m_compiler->getPreprocessor(), m_code_generator.get(), m_compiler->getASTContext());
|
||||
}
|
||||
|
||||
diag_buf->EndSourceFile();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user