diff options
author | Bill Wendling <isanbard@gmail.com> | 2012-10-15 06:53:28 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2012-10-15 06:53:28 +0000 |
commit | ad4643f54ba52d1f93426a9853934df8ce3271a0 (patch) | |
tree | 4dcc011f3a2b2ef6e3792a189f84c798ce014fd7 /lib/VMCore/Attributes.cpp | |
parent | 2c6893b56817ceb51a523a5d1342fc2317efe251 (diff) | |
download | llvm-ad4643f54ba52d1f93426a9853934df8ce3271a0.tar.gz llvm-ad4643f54ba52d1f93426a9853934df8ce3271a0.tar.bz2 llvm-ad4643f54ba52d1f93426a9853934df8ce3271a0.tar.xz |
Use a ::get method to create the attribute from Attributes::AttrVals instead of a constructor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165923 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Attributes.cpp')
-rw-r--r-- | lib/VMCore/Attributes.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/VMCore/Attributes.cpp b/lib/VMCore/Attributes.cpp index fc5884be84..e81bf3c83a 100644 --- a/lib/VMCore/Attributes.cpp +++ b/lib/VMCore/Attributes.cpp @@ -28,18 +28,18 @@ using namespace llvm; // Attributes Implementation //===----------------------------------------------------------------------===// -Attributes::Attributes(LLVMContext &C, ArrayRef<AttrVal> Vals) { +Attributes::Attributes(AttributesImpl *A) : Attrs(A) {} + +Attributes::Attributes(const Attributes &A) : Attrs(A.Attrs) {} + +Attributes Attributes::get(LLVMContext &Context, ArrayRef<AttrVal> Vals) { Attributes::Builder B; for (ArrayRef<AttrVal>::iterator I = Vals.begin(), E = Vals.end(); I != E; ++I) B.addAttribute(*I); - Attrs = Attributes::get(C, B).Attrs; + return Attributes::get(Context, B); } -Attributes::Attributes(AttributesImpl *A) : Attrs(A) {} - -Attributes::Attributes(const Attributes &A) : Attrs(A.Attrs) {} - Attributes Attributes::get(LLVMContext &Context, Attributes::Builder &B) { // If there are no attributes, return an empty Attributes class. if (B.Bits == 0) @@ -186,8 +186,7 @@ std::string Attributes::getAsString() const { // Attributes::Builder Implementation //===----------------------------------------------------------------------===// -Attributes::Builder &Attributes::Builder:: -addAttribute(Attributes::AttrVal Val) { +Attributes::Builder &Attributes::Builder::addAttribute(Attributes::AttrVal Val){ Bits |= AttributesImpl::getAttrMask(Val); return *this; } |