diff options
author | Stephen Lin <stephenwlin@gmail.com> | 2013-04-20 05:14:40 +0000 |
---|---|---|
committer | Stephen Lin <stephenwlin@gmail.com> | 2013-04-20 05:14:40 +0000 |
commit | b8bd232a3da38b11bb0b848ad2bd18d57319b9dc (patch) | |
tree | 89851559c908e128175716113c7d2205bc44d09b /llvm/lib/IR/Function.cpp | |
parent | ffc445492cb7b3a78b042e32f956a4438aeda2c9 (diff) | |
download | llvm-b8bd232a3da38b11bb0b848ad2bd18d57319b9dc.zip llvm-b8bd232a3da38b11bb0b848ad2bd18d57319b9dc.tar.gz llvm-b8bd232a3da38b11bb0b848ad2bd18d57319b9dc.tar.bz2 |
Add CodeGen support for functions that always return arguments via a new parameter attribute 'returned', which is taken advantage of in target-independent tail call opportunity detection and in ARM call lowering (when placed on an integral first parameter).
llvm-svn: 179925
Diffstat (limited to 'llvm/lib/IR/Function.cpp')
-rw-r--r-- | llvm/lib/IR/Function.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/IR/Function.cpp b/llvm/lib/IR/Function.cpp index 1e72b90..7f7efabf 100644 --- a/llvm/lib/IR/Function.cpp +++ b/llvm/lib/IR/Function.cpp @@ -124,6 +124,13 @@ bool Argument::hasStructRetAttr() const { hasAttribute(1, Attribute::StructRet); } +/// hasReturnedAttr - Return true if this argument has the returned attribute on +/// it in its containing function. +bool Argument::hasReturnedAttr() const { + return getParent()->getAttributes(). + hasAttribute(getArgNo()+1, Attribute::Returned); +} + /// addAttr - Add attributes to an argument. void Argument::addAttr(AttributeSet AS) { assert(AS.getNumSlots() <= 1 && |