From 2575631c0f76753eb61a59461e214900de47be2a Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Wed, 9 Feb 2011 02:03:05 +0000 Subject: 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 llvm-svn: 125157 --- clang/lib/CodeGen/CodeGenModule.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 89aeeb6..56bc31a 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -857,10 +857,10 @@ CodeGenModule::GetOrCreateLLVMFunction(llvm::StringRef MangledName, if (isa(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; } } -- cgit v1.1