summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/ModuleBuilder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen/ModuleBuilder.cpp')
-rw-r--r--clang/lib/CodeGen/ModuleBuilder.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/ModuleBuilder.cpp b/clang/lib/CodeGen/ModuleBuilder.cpp
index 7d75d8bff7b..6c60b4e62c1 100644
--- a/clang/lib/CodeGen/ModuleBuilder.cpp
+++ b/clang/lib/CodeGen/ModuleBuilder.cpp
@@ -117,10 +117,14 @@ namespace {
}
void EmitDeferredDecls() {
+ if (DeferredInlineMethodDefinitions.empty())
+ return;
+
// Emit any deferred inline method definitions. Note that more deferred
// methods may be added during this loop, since ASTConsumer callbacks
// can be invoked if AST inspection results in declarations being added.
- for (unsigned I = 0; I < DeferredInlineMethodDefinitions.size(); ++I)
+ HandlingTopLevelDeclRAII HandlingDecl(*this);
+ for (unsigned I = 0; I != DeferredInlineMethodDefinitions.size(); ++I)
Builder->EmitTopLevelDecl(DeferredInlineMethodDefinitions[I]);
DeferredInlineMethodDefinitions.clear();
}
OpenPOWER on IntegriCloud