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
diff --git a/clang/lib/CodeGen/GlobalDecl.h b/clang/lib/CodeGen/GlobalDecl.h
index ab3e201..c2f36d2 100644
--- a/clang/lib/CodeGen/GlobalDecl.h
+++ b/clang/lib/CodeGen/GlobalDecl.h
@@ -81,6 +81,12 @@
GD.Value.setFromOpaqueValue(P);
return GD;
}
+
+ GlobalDecl getWithDecl(const Decl *D) {
+ GlobalDecl Result(*this);
+ Result.Value.setPointer(D);
+ return Result;
+ }
};
} // end namespace CodeGen