llvm::Attributes RAttrs = AttrList.getRetAttributes();
// Add the return attributes.
- if (RAttrs)
+ if (RAttrs.hasAttributes())
AttrVec.push_back(llvm::AttributeWithIndex::get(0, RAttrs));
// If the function was passed too few arguments, don't transform. If extra
}
// Add any parameter attributes.
- if (llvm::Attributes PAttrs = AttrList.getParamAttributes(ArgNo + 1))
+ llvm::Attributes PAttrs = AttrList.getParamAttributes(ArgNo + 1);
+ if (PAttrs.hasAttributes())
AttrVec.push_back(llvm::AttributeWithIndex::get(ArgNo + 1, PAttrs));
}
if (DontTransform)
continue;
- if (llvm::Attributes FnAttrs = AttrList.getFnAttributes())
+ llvm::Attributes FnAttrs = AttrList.getFnAttributes();
+ if (FnAttrs.hasAttributes())
AttrVec.push_back(llvm::AttributeWithIndex::get(~0, FnAttrs));
// Okay, we can transform this. Create the new call instruction and copy