From 293534b1a50f7489f6d6e2c24aeccc8e7db88c05 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Tue, 18 Aug 2015 20:39:29 +0000 Subject: 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 --- clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp') diff --git a/clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp b/clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp index 526c0c71de5..3611d9aa86f 100644 --- a/clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp +++ b/clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp @@ -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()); -- cgit v1.2.3