From 81ec2486b36e5f190785329faaa4ffe146cbcedc Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Thu, 7 Aug 2008 15:14:04 +0000 Subject: [PATCH] Add some debug output to SRETPromotion. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54464 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/IPO/StructRetPromotion.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/Transforms/IPO/StructRetPromotion.cpp b/lib/Transforms/IPO/StructRetPromotion.cpp index aa749448509..314d1b98711 100644 --- a/lib/Transforms/IPO/StructRetPromotion.cpp +++ b/lib/Transforms/IPO/StructRetPromotion.cpp @@ -89,6 +89,8 @@ bool SRETPromotion::PromoteReturn(CallGraphNode *CGN) { if (F->arg_size() == 0 || !F->hasStructRetAttr() || F->doesNotReturn()) return false; + DOUT << "SretPromotion: Looking at sret function " << F->getNameStart() << "\n"; + assert (F->getReturnType() == Type::VoidTy && "Invalid function return type"); Function::arg_iterator AI = F->arg_begin(); const llvm::PointerType *FArgType = dyn_cast(AI->getType()); @@ -99,10 +101,12 @@ bool SRETPromotion::PromoteReturn(CallGraphNode *CGN) { // Check if it is ok to perform this promotion. if (isSafeToUpdateAllCallers(F) == false) { + DOUT << "SretPromotion: Not all callers can be updated\n"; NumRejectedSRETUses++; return false; } + DOUT << "SretPromotion: sret argument will be promoted\n"; NumSRET++; // [1] Replace use of sret parameter AllocaInst *TheAlloca = new AllocaInst (STy, NULL, "mrv", -- 2.34.1