summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO/StructRetPromotion.cpp
diff options
context:
space:
mode:
authorGordon Henriksen <gordonhenriksen@mac.com>2008-05-08 17:46:35 +0000
committerGordon Henriksen <gordonhenriksen@mac.com>2008-05-08 17:46:35 +0000
commit829046b0b4d1ffc35b9f8ed134048c09191d3d98 (patch)
tree1faf3474e5dc184e1d54b5313e95a598671058dd /llvm/lib/Transforms/IPO/StructRetPromotion.cpp
parent49a594e6abe6e902cc6e5bc61322b56bf7c3a0ba (diff)
downloadbcm5719-llvm-829046b0b4d1ffc35b9f8ed134048c09191d3d98.tar.gz
bcm5719-llvm-829046b0b4d1ffc35b9f8ed134048c09191d3d98.zip
Improve pass documentation and comments.
Patch by Matthijs Kooijman! llvm-svn: 50861
Diffstat (limited to 'llvm/lib/Transforms/IPO/StructRetPromotion.cpp')
-rw-r--r--llvm/lib/Transforms/IPO/StructRetPromotion.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/IPO/StructRetPromotion.cpp b/llvm/lib/Transforms/IPO/StructRetPromotion.cpp
index 77a35b42875..83ceb0dd0eb 100644
--- a/llvm/lib/Transforms/IPO/StructRetPromotion.cpp
+++ b/llvm/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"
OpenPOWER on IntegriCloud