Skip declarations.
authorDevang Patel <dpatel@apple.com>
Tue, 4 Mar 2008 17:47:06 +0000 (17:47 +0000)
committerDevang Patel <dpatel@apple.com>
Tue, 4 Mar 2008 17:47:06 +0000 (17:47 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47890 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/IPO/StructRetPromotion.cpp

index 6659c5a51e403092d8586a53ea8c879cb8826f41..feb5be64f813ad11e9233e87db09cfe74b9f67af 100644 (file)
@@ -73,7 +73,7 @@ bool SRETPromotion::runOnSCC(const std::vector<CallGraphNode *> &SCC) {
 bool SRETPromotion::PromoteReturn(CallGraphNode *CGN) {
   Function *F = CGN->getFunction();
 
-  if (!F)
+  if (!F || F->isDeclaration())
     return false;
 
   // Make sure that function returns struct.