From ad4643f54ba52d1f93426a9853934df8ce3271a0 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Mon, 15 Oct 2012 06:53:28 +0000 Subject: 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 --- lib/VMCore/Attributes.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'lib/VMCore') 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 Vals) { +Attributes::Attributes(AttributesImpl *A) : Attrs(A) {} + +Attributes::Attributes(const Attributes &A) : Attrs(A.Attrs) {} + +Attributes Attributes::get(LLVMContext &Context, ArrayRef Vals) { Attributes::Builder B; for (ArrayRef::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; } -- cgit v1.2.3