summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenAction.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2015-08-18 20:39:29 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2015-08-18 20:39:29 +0000
commit293534b1a50f7489f6d6e2c24aeccc8e7db88c05 (patch)
treedc32e59f7a8de096b84d1202bbc73093e1747083 /clang/lib/CodeGen/CodeGenAction.cpp
parent35b0eaf23d5fe90ad9a04f76488c212cb6f31210 (diff)
downloadbcm5719-llvm-293534b1a50f7489f6d6e2c24aeccc8e7db88c05.tar.gz
bcm5719-llvm-293534b1a50f7489f6d6e2c24aeccc8e7db88c05.zip
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
Diffstat (limited to 'clang/lib/CodeGen/CodeGenAction.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenAction.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CodeGenAction.cpp b/clang/lib/CodeGen/CodeGenAction.cpp
index 5f199bd3a4c..062c7be47b7 100644
--- a/clang/lib/CodeGen/CodeGenAction.cpp
+++ b/clang/lib/CodeGen/CodeGenAction.cpp
@@ -82,11 +82,8 @@ namespace clang {
}
void Initialize(ASTContext &Ctx) override {
- if (Context) {
- assert(Context == &Ctx);
- return;
- }
-
+ assert(!Context && "initialized multiple times");
+
Context = &Ctx;
if (llvm::TimePassesIsEnabled)
OpenPOWER on IntegriCloud