diff options
| author | Bill Wendling <isanbard@gmail.com> | 2012-12-20 21:28:43 +0000 |
|---|---|---|
| committer | Bill Wendling <isanbard@gmail.com> | 2012-12-20 21:28:43 +0000 |
| commit | 66e978f904a2df27d52bc6f78ebb6062bf5aca93 (patch) | |
| tree | 6e7b7b48cd9e9584bc6e0e93344580a69f5b66e6 /llvm/lib/VMCore | |
| parent | 00b28ecfae397c776f85f9cbb8ff4d62b52e26c0 (diff) | |
| download | bcm5719-llvm-66e978f904a2df27d52bc6f78ebb6062bf5aca93.tar.gz bcm5719-llvm-66e978f904a2df27d52bc6f78ebb6062bf5aca93.zip | |
Some random comment, naming, and format changes.
Rename the AttributeImpl* from Attrs to pImpl to be consistent with other code.
Add comments where none were before. Or doxygen-ify other comments.
llvm-svn: 170767
Diffstat (limited to 'llvm/lib/VMCore')
| -rw-r--r-- | llvm/lib/VMCore/AttributeImpl.h | 17 | ||||
| -rw-r--r-- | llvm/lib/VMCore/Attributes.cpp | 14 |
2 files changed, 19 insertions, 12 deletions
diff --git a/llvm/lib/VMCore/AttributeImpl.h b/llvm/lib/VMCore/AttributeImpl.h index 980c3837761..e27a0297dfa 100644 --- a/llvm/lib/VMCore/AttributeImpl.h +++ b/llvm/lib/VMCore/AttributeImpl.h @@ -6,10 +6,11 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -// -// This file defines various helper methods and classes used by LLVMContextImpl -// for creating and managing attributes. -// +/// +/// \file +/// \brief This file defines various helper methods and classes used by +/// LLVMContextImpl for creating and managing attributes. +/// //===----------------------------------------------------------------------===// #ifndef LLVM_ATTRIBUTESIMPL_H @@ -22,6 +23,11 @@ namespace llvm { class LLVMContext; +//===----------------------------------------------------------------------===// +/// \class +/// \brief This class represents a single, uniqued attribute. That attribute +/// could be a single enum, a tuple, or a string. It uses a discriminated union +/// to distinguish them. class AttributeImpl : public FoldingSetNode { uint64_t Bits; // FIXME: We will be expanding this. public: @@ -47,6 +53,9 @@ public: } }; +//===----------------------------------------------------------------------===// +/// \class +/// \brief This class represents a set of attributes. class AttributeSetImpl : public FoldingSetNode { // AttributesList is uniqued, these should not be publicly available. void operator=(const AttributeSetImpl &) LLVM_DELETED_FUNCTION; diff --git a/llvm/lib/VMCore/Attributes.cpp b/llvm/lib/VMCore/Attributes.cpp index 5bde5638a1e..d47f35aed39 100644 --- a/llvm/lib/VMCore/Attributes.cpp +++ b/llvm/lib/VMCore/Attributes.cpp @@ -62,22 +62,22 @@ Attribute Attribute::get(LLVMContext &Context, AttrBuilder &B) { } bool Attribute::hasAttribute(AttrVal Val) const { - return Attrs && Attrs->hasAttribute(Val); + return pImpl && pImpl->hasAttribute(Val); } bool Attribute::hasAttributes() const { - return Attrs && Attrs->hasAttributes(); + return pImpl && pImpl->hasAttributes(); } bool Attribute::hasAttributes(const Attribute &A) const { - return Attrs && Attrs->hasAttributes(A); + return pImpl && pImpl->hasAttributes(A); } /// This returns the alignment field of an attribute as a byte alignment value. unsigned Attribute::getAlignment() const { if (!hasAttribute(Attribute::Alignment)) return 0; - return 1U << ((Attrs->getAlignment() >> 16) - 1); + return 1U << ((pImpl->getAlignment() >> 16) - 1); } /// This returns the stack alignment field of an attribute as a byte alignment @@ -85,11 +85,11 @@ unsigned Attribute::getAlignment() const { unsigned Attribute::getStackAlignment() const { if (!hasAttribute(Attribute::StackAlignment)) return 0; - return 1U << ((Attrs->getStackAlignment() >> 26) - 1); + return 1U << ((pImpl->getStackAlignment() >> 26) - 1); } uint64_t Attribute::Raw() const { - return Attrs ? Attrs->Raw() : 0; + return pImpl ? pImpl->Raw() : 0; } Attribute Attribute::typeIncompatible(Type *Ty) { @@ -398,8 +398,6 @@ AttributeSet AttributeSet::get(LLVMContext &C, //===----------------------------------------------------------------------===// const AttributeSet &AttributeSet::operator=(const AttributeSet &RHS) { - if (AttrList == RHS.AttrList) return *this; - AttrList = RHS.AttrList; return *this; } |

