[llvm-commits] [llvm] r171611 - in /llvm/trunk: include/llvm/IR/Attributes.h lib/IR/Attributes.cpp

Chandler Carruth chandlerc at google.com
Sat Jan 5 00:48:18 PST 2013


Hey, I touched this up in r171614. The commit log there records the details
of what I think was going wrong here. Let me know if that doesn't make
sense to you.


On Fri, Jan 4, 2013 at 11:55 PM, NAKAMURA Takumi <geek4civic at gmail.com>wrote:

> Author: chapuni
> Date: Sat Jan  5 01:55:47 2013
> New Revision: 171611
>
> URL: http://llvm.org/viewvc/llvm-project?rev=171611&view=rev
> Log:
> IR/Attributes: Provide EmptyKey and TombstoneKey in part of enum, as
> workaround for gcc-4.4 take #2.
>
> I will investigate, later, what was wrong. I am too tired for now.
>
> Modified:
>     llvm/trunk/include/llvm/IR/Attributes.h
>     llvm/trunk/lib/IR/Attributes.cpp
>
> Modified: llvm/trunk/include/llvm/IR/Attributes.h
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/Attributes.h?rev=171611&r1=171610&r2=171611&view=diff
>
> ==============================================================================
> --- llvm/trunk/include/llvm/IR/Attributes.h (original)
> +++ llvm/trunk/include/llvm/IR/Attributes.h Sat Jan  5 01:55:47 2013
> @@ -93,7 +93,11 @@
>      UWTable,               ///< Function must be in a unwind table
>      ZExt,                  ///< Zero extended before/after call
>
> -    EndAttrKinds           ///< Sentinal value useful for loops
> +    EndAttrKinds,          ///< Sentinal value useful for loops
> +
> +    // Values for DenseMapInfo
> +    EmptyKey     = 0x7FFFFFFF,
> +    TombstoneKey = -0x7FFFFFFF - 1
>    };
>  private:
>    AttributeImpl *pImpl;
> @@ -165,10 +169,10 @@
>  /// AttrBuilder.
>  template<> struct DenseMapInfo<Attribute::AttrKind> {
>    static inline Attribute::AttrKind getEmptyKey() {
> -    return Attribute::AttrKind(~0U);
> +    return Attribute::EmptyKey;
>    }
>    static inline Attribute::AttrKind getTombstoneKey() {
> -    return Attribute::AttrKind(~0U - 1);
> +    return Attribute::TombstoneKey;
>    }
>    static unsigned getHashValue(const Attribute::AttrKind &Val) {
>      return Val * 37U;
>
> Modified: llvm/trunk/lib/IR/Attributes.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Attributes.cpp?rev=171611&r1=171610&r2=171611&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/IR/Attributes.cpp (original)
> +++ llvm/trunk/lib/IR/Attributes.cpp Sat Jan  5 01:55:47 2013
> @@ -426,6 +426,8 @@
>  uint64_t AttributeImpl::getAttrMask(Attribute::AttrKind Val) {
>    switch (Val) {
>    case Attribute::EndAttrKinds:    break;
> +  case Attribute::EmptyKey:        break;
> +  case Attribute::TombstoneKey:    break;
>    case Attribute::None:            return 0;
>    case Attribute::ZExt:            return 1 << 0;
>    case Attribute::SExt:            return 1 << 1;
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130105/395f8fac/attachment.html>


More information about the llvm-commits mailing list