[llvm-branch-commits] [llvm-branch] r168465 - in /llvm/branches/release_32: ./ include/llvm/Attributes.h lib/AsmParser/LLParser.cpp lib/Bitcode/Reader/BitcodeReader.cpp lib/Transforms/IPO/ArgumentPromotion.cpp lib/Transforms/IPO/DeadArgumentElimination.cpp lib/Transforms/InstCombine/InstCombineCalls.cpp lib/Transforms/Utils/BuildLibCalls.cpp lib/VMCore/Attributes.cpp lib/VMCore/AttributesImpl.h lib/VMCore/LLVMContextImpl.cpp lib/VMCore/LLVMContextImpl.h utils/TableGen/IntrinsicEmitter.cpp
Pawel Wodnicki
pawel at 32bitmicro.com
Wed Nov 21 14:21:41 PST 2012
Author: pawel
Date: Wed Nov 21 16:21:40 2012
New Revision: 168465
URL: http://llvm.org/viewvc/llvm-project?rev=168465&view=rev
Log:
Reverting 168457
Modified:
llvm/branches/release_32/ (props changed)
llvm/branches/release_32/include/llvm/Attributes.h
llvm/branches/release_32/lib/AsmParser/LLParser.cpp
llvm/branches/release_32/lib/Bitcode/Reader/BitcodeReader.cpp
llvm/branches/release_32/lib/Transforms/IPO/ArgumentPromotion.cpp
llvm/branches/release_32/lib/Transforms/IPO/DeadArgumentElimination.cpp
llvm/branches/release_32/lib/Transforms/InstCombine/InstCombineCalls.cpp
llvm/branches/release_32/lib/Transforms/Utils/BuildLibCalls.cpp
llvm/branches/release_32/lib/VMCore/Attributes.cpp
llvm/branches/release_32/lib/VMCore/AttributesImpl.h
llvm/branches/release_32/lib/VMCore/LLVMContextImpl.cpp
llvm/branches/release_32/lib/VMCore/LLVMContextImpl.h
llvm/branches/release_32/utils/TableGen/IntrinsicEmitter.cpp
Propchange: llvm/branches/release_32/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Nov 21 16:21:40 2012
@@ -1,3 +1,3 @@
/llvm/branches/Apple/Pertwee:110850,110961
/llvm/branches/type-system-rewrite:133420-134817
-/llvm/trunk:155241,167718-167719,167731,167737,167743,167750,167784,167811,167817,167855,167860-167864,167875,167942,167948,167966,168001,168035,168181,168189,168197-168198,168227,168316,168319,168346,168352,168354-168355,168361,168379
+/llvm/trunk:155241,167718-167719,167731,167737,167743,167750,167784,167811,167817,167855,167860-167864,167875,167942,167948,167966,168001,168035,168181,168189,168197-168198,168227,168316,168319,168346,168352,168361
Modified: llvm/branches/release_32/include/llvm/Attributes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_32/include/llvm/Attributes.h?rev=168465&r1=168464&r2=168465&view=diff
==============================================================================
--- llvm/branches/release_32/include/llvm/Attributes.h (original)
+++ llvm/branches/release_32/include/llvm/Attributes.h Wed Nov 21 16:21:40 2012
@@ -318,26 +318,21 @@
FunctionIndex = ~0U
};
private:
- /// @brief The attributes that we are managing. This can be null to represent
- /// the empty attributes list.
+ /// AttrList - The attributes that we are managing. This can be null to
+ /// represent the empty attributes list.
AttributeListImpl *AttrList;
-
- /// @brief The attributes for the specified index are returned. Attributes
- /// for the result are denoted with Idx = 0.
- Attributes getAttributes(unsigned Idx) const;
-
- explicit AttrListPtr(AttributeListImpl *LI) : AttrList(LI) {}
public:
AttrListPtr() : AttrList(0) {}
- AttrListPtr(const AttrListPtr &P) : AttrList(P.AttrList) {}
+ AttrListPtr(const AttrListPtr &P);
const AttrListPtr &operator=(const AttrListPtr &RHS);
+ ~AttrListPtr();
//===--------------------------------------------------------------------===//
// Attribute List Construction and Mutation
//===--------------------------------------------------------------------===//
/// get - Return a Attributes list with the specified parameters in it.
- static AttrListPtr get(LLVMContext &C, ArrayRef<AttributeWithIndex> Attrs);
+ static AttrListPtr get(ArrayRef<AttributeWithIndex> Attrs);
/// addAttr - Add the specified attribute at the specified index to this
/// attribute list. Since attribute lists are immutable, this
@@ -424,6 +419,13 @@
const AttributeWithIndex &getSlot(unsigned Slot) const;
void dump() const;
+
+private:
+ explicit AttrListPtr(AttributeListImpl *L);
+
+ /// getAttributes - The attributes for the specified index are
+ /// returned. Attributes for the result are denoted with Idx = 0.
+ Attributes getAttributes(unsigned Idx) const;
};
} // End llvm namespace
Modified: llvm/branches/release_32/lib/AsmParser/LLParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_32/lib/AsmParser/LLParser.cpp?rev=168465&r1=168464&r2=168465&view=diff
==============================================================================
--- llvm/branches/release_32/lib/AsmParser/LLParser.cpp (original)
+++ llvm/branches/release_32/lib/AsmParser/LLParser.cpp Wed Nov 21 16:21:40 2012
@@ -2794,7 +2794,7 @@
Attributes::get(RetType->getContext(),
FuncAttrs)));
- AttrListPtr PAL = AttrListPtr::get(Context, Attrs);
+ AttrListPtr PAL = AttrListPtr::get(Attrs);
if (PAL.getParamAttributes(1).hasAttribute(Attributes::StructRet) &&
!RetType->isVoidTy())
@@ -3351,7 +3351,7 @@
FnAttrs)));
// Finish off the Attributes and check them
- AttrListPtr PAL = AttrListPtr::get(Context, Attrs);
+ AttrListPtr PAL = AttrListPtr::get(Attrs);
InvokeInst *II = InvokeInst::Create(Callee, NormalBB, UnwindBB, Args);
II->setCallingConv(CC);
@@ -3753,7 +3753,7 @@
FnAttrs)));
// Finish off the Attributes and check them
- AttrListPtr PAL = AttrListPtr::get(Context, Attrs);
+ AttrListPtr PAL = AttrListPtr::get(Attrs);
CallInst *CI = CallInst::Create(Callee, Args);
CI->setTailCall(isTail);
Modified: llvm/branches/release_32/lib/Bitcode/Reader/BitcodeReader.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_32/lib/Bitcode/Reader/BitcodeReader.cpp?rev=168465&r1=168464&r2=168465&view=diff
==============================================================================
--- llvm/branches/release_32/lib/Bitcode/Reader/BitcodeReader.cpp (original)
+++ llvm/branches/release_32/lib/Bitcode/Reader/BitcodeReader.cpp Wed Nov 21 16:21:40 2012
@@ -487,7 +487,7 @@
Attributes::get(Context, B)));
}
- MAttributes.push_back(AttrListPtr::get(Context, Attrs));
+ MAttributes.push_back(AttrListPtr::get(Attrs));
Attrs.clear();
break;
}
Modified: llvm/branches/release_32/lib/Transforms/IPO/ArgumentPromotion.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_32/lib/Transforms/IPO/ArgumentPromotion.cpp?rev=168465&r1=168464&r2=168465&view=diff
==============================================================================
--- llvm/branches/release_32/lib/Transforms/IPO/ArgumentPromotion.cpp (original)
+++ llvm/branches/release_32/lib/Transforms/IPO/ArgumentPromotion.cpp Wed Nov 21 16:21:40 2012
@@ -611,7 +611,7 @@
// Recompute the parameter attributes list based on the new arguments for
// the function.
- NF->setAttributes(AttrListPtr::get(F->getContext(), AttributesVec));
+ NF->setAttributes(AttrListPtr::get(AttributesVec));
AttributesVec.clear();
F->getParent()->getFunctionList().insert(F, NF);
@@ -731,13 +731,11 @@
New = InvokeInst::Create(NF, II->getNormalDest(), II->getUnwindDest(),
Args, "", Call);
cast<InvokeInst>(New)->setCallingConv(CS.getCallingConv());
- cast<InvokeInst>(New)->setAttributes(AttrListPtr::get(II->getContext(),
- AttributesVec));
+ cast<InvokeInst>(New)->setAttributes(AttrListPtr::get(AttributesVec));
} else {
New = CallInst::Create(NF, Args, "", Call);
cast<CallInst>(New)->setCallingConv(CS.getCallingConv());
- cast<CallInst>(New)->setAttributes(AttrListPtr::get(New->getContext(),
- AttributesVec));
+ cast<CallInst>(New)->setAttributes(AttrListPtr::get(AttributesVec));
if (cast<CallInst>(Call)->isTailCall())
cast<CallInst>(New)->setTailCall();
}
Modified: llvm/branches/release_32/lib/Transforms/IPO/DeadArgumentElimination.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_32/lib/Transforms/IPO/DeadArgumentElimination.cpp?rev=168465&r1=168464&r2=168465&view=diff
==============================================================================
--- llvm/branches/release_32/lib/Transforms/IPO/DeadArgumentElimination.cpp (original)
+++ llvm/branches/release_32/lib/Transforms/IPO/DeadArgumentElimination.cpp Wed Nov 21 16:21:40 2012
@@ -280,7 +280,7 @@
if (FnAttrs.hasAttributes())
AttributesVec.push_back(AttributeWithIndex::get(AttrListPtr::FunctionIndex,
FnAttrs));
- PAL = AttrListPtr::get(Fn.getContext(), AttributesVec);
+ PAL = AttrListPtr::get(AttributesVec);
}
Instruction *New;
@@ -806,7 +806,7 @@
FnAttrs));
// Reconstruct the AttributesList based on the vector we constructed.
- AttrListPtr NewPAL = AttrListPtr::get(F->getContext(), AttributesVec);
+ AttrListPtr NewPAL = AttrListPtr::get(AttributesVec);
// Create the new function type based on the recomputed parameters.
FunctionType *NFTy = FunctionType::get(NRetTy, Params, FTy->isVarArg());
@@ -874,7 +874,7 @@
FnAttrs));
// Reconstruct the AttributesList based on the vector we constructed.
- AttrListPtr NewCallPAL = AttrListPtr::get(F->getContext(), AttributesVec);
+ AttrListPtr NewCallPAL = AttrListPtr::get(AttributesVec);
Instruction *New;
if (InvokeInst *II = dyn_cast<InvokeInst>(Call)) {
Modified: llvm/branches/release_32/lib/Transforms/InstCombine/InstCombineCalls.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_32/lib/Transforms/InstCombine/InstCombineCalls.cpp?rev=168465&r1=168464&r2=168465&view=diff
==============================================================================
--- llvm/branches/release_32/lib/Transforms/InstCombine/InstCombineCalls.cpp (original)
+++ llvm/branches/release_32/lib/Transforms/InstCombine/InstCombineCalls.cpp Wed Nov 21 16:21:40 2012
@@ -1177,8 +1177,7 @@
if (NewRetTy->isVoidTy())
Caller->setName(""); // Void type should not have a name.
- const AttrListPtr &NewCallerPAL = AttrListPtr::get(Callee->getContext(),
- attrVec);
+ const AttrListPtr &NewCallerPAL = AttrListPtr::get(attrVec);
Instruction *NC;
if (InvokeInst *II = dyn_cast<InvokeInst>(Caller)) {
@@ -1356,7 +1355,7 @@
NestF->getType() == PointerType::getUnqual(NewFTy) ?
NestF : ConstantExpr::getBitCast(NestF,
PointerType::getUnqual(NewFTy));
- const AttrListPtr &NewPAL = AttrListPtr::get(FTy->getContext(), NewAttrs);
+ const AttrListPtr &NewPAL = AttrListPtr::get(NewAttrs);
Instruction *NewCaller;
if (InvokeInst *II = dyn_cast<InvokeInst>(Caller)) {
Modified: llvm/branches/release_32/lib/Transforms/Utils/BuildLibCalls.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_32/lib/Transforms/Utils/BuildLibCalls.cpp?rev=168465&r1=168464&r2=168465&view=diff
==============================================================================
--- llvm/branches/release_32/lib/Transforms/Utils/BuildLibCalls.cpp (original)
+++ llvm/branches/release_32/lib/Transforms/Utils/BuildLibCalls.cpp Wed Nov 21 16:21:40 2012
@@ -47,9 +47,7 @@
ArrayRef<Attributes::AttrVal>(AVs, 2));
LLVMContext &Context = B.GetInsertBlock()->getContext();
- Constant *StrLen = M->getOrInsertFunction("strlen",
- AttrListPtr::get(M->getContext(),
- AWI),
+ Constant *StrLen = M->getOrInsertFunction("strlen", AttrListPtr::get(AWI),
TD->getIntPtrType(Context),
B.getInt8PtrTy(),
NULL);
@@ -76,9 +74,7 @@
ArrayRef<Attributes::AttrVal>(AVs, 2));
LLVMContext &Context = B.GetInsertBlock()->getContext();
- Constant *StrNLen = M->getOrInsertFunction("strnlen",
- AttrListPtr::get(M->getContext(),
- AWI),
+ Constant *StrNLen = M->getOrInsertFunction("strnlen", AttrListPtr::get(AWI),
TD->getIntPtrType(Context),
B.getInt8PtrTy(),
TD->getIntPtrType(Context),
@@ -106,9 +102,7 @@
Type *I8Ptr = B.getInt8PtrTy();
Type *I32Ty = B.getInt32Ty();
- Constant *StrChr = M->getOrInsertFunction("strchr",
- AttrListPtr::get(M->getContext(),
- AWI),
+ Constant *StrChr = M->getOrInsertFunction("strchr", AttrListPtr::get(AWI),
I8Ptr, I8Ptr, I32Ty, NULL);
CallInst *CI = B.CreateCall2(StrChr, CastToCStr(Ptr, B),
ConstantInt::get(I32Ty, C), "strchr");
@@ -133,9 +127,7 @@
ArrayRef<Attributes::AttrVal>(AVs, 2));
LLVMContext &Context = B.GetInsertBlock()->getContext();
- Value *StrNCmp = M->getOrInsertFunction("strncmp",
- AttrListPtr::get(M->getContext(),
- AWI),
+ Value *StrNCmp = M->getOrInsertFunction("strncmp", AttrListPtr::get(AWI),
B.getInt32Ty(),
B.getInt8PtrTy(),
B.getInt8PtrTy(),
@@ -163,8 +155,7 @@
AWI[1] = AttributeWithIndex::get(M->getContext(), AttrListPtr::FunctionIndex,
Attributes::NoUnwind);
Type *I8Ptr = B.getInt8PtrTy();
- Value *StrCpy = M->getOrInsertFunction(Name,
- AttrListPtr::get(M->getContext(), AWI),
+ Value *StrCpy = M->getOrInsertFunction(Name, AttrListPtr::get(AWI),
I8Ptr, I8Ptr, I8Ptr, NULL);
CallInst *CI = B.CreateCall2(StrCpy, CastToCStr(Dst, B), CastToCStr(Src, B),
Name);
@@ -187,9 +178,7 @@
AWI[1] = AttributeWithIndex::get(M->getContext(), AttrListPtr::FunctionIndex,
Attributes::NoUnwind);
Type *I8Ptr = B.getInt8PtrTy();
- Value *StrNCpy = M->getOrInsertFunction(Name,
- AttrListPtr::get(M->getContext(),
- AWI),
+ Value *StrNCpy = M->getOrInsertFunction(Name, AttrListPtr::get(AWI),
I8Ptr, I8Ptr, I8Ptr,
Len->getType(), NULL);
CallInst *CI = B.CreateCall3(StrNCpy, CastToCStr(Dst, B), CastToCStr(Src, B),
@@ -214,7 +203,7 @@
Attributes::NoUnwind);
LLVMContext &Context = B.GetInsertBlock()->getContext();
Value *MemCpy = M->getOrInsertFunction("__memcpy_chk",
- AttrListPtr::get(M->getContext(), AWI),
+ AttrListPtr::get(AWI),
B.getInt8PtrTy(),
B.getInt8PtrTy(),
B.getInt8PtrTy(),
@@ -242,8 +231,7 @@
AWI = AttributeWithIndex::get(M->getContext(), AttrListPtr::FunctionIndex,
ArrayRef<Attributes::AttrVal>(AVs, 2));
LLVMContext &Context = B.GetInsertBlock()->getContext();
- Value *MemChr = M->getOrInsertFunction("memchr",
- AttrListPtr::get(M->getContext(), AWI),
+ Value *MemChr = M->getOrInsertFunction("memchr", AttrListPtr::get(AWI),
B.getInt8PtrTy(),
B.getInt8PtrTy(),
B.getInt32Ty(),
@@ -273,8 +261,7 @@
ArrayRef<Attributes::AttrVal>(AVs, 2));
LLVMContext &Context = B.GetInsertBlock()->getContext();
- Value *MemCmp = M->getOrInsertFunction("memcmp",
- AttrListPtr::get(M->getContext(), AWI),
+ Value *MemCmp = M->getOrInsertFunction("memcmp", AttrListPtr::get(AWI),
B.getInt32Ty(),
B.getInt8PtrTy(),
B.getInt8PtrTy(),
@@ -351,8 +338,7 @@
AWI[1] = AttributeWithIndex::get(M->getContext(), AttrListPtr::FunctionIndex,
Attributes::NoUnwind);
- Value *PutS = M->getOrInsertFunction("puts",
- AttrListPtr::get(M->getContext(), AWI),
+ Value *PutS = M->getOrInsertFunction("puts", AttrListPtr::get(AWI),
B.getInt32Ty(),
B.getInt8PtrTy(),
NULL);
@@ -376,8 +362,7 @@
Attributes::NoUnwind);
Constant *F;
if (File->getType()->isPointerTy())
- F = M->getOrInsertFunction("fputc",
- AttrListPtr::get(M->getContext(), AWI),
+ F = M->getOrInsertFunction("fputc", AttrListPtr::get(AWI),
B.getInt32Ty(),
B.getInt32Ty(), File->getType(),
NULL);
@@ -411,8 +396,7 @@
StringRef FPutsName = TLI->getName(LibFunc::fputs);
Constant *F;
if (File->getType()->isPointerTy())
- F = M->getOrInsertFunction(FPutsName,
- AttrListPtr::get(M->getContext(), AWI),
+ F = M->getOrInsertFunction(FPutsName, AttrListPtr::get(AWI),
B.getInt32Ty(),
B.getInt8PtrTy(),
File->getType(), NULL);
@@ -445,8 +429,7 @@
StringRef FWriteName = TLI->getName(LibFunc::fwrite);
Constant *F;
if (File->getType()->isPointerTy())
- F = M->getOrInsertFunction(FWriteName,
- AttrListPtr::get(M->getContext(), AWI),
+ F = M->getOrInsertFunction(FWriteName, AttrListPtr::get(AWI),
TD->getIntPtrType(Context),
B.getInt8PtrTy(),
TD->getIntPtrType(Context),
Modified: llvm/branches/release_32/lib/VMCore/Attributes.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_32/lib/VMCore/Attributes.cpp?rev=168465&r1=168464&r2=168465&view=diff
==============================================================================
--- llvm/branches/release_32/lib/VMCore/Attributes.cpp (original)
+++ llvm/branches/release_32/lib/VMCore/Attributes.cpp Wed Nov 21 16:21:40 2012
@@ -355,8 +355,62 @@
// AttributeListImpl Definition
//===----------------------------------------------------------------------===//
-AttrListPtr AttrListPtr::get(LLVMContext &C,
- ArrayRef<AttributeWithIndex> Attrs) {
+namespace llvm {
+ class AttributeListImpl;
+}
+
+static ManagedStatic<FoldingSet<AttributeListImpl> > AttributesLists;
+
+namespace llvm {
+static ManagedStatic<sys::SmartMutex<true> > ALMutex;
+
+class AttributeListImpl : public FoldingSetNode {
+ sys::cas_flag RefCount;
+
+ // AttributesList is uniqued, these should not be publicly available.
+ void operator=(const AttributeListImpl &) LLVM_DELETED_FUNCTION;
+ AttributeListImpl(const AttributeListImpl &) LLVM_DELETED_FUNCTION;
+ ~AttributeListImpl(); // Private implementation
+public:
+ SmallVector<AttributeWithIndex, 4> Attrs;
+
+ AttributeListImpl(ArrayRef<AttributeWithIndex> attrs)
+ : Attrs(attrs.begin(), attrs.end()) {
+ RefCount = 0;
+ }
+
+ void AddRef() {
+ sys::SmartScopedLock<true> Lock(*ALMutex);
+ ++RefCount;
+ }
+ void DropRef() {
+ sys::SmartScopedLock<true> Lock(*ALMutex);
+ if (!AttributesLists.isConstructed())
+ return;
+ sys::cas_flag new_val = --RefCount;
+ if (new_val == 0)
+ delete this;
+ }
+
+ 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
+
+AttributeListImpl::~AttributeListImpl() {
+ // NOTE: Lock must be acquired by caller.
+ AttributesLists->RemoveNode(this);
+}
+
+AttrListPtr AttrListPtr::get(ArrayRef<AttributeWithIndex> Attrs) {
// If there are no attributes then return a null AttributesList pointer.
if (Attrs.empty())
return AttrListPtr();
@@ -371,36 +425,51 @@
#endif
// Otherwise, build a key to look up the existing attributes.
- LLVMContextImpl *pImpl = C.pImpl;
FoldingSetNodeID ID;
AttributeListImpl::Profile(ID, Attrs);
+ void *InsertPos;
- void *InsertPoint;
- AttributeListImpl *PA = pImpl->AttrsLists.FindNodeOrInsertPos(ID,
- InsertPoint);
+ sys::SmartScopedLock<true> Lock(*ALMutex);
+
+ AttributeListImpl *PAL =
+ AttributesLists->FindNodeOrInsertPos(ID, InsertPos);
// If we didn't find any existing attributes of the same shape then
// create a new one and insert it.
- if (!PA) {
- PA = new AttributeListImpl(Attrs);
- pImpl->AttrsLists.InsertNode(PA, InsertPoint);
+ if (!PAL) {
+ PAL = new AttributeListImpl(Attrs);
+ AttributesLists->InsertNode(PAL, InsertPos);
}
// Return the AttributesList that we found or created.
- return AttrListPtr(PA);
+ return AttrListPtr(PAL);
}
//===----------------------------------------------------------------------===//
// AttrListPtr Method Implementations
//===----------------------------------------------------------------------===//
+AttrListPtr::AttrListPtr(AttributeListImpl *LI) : AttrList(LI) {
+ if (LI) LI->AddRef();
+}
+
+AttrListPtr::AttrListPtr(const AttrListPtr &P) : AttrList(P.AttrList) {
+ if (AttrList) AttrList->AddRef();
+}
+
const AttrListPtr &AttrListPtr::operator=(const AttrListPtr &RHS) {
+ sys::SmartScopedLock<true> Lock(*ALMutex);
if (AttrList == RHS.AttrList) return *this;
-
+ if (AttrList) AttrList->DropRef();
AttrList = RHS.AttrList;
+ if (AttrList) AttrList->AddRef();
return *this;
}
+AttrListPtr::~AttrListPtr() {
+ if (AttrList) AttrList->DropRef();
+}
+
/// getNumSlots - Return the number of slots used in this attribute list.
/// This is the number of arguments that have an attribute set on them
/// (including the function itself).
@@ -438,7 +507,6 @@
for (unsigned i = 0, e = Attrs.size(); i != e; ++i)
if (Attrs[i].Attrs.hasAttribute(Attr))
return true;
-
return false;
}
@@ -494,7 +562,7 @@
OldAttrList.begin()+i, OldAttrList.end());
}
- return get(C, NewAttrList);
+ return get(NewAttrList);
}
AttrListPtr AttrListPtr::removeAttr(LLVMContext &C, unsigned Idx,
@@ -533,7 +601,7 @@
NewAttrList.insert(NewAttrList.end(),
OldAttrList.begin()+i, OldAttrList.end());
- return get(C, NewAttrList);
+ return get(NewAttrList);
}
void AttrListPtr::dump() const {
Modified: llvm/branches/release_32/lib/VMCore/AttributesImpl.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_32/lib/VMCore/AttributesImpl.h?rev=168465&r1=168464&r2=168465&view=diff
==============================================================================
--- llvm/branches/release_32/lib/VMCore/AttributesImpl.h (original)
+++ llvm/branches/release_32/lib/VMCore/AttributesImpl.h Wed Nov 21 16:21:40 2012
@@ -15,11 +15,12 @@
#ifndef LLVM_ATTRIBUTESIMPL_H
#define LLVM_ATTRIBUTESIMPL_H
-#include "llvm/Attributes.h"
#include "llvm/ADT/FoldingSet.h"
namespace llvm {
+class Attributes;
+
class AttributesImpl : public FoldingSetNode {
uint64_t Bits; // FIXME: We will be expanding this.
public:
@@ -45,27 +46,6 @@
}
};
-class AttributeListImpl : public FoldingSetNode {
- // AttributesList is uniqued, these should not be publicly available.
- void operator=(const AttributeListImpl &) LLVM_DELETED_FUNCTION;
- AttributeListImpl(const AttributeListImpl &) LLVM_DELETED_FUNCTION;
-public:
- SmallVector<AttributeWithIndex, 4> Attrs;
-
- AttributeListImpl(ArrayRef<AttributeWithIndex> attrs)
- : 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
Modified: llvm/branches/release_32/lib/VMCore/LLVMContextImpl.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_32/lib/VMCore/LLVMContextImpl.cpp?rev=168465&r1=168464&r2=168465&view=diff
==============================================================================
--- llvm/branches/release_32/lib/VMCore/LLVMContextImpl.cpp (original)
+++ llvm/branches/release_32/lib/VMCore/LLVMContextImpl.cpp Wed Nov 21 16:21:40 2012
@@ -97,18 +97,11 @@
// Destroy attributes.
for (FoldingSetIterator<AttributesImpl> I = AttrsSet.begin(),
- E = AttrsSet.end(); I != E; ) {
+ E = AttrsSet.end(); I != E;) {
FoldingSetIterator<AttributesImpl> Elem = I++;
delete &*Elem;
}
- // Destroy attribute lists.
- for (FoldingSetIterator<AttributeListImpl> I = AttrsLists.begin(),
- E = AttrsLists.end(); I != E; ) {
- FoldingSetIterator<AttributeListImpl> Elem = I++;
- delete &*Elem;
- }
-
// Destroy MDNodes. ~MDNode can move and remove nodes between the MDNodeSet
// and the NonUniquedMDNodes sets, so copy the values out first.
SmallVector<MDNode*, 8> MDNodes;
Modified: llvm/branches/release_32/lib/VMCore/LLVMContextImpl.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_32/lib/VMCore/LLVMContextImpl.h?rev=168465&r1=168464&r2=168465&view=diff
==============================================================================
--- llvm/branches/release_32/lib/VMCore/LLVMContextImpl.h (original)
+++ llvm/branches/release_32/lib/VMCore/LLVMContextImpl.h Wed Nov 21 16:21:40 2012
@@ -256,8 +256,7 @@
FPMapTy FPConstants;
FoldingSet<AttributesImpl> AttrsSet;
- FoldingSet<AttributeListImpl> AttrsLists;
-
+
StringMap<Value*> MDStringCache;
FoldingSet<MDNode> MDNodeSet;
Modified: llvm/branches/release_32/utils/TableGen/IntrinsicEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_32/utils/TableGen/IntrinsicEmitter.cpp?rev=168465&r1=168464&r2=168465&view=diff
==============================================================================
--- llvm/branches/release_32/utils/TableGen/IntrinsicEmitter.cpp (original)
+++ llvm/branches/release_32/utils/TableGen/IntrinsicEmitter.cpp Wed Nov 21 16:21:40 2012
@@ -621,7 +621,7 @@
OS << " }\n";
OS << " }\n";
- OS << " return AttrListPtr::get(C, ArrayRef<AttributeWithIndex>(AWI, "
+ OS << " return AttrListPtr::get(ArrayRef<AttributeWithIndex>(AWI, "
"NumAttrs));\n";
OS << "}\n";
OS << "#endif // GET_INTRINSIC_ATTRIBUTES\n\n";
More information about the llvm-branch-commits
mailing list