summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/ParameterAttributes.cpp
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2008-01-14 19:52:09 +0000
committerDuncan Sands <baldrick@free.fr>2008-01-14 19:52:09 +0000
commitb5ca2e9fcbec1e45322e3f476dd3df9154276736 (patch)
tree0b27bc441a44a1c69290ce888b73a38620382a0c /llvm/lib/VMCore/ParameterAttributes.cpp
parent994718417a1885ab14083aa39baffdc4a0e3ddd0 (diff)
downloadbcm5719-llvm-b5ca2e9fcbec1e45322e3f476dd3df9154276736.tar.gz
bcm5719-llvm-b5ca2e9fcbec1e45322e3f476dd3df9154276736.zip
I noticed that the trampoline straightening transformation could
drop attributes on varargs call arguments. Also, it could generate invalid IR if the transformed call already had the 'nest' attribute somewhere (this can never happen for code coming from llvm-gcc, but it's a theoretical possibility). Fix both problems. llvm-svn: 45973
Diffstat (limited to 'llvm/lib/VMCore/ParameterAttributes.cpp')
-rw-r--r--llvm/lib/VMCore/ParameterAttributes.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/ParameterAttributes.cpp b/llvm/lib/VMCore/ParameterAttributes.cpp
index b48e0cecde3..4b63cfb2da7 100644
--- a/llvm/lib/VMCore/ParameterAttributes.cpp
+++ b/llvm/lib/VMCore/ParameterAttributes.cpp
@@ -36,6 +36,13 @@ ParamAttrsList::getParamAttrs(uint16_t Index) const {
return ParamAttr::None;
}
+bool ParamAttrsList::hasAttrSomewhere(ParameterAttributes attr) const {
+ for (unsigned i = 0, e = attrs.size(); i < e; ++i)
+ if (attrs[i].attrs & attr)
+ return true;
+ return false;
+}
+
std::string
ParamAttrsList::getParamAttrsText(uint16_t Attrs) {
std::string Result;
OpenPOWER on IntegriCloud