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.