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 | 79d45dbbf91df0b0d9c9b8c04a551bf652730bce (patch) | |
tree | 1eeca9ab2f7d872890215cdc9f35743311c7a38f /llvm/lib | |
parent | 4ec54eeed6209aa9e60e9954453e4c836d1b6f74 (diff) | |
download | bcm5719-llvm-79d45dbbf91df0b0d9c9b8c04a551bf652730bce.tar.gz bcm5719-llvm-79d45dbbf91df0b0d9c9b8c04a551bf652730bce.zip |
Use a ::get method to create the attribute from Attributes::AttrVals instead of a constructor.
llvm-svn: 165923
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/VMCore/Attributes.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/llvm/lib/VMCore/Attributes.cpp b/llvm/lib/VMCore/Attributes.cpp index fc5884be842..e81bf3c83a7 100644 --- a/llvm/lib/VMCore/Attributes.cpp +++ b/llvm/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; } |