From b5ca2e9fcbec1e45322e3f476dd3df9154276736 Mon Sep 17 00:00:00 2001 From: Duncan Sands Date: Mon, 14 Jan 2008 19:52:09 +0000 Subject: 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 --- llvm/lib/VMCore/ParameterAttributes.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'llvm/lib/VMCore/ParameterAttributes.cpp') 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; -- cgit v1.2.3