aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-02-09 02:03:05 +0000
committerDouglas Gregor <dgregor@apple.com>2011-02-09 02:03:05 +0000
commita29bf41b8f49578207ce36f6b21ff9bb7ee77bab (patch)
tree93aaf5a946105e621e742da05ab276d8a6991309 /lib/CodeGen/CodeGenModule.cpp
parent5f022d82696c84e4d127c558871d68ac6273274e (diff)
When IRgen refers to a function declaration that is not a definition,
and we later find the definition, make sure that we add the definition (not the declaration) to the list of deferred definitions to emit. Fixes PR8864. Thanks to Nick Lewycky for testing this patch out git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125157 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--lib/CodeGen/CodeGenModule.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp
index 89aeeb6fc7..56bc31a858 100644
--- a/lib/CodeGen/CodeGenModule.cpp
+++ b/lib/CodeGen/CodeGenModule.cpp
@@ -857,10 +857,10 @@ CodeGenModule::GetOrCreateLLVMFunction(llvm::StringRef MangledName,
if (isa<CXXRecordDecl>(FD->getLexicalDeclContext())) {
if (FD->isImplicit() && !ForVTable) {
assert(FD->isUsed() && "Sema didn't mark implicit function as used!");
- DeferredDeclsToEmit.push_back(D);
+ DeferredDeclsToEmit.push_back(D.getWithDecl(FD));
break;
} else if (FD->isThisDeclarationADefinition()) {
- DeferredDeclsToEmit.push_back(D);
+ DeferredDeclsToEmit.push_back(D.getWithDecl(FD));
break;
}
}