From 5db224e1f041e2d21bbf4eb0db7a1e8c0cd8439d Mon Sep 17 00:00:00 2001 From: Amaury Sechet Date: Sun, 12 Jun 2016 06:17:24 +0000 Subject: Make sure we have a Add/Remove/Has function for various thing that can have attribute. Summary: This also deprecated the get attribute function familly. Reviewers: Wallbraker, whitequark, joker.eph, echristo, rafael, jyknight Subscribers: axw, joker.eph, llvm-commits Differential Revision: http://reviews.llvm.org/D19181 llvm-svn: 272504 --- llvm/lib/IR/Function.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'llvm/lib/IR/Function.cpp') diff --git a/llvm/lib/IR/Function.cpp b/llvm/lib/IR/Function.cpp index 815922593e5..d7eaf7190c4 100644 --- a/llvm/lib/IR/Function.cpp +++ b/llvm/lib/IR/Function.cpp @@ -372,6 +372,12 @@ void Function::addAttribute(unsigned i, Attribute::AttrKind attr) { setAttributes(PAL); } +void Function::addAttribute(unsigned i, Attribute Attr) { + AttributeSet PAL = getAttributes(); + PAL = PAL.addAttribute(getContext(), i, Attr); + setAttributes(PAL); +} + void Function::addAttributes(unsigned i, AttributeSet attrs) { AttributeSet PAL = getAttributes(); PAL = PAL.addAttributes(getContext(), i, attrs); -- cgit v1.2.3