From 085566990b5cc483b9bc5f7c9abd12e976062d65 Mon Sep 17 00:00:00 2001 From: Gordon Henriksen Date: Thu, 8 May 2008 17:46:35 +0000 Subject: Improve pass documentation and comments. Patch by Matthijs Kooijman! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50861 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/IPO/StructRetPromotion.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'lib/Transforms/IPO/StructRetPromotion.cpp') diff --git a/lib/Transforms/IPO/StructRetPromotion.cpp b/lib/Transforms/IPO/StructRetPromotion.cpp index 77a35b4..83ceb0d 100644 --- a/lib/Transforms/IPO/StructRetPromotion.cpp +++ b/lib/Transforms/IPO/StructRetPromotion.cpp @@ -1,4 +1,4 @@ -//===-- StructRetPromotion.cpp - Promote sret arguments -000000------------===// +//===-- StructRetPromotion.cpp - Promote sret arguments ------------------===// // // The LLVM Compiler Infrastructure // @@ -7,7 +7,16 @@ // //===----------------------------------------------------------------------===// // -// TODO : Describe this pass. +// This pass finds functions that return a struct (using a pointer to the struct +// as the first argument of the function, marked with the 'sret' attribute) and +// replaces them with a new function that simply returns each of the elements of +// that struct (using multiple return values). +// +// This pass works under a number of conditions: +// 1. The returned struct must not contain other structs +// 2. The returned struct must only be used to load values from +// 3. The placeholder struct passed in is the result of an alloca +// //===----------------------------------------------------------------------===// #define DEBUG_TYPE "sretpromotion" -- cgit v1.1