From 6bb36e686d03923d726b28b3150a79fea68f773d 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 --- llvm/lib/Transforms/IPO/StructRetPromotion.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Transforms/IPO/StructRetPromotion.cpp b/llvm/lib/Transforms/IPO/StructRetPromotion.cpp index 6659c5a51e40..feb5be64f813 100644 --- a/llvm/lib/Transforms/IPO/StructRetPromotion.cpp +++ b/llvm/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.