s/AttributesImpl/AttributeImpl/g This is going to apply to Attribute, not Attributes.
authorBill Wendling <isanbard@gmail.com>
Thu, 20 Dec 2012 01:36:59 +0000 (01:36 +0000)
committerBill Wendling <isanbard@gmail.com>
Thu, 20 Dec 2012 01:36:59 +0000 (01:36 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170631 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Attributes.h
lib/VMCore/AttributeImpl.h [new file with mode: 0644]
lib/VMCore/Attributes.cpp
lib/VMCore/AttributesImpl.h [deleted file]
lib/VMCore/LLVMContextImpl.cpp
lib/VMCore/LLVMContextImpl.h

index 42447be0065d646c2b57d5e5d30be9a7713cd196..e158d7e8f29cccbfc617391ba0f1d2b3d4dfac67 100644 (file)
@@ -23,7 +23,7 @@
 namespace llvm {
 
 class AttrBuilder;
-class AttributesImpl;
+class AttributeImpl;
 class LLVMContext;
 class Type;
 
@@ -57,7 +57,7 @@ public:
     AddressSafety,         ///< Address safety checking is on.
     Alignment,             ///< Alignment of parameter (5 bits)
                            ///< stored as log2 of alignment with +1 bias
-                           ///< 0 means unaligned different from align 1
+                           ///< 0 means unaligned (different from align(1))
     AlwaysInline,          ///< inline=always
     ByVal,                 ///< Pass structure by value
     InlineHint,            ///< Source said inlining was desirable
@@ -82,7 +82,7 @@ public:
     StackAlignment,        ///< Alignment of stack for function (3 bits)
                            ///< stored as log2 of alignment with +1 bias 0
                            ///< means unaligned (different from
-                           ///< alignstack={1))
+                           ///< alignstack=(1))
     StackProtect,          ///< Stack protection.
     StackProtectReq,       ///< Stack protection required.
     StructRet,             ///< Hidden pointer to structure to return
@@ -90,8 +90,8 @@ public:
     ZExt                   ///< Zero extended before/after call
   };
 private:
-  AttributesImpl *Attrs;
-  Attribute(AttributesImpl *A) : Attrs(A) {}
+  AttributeImpl *Attrs;
+  Attribute(AttributeImpl *A) : Attrs(A) {}
 public:
   Attribute() : Attrs(0) {}
 
diff --git a/lib/VMCore/AttributeImpl.h b/lib/VMCore/AttributeImpl.h
new file mode 100644 (file)
index 0000000..980c383
--- /dev/null
@@ -0,0 +1,74 @@
+//===-- AttributeImpl.h - Attribute Internals -------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines various helper methods and classes used by LLVMContextImpl
+// for creating and managing attributes.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_ATTRIBUTESIMPL_H
+#define LLVM_ATTRIBUTESIMPL_H
+
+#include "llvm/ADT/FoldingSet.h"
+#include "llvm/Attributes.h"
+
+namespace llvm {
+
+class LLVMContext;
+
+class AttributeImpl : public FoldingSetNode {
+  uint64_t Bits;                // FIXME: We will be expanding this.
+public:
+  AttributeImpl(uint64_t bits) : Bits(bits) {}
+
+  bool hasAttribute(uint64_t A) const;
+
+  bool hasAttributes() const;
+  bool hasAttributes(const Attribute &A) const;
+
+  uint64_t getAlignment() const;
+  uint64_t getStackAlignment() const;
+
+  uint64_t Raw() const { return Bits; } // FIXME: Remove.
+
+  static uint64_t getAttrMask(uint64_t Val);
+
+  void Profile(FoldingSetNodeID &ID) const {
+    Profile(ID, Bits);
+  }
+  static void Profile(FoldingSetNodeID &ID, uint64_t Bits) {
+    ID.AddInteger(Bits);
+  }
+};
+
+class AttributeSetImpl : public FoldingSetNode {
+  // AttributesList is uniqued, these should not be publicly available.
+  void operator=(const AttributeSetImpl &) LLVM_DELETED_FUNCTION;
+  AttributeSetImpl(const AttributeSetImpl &) LLVM_DELETED_FUNCTION;
+public:
+  LLVMContext &Context;
+  SmallVector<AttributeWithIndex, 4> Attrs;
+
+  AttributeSetImpl(LLVMContext &C, ArrayRef<AttributeWithIndex> attrs)
+    : Context(C), Attrs(attrs.begin(), attrs.end()) {}
+
+  void Profile(FoldingSetNodeID &ID) const {
+    Profile(ID, Attrs);
+  }
+  static void Profile(FoldingSetNodeID &ID, ArrayRef<AttributeWithIndex> Attrs){
+    for (unsigned i = 0, e = Attrs.size(); i != e; ++i) {
+      ID.AddInteger(Attrs[i].Attrs.Raw());
+      ID.AddInteger(Attrs[i].Index);
+    }
+  }
+};
+
+} // end llvm namespace
+
+#endif
index 9e24add8c8df03751c3af6eaaa60f8ecb35e3130..2782455995accabb281c09c4ce168797590a1be5 100644 (file)
@@ -13,7 +13,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "llvm/Attributes.h"
-#include "AttributesImpl.h"
+#include "AttributeImpl.h"
 #include "LLVMContextImpl.h"
 #include "llvm/ADT/FoldingSet.h"
 #include "llvm/ADT/StringExtras.h"
@@ -48,12 +48,12 @@ Attribute Attribute::get(LLVMContext &Context, AttrBuilder &B) {
   ID.AddInteger(B.Raw());
 
   void *InsertPoint;
-  AttributesImpl *PA = pImpl->AttrsSet.FindNodeOrInsertPos(ID, InsertPoint);
+  AttributeImpl *PA = pImpl->AttrsSet.FindNodeOrInsertPos(ID, InsertPoint);
 
   if (!PA) {
     // If we didn't find any existing attributes of the same shape then create a
     // new one and insert it.
-    PA = new AttributesImpl(B.Raw());
+    PA = new AttributeImpl(B.Raw());
     pImpl->AttrsSet.InsertNode(PA, InsertPoint);
   }
 
@@ -224,7 +224,7 @@ std::string Attribute::getAsString() const {
 //===----------------------------------------------------------------------===//
 
 AttrBuilder &AttrBuilder::addAttribute(Attribute::AttrVal Val){
-  Bits |= AttributesImpl::getAttrMask(Val);
+  Bits |= AttributeImpl::getAttrMask(Val);
   return *this;
 }
 
@@ -250,7 +250,7 @@ AttrBuilder &AttrBuilder::addStackAlignmentAttr(unsigned Align){
 }
 
 AttrBuilder &AttrBuilder::removeAttribute(Attribute::AttrVal Val) {
-  Bits &= ~AttributesImpl::getAttrMask(Val);
+  Bits &= ~AttributeImpl::getAttrMask(Val);
   return *this;
 }
 
@@ -265,7 +265,7 @@ AttrBuilder &AttrBuilder::removeAttributes(const Attribute &A){
 }
 
 bool AttrBuilder::hasAttribute(Attribute::AttrVal A) const {
-  return Bits & AttributesImpl::getAttrMask(A);
+  return Bits & AttributeImpl::getAttrMask(A);
 }
 
 bool AttrBuilder::hasAttributes() const {
@@ -275,28 +275,28 @@ bool AttrBuilder::hasAttributes(const Attribute &A) const {
   return Bits & A.Raw();
 }
 bool AttrBuilder::hasAlignmentAttr() const {
-  return Bits & AttributesImpl::getAttrMask(Attribute::Alignment);
+  return Bits & AttributeImpl::getAttrMask(Attribute::Alignment);
 }
 
 uint64_t AttrBuilder::getAlignment() const {
   if (!hasAlignmentAttr())
     return 0;
   return 1ULL <<
-    (((Bits & AttributesImpl::getAttrMask(Attribute::Alignment)) >> 16) - 1);
+    (((Bits & AttributeImpl::getAttrMask(Attribute::Alignment)) >> 16) - 1);
 }
 
 uint64_t AttrBuilder::getStackAlignment() const {
   if (!hasAlignmentAttr())
     return 0;
   return 1ULL <<
-    (((Bits & AttributesImpl::getAttrMask(Attribute::StackAlignment))>>26)-1);
+    (((Bits & AttributeImpl::getAttrMask(Attribute::StackAlignment))>>26)-1);
 }
 
 //===----------------------------------------------------------------------===//
 // AttributeImpl Definition
 //===----------------------------------------------------------------------===//
 
-uint64_t AttributesImpl::getAttrMask(uint64_t Val) {
+uint64_t AttributeImpl::getAttrMask(uint64_t Val) {
   switch (Val) {
   case Attribute::None:            return 0;
   case Attribute::ZExt:            return 1 << 0;
@@ -331,23 +331,23 @@ uint64_t AttributesImpl::getAttrMask(uint64_t Val) {
   llvm_unreachable("Unsupported attribute type");
 }
 
-bool AttributesImpl::hasAttribute(uint64_t A) const {
+bool AttributeImpl::hasAttribute(uint64_t A) const {
   return (Bits & getAttrMask(A)) != 0;
 }
 
-bool AttributesImpl::hasAttributes() const {
+bool AttributeImpl::hasAttributes() const {
   return Bits != 0;
 }
 
-bool AttributesImpl::hasAttributes(const Attribute &A) const {
+bool AttributeImpl::hasAttributes(const Attribute &A) const {
   return Bits & A.Raw();        // FIXME: Raw() won't work here in the future.
 }
 
-uint64_t AttributesImpl::getAlignment() const {
+uint64_t AttributeImpl::getAlignment() const {
   return Bits & getAttrMask(Attribute::Alignment);
 }
 
-uint64_t AttributesImpl::getStackAlignment() const {
+uint64_t AttributeImpl::getStackAlignment() const {
   return Bits & getAttrMask(Attribute::StackAlignment);
 }
 
diff --git a/lib/VMCore/AttributesImpl.h b/lib/VMCore/AttributesImpl.h
deleted file mode 100644 (file)
index 396634e..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-//===-- AttributesImpl.h - Attribute Internals -----------------*- C++ -*-===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines various helper methods and classes used by LLVMContextImpl
-// for creating and managing attributes.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ATTRIBUTESIMPL_H
-#define LLVM_ATTRIBUTESIMPL_H
-
-#include "llvm/ADT/FoldingSet.h"
-#include "llvm/Attributes.h"
-
-namespace llvm {
-
-class LLVMContext;
-
-class AttributesImpl : public FoldingSetNode {
-  uint64_t Bits;                // FIXME: We will be expanding this.
-public:
-  AttributesImpl(uint64_t bits) : Bits(bits) {}
-
-  bool hasAttribute(uint64_t A) const;
-
-  bool hasAttributes() const;
-  bool hasAttributes(const Attribute &A) const;
-
-  uint64_t getAlignment() const;
-  uint64_t getStackAlignment() const;
-
-  uint64_t Raw() const { return Bits; } // FIXME: Remove.
-
-  static uint64_t getAttrMask(uint64_t Val);
-
-  void Profile(FoldingSetNodeID &ID) const {
-    Profile(ID, Bits);
-  }
-  static void Profile(FoldingSetNodeID &ID, uint64_t Bits) {
-    ID.AddInteger(Bits);
-  }
-};
-
-class AttributeSetImpl : public FoldingSetNode {
-  // AttributesList is uniqued, these should not be publicly available.
-  void operator=(const AttributeSetImpl &) LLVM_DELETED_FUNCTION;
-  AttributeSetImpl(const AttributeSetImpl &) LLVM_DELETED_FUNCTION;
-public:
-  LLVMContext &Context;
-  SmallVector<AttributeWithIndex, 4> Attrs;
-
-  AttributeSetImpl(LLVMContext &C, ArrayRef<AttributeWithIndex> attrs)
-    : Context(C), Attrs(attrs.begin(), attrs.end()) {}
-
-  void Profile(FoldingSetNodeID &ID) const {
-    Profile(ID, Attrs);
-  }
-  static void Profile(FoldingSetNodeID &ID, ArrayRef<AttributeWithIndex> Attrs){
-    for (unsigned i = 0, e = Attrs.size(); i != e; ++i) {
-      ID.AddInteger(Attrs[i].Attrs.Raw());
-      ID.AddInteger(Attrs[i].Index);
-    }
-  }
-};
-
-} // end llvm namespace
-
-#endif
index 4c3ce154dee5e18fbc4df5e5041762cbe1b1e870..585ec2c3486bdb10a2f638c0b299045c5d467576 100644 (file)
@@ -96,9 +96,9 @@ LLVMContextImpl::~LLVMContextImpl() {
   CDSConstants.clear();
 
   // Destroy attributes.
-  for (FoldingSetIterator<AttributesImpl> I = AttrsSet.begin(),
+  for (FoldingSetIterator<AttributeImpl> I = AttrsSet.begin(),
          E = AttrsSet.end(); I != E; ) {
-    FoldingSetIterator<AttributesImpl> Elem = I++;
+    FoldingSetIterator<AttributeImpl> Elem = I++;
     delete &*Elem;
   }
 
index fa08614a2744e58a772db3445822687e681ac4b3..7ff012034c77949f3fde1bda2db5160f4af740a0 100644 (file)
@@ -15,7 +15,7 @@
 #ifndef LLVM_LLVMCONTEXT_IMPL_H
 #define LLVM_LLVMCONTEXT_IMPL_H
 
-#include "AttributesImpl.h"
+#include "AttributeImpl.h"
 #include "ConstantsContext.h"
 #include "LeaksContext.h"
 #include "llvm/ADT/APFloat.h"
@@ -247,7 +247,7 @@ public:
                          DenseMapAPFloatKeyInfo> FPMapTy;
   FPMapTy FPConstants;
 
-  FoldingSet<AttributesImpl> AttrsSet;
+  FoldingSet<AttributeImpl> AttrsSet;
   FoldingSet<AttributeSetImpl> AttrsLists;
 
   StringMap<Value*> MDStringCache;