diff options
| author | Bill Wendling <isanbard@gmail.com> | 2013-02-06 01:16:00 +0000 |
|---|---|---|
| committer | Bill Wendling <isanbard@gmail.com> | 2013-02-06 01:16:00 +0000 |
| commit | 85df6b43403d3ebf5d80023a85699c6fb254941a (patch) | |
| tree | 425cb61abc00dbb19c13fdf0fdc118d8c1882d0c /include | |
| parent | 9c5861fdbd5e30df55cb7cd9a0edda8d92494100 (diff) | |
| download | external_llvm-85df6b43403d3ebf5d80023a85699c6fb254941a.zip external_llvm-85df6b43403d3ebf5d80023a85699c6fb254941a.tar.gz external_llvm-85df6b43403d3ebf5d80023a85699c6fb254941a.tar.bz2 | |
Add methods to merge an AttrBuilder into another builder.
This is useful when parsing an object that references multiple attribute groups.
N.B. If both builders have alignments specified, then they should match!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174480 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
| -rw-r--r-- | include/llvm/IR/Attributes.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/llvm/IR/Attributes.h b/include/llvm/IR/Attributes.h index 83396e1..d0fe2e1 100644 --- a/include/llvm/IR/Attributes.h +++ b/include/llvm/IR/Attributes.h @@ -373,6 +373,10 @@ public: addAttribute(A); } AttrBuilder(AttributeSet AS, unsigned Idx); + AttrBuilder(const AttrBuilder &B) + : Attrs(B.Attrs), + TargetDepAttrs(B.TargetDepAttrs.begin(), B.TargetDepAttrs.end()), + Alignment(B.Alignment), StackAlignment(B.StackAlignment) {} void clear(); @@ -394,6 +398,9 @@ public: /// \brief Remove the target-dependent attribute to the builder. AttrBuilder &removeAttribute(StringRef A); + /// \brief Add the attributes from the builder. + AttrBuilder &merge(const AttrBuilder &B); + /// \brief Return true if the builder has the specified attribute. bool contains(Attribute::AttrKind A) const; |
