[llvm-commits] [llvm] r165686 - in /llvm/trunk: include/llvm/Attributes.h lib/VMCore/Attributes.cpp
Bill Wendling
isanbard at gmail.com
Wed Oct 10 18:05:52 PDT 2012
Author: void
Date: Wed Oct 10 20:05:52 2012
New Revision: 165686
URL: http://llvm.org/viewvc/llvm-project?rev=165686&view=rev
Log:
Support a common idiom on how to build an Attributes class with a single attribute.
Modified:
llvm/trunk/include/llvm/Attributes.h
llvm/trunk/lib/VMCore/Attributes.cpp
Modified: llvm/trunk/include/llvm/Attributes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Attributes.h?rev=165686&r1=165685&r2=165686&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Attributes.h (original)
+++ llvm/trunk/include/llvm/Attributes.h Wed Oct 10 20:05:52 2012
@@ -95,6 +95,7 @@
public:
Attributes() : Attrs(0) {}
explicit Attributes(uint64_t Val);
+ explicit Attributes(AttrVal Val);
Attributes(const Attributes &A);
class Builder {
Modified: llvm/trunk/lib/VMCore/Attributes.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Attributes.cpp?rev=165686&r1=165685&r2=165686&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Attributes.cpp (original)
+++ llvm/trunk/lib/VMCore/Attributes.cpp Wed Oct 10 20:05:52 2012
@@ -29,6 +29,9 @@
Attributes::Attributes(uint64_t Val) : Attrs(Val) {}
+Attributes::Attributes(AttrVal Val)
+ : Attrs(Attributes::get(Attributes::Builder().addAttribute(Val)).Attrs) {}
+
Attributes::Attributes(AttributesImpl *A) : Attrs(A->Bits) {}
Attributes::Attributes(const Attributes &A) : Attrs(A.Attrs) {}
More information about the llvm-commits
mailing list