From aef77854f9efe735a25ac440a817ee0ed5726855 Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Tue, 4 Mar 2008 17:47:06 +0000 Subject: [PATCH] Skip declarations. llvm-svn: 47890 --- lib/Transforms/IPO/StructRetPromotion.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Transforms/IPO/StructRetPromotion.cpp b/lib/Transforms/IPO/StructRetPromotion.cpp index 6659c5a51e4..feb5be64f81 100644 --- a/lib/Transforms/IPO/StructRetPromotion.cpp +++ b/lib/Transforms/IPO/StructRetPromotion.cpp @@ -73,7 +73,7 @@ bool SRETPromotion::runOnSCC(const std::vector &SCC) { bool SRETPromotion::PromoteReturn(CallGraphNode *CGN) { Function *F = CGN->getFunction(); - if (!F) + if (!F || F->isDeclaration()) return false; // Make sure that function returns struct.