Initialize the AST consumer as soon as we have both an ASTConsumer and an

ASTContext. Fixes some cases where we could previously initialize the AST
consumer more than once.

llvm-svn: 245346
This commit is contained in:
Richard Smith
2015-08-18 20:39:29 +00:00
parent 35b0eaf23d
commit 293534b1a5
7 changed files with 23 additions and 24 deletions

View File

@@ -71,10 +71,7 @@ public:
virtual ~PCHContainerGenerator() {}
void Initialize(ASTContext &Context) override {
if (Ctx) {
assert(Ctx == &Context);
return;
}
assert(!Ctx && "initialized multiple times");
Ctx = &Context;
VMContext.reset(new llvm::LLVMContext());