summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CodeGenAction.cpp7
-rw-r--r--clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp5
2 files changed, 3 insertions, 9 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)
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());
OpenPOWER on IntegriCloud