summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2014-08-13 21:15:09 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2014-08-13 21:15:09 +0000
commitc9cbde7e8be50c51ce3ae4dad19aef1578a826fe (patch)
treea3cb85c348a243878df4c3cf5945b3bcffa210d3 /clang/lib
parentd2228c0f728a6c107e229d6c97c926e5d5175811 (diff)
downloadbcm5719-llvm-c9cbde7e8be50c51ce3ae4dad19aef1578a826fe.tar.gz
bcm5719-llvm-c9cbde7e8be50c51ce3ae4dad19aef1578a826fe.zip
[modules] Fix a rejects-valid resulting from emitting an inline function
recursively within the emission of another inline function. This ultimately led to us emitting the same inline function definition twice, which we then rejected because we believed we had a mangled name conflict. llvm-svn: 215579
Diffstat (limited to 'clang/lib')
-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