Try to appease some broken compilers by using 'unsigned' instead of 'uint64_t'.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173725 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Bill Wendling 2013-01-28 22:33:39 +00:00
parent fcb979ca1a
commit 6bdbf061c3
3 changed files with 22 additions and 25 deletions

View File

@ -108,7 +108,7 @@ public:
Attribute() : pImpl(0) {} Attribute() : pImpl(0) {}
/// \brief Return a uniquified Attribute object. /// \brief Return a uniquified Attribute object.
static Attribute get(LLVMContext &Context, ArrayRef<AttrKind> Kinds); static Attribute get(LLVMContext &Context, AttrKind Kind);
static Attribute get(LLVMContext &Context, AttrBuilder &B); static Attribute get(LLVMContext &Context, AttrBuilder &B);
/// \brief Return a uniquified Attribute object that has the specific /// \brief Return a uniquified Attribute object that has the specific
@ -203,13 +203,13 @@ private:
/// \brief Create an AttributeSet with the specified parameters in it. /// \brief Create an AttributeSet with the specified parameters in it.
static AttributeSet get(LLVMContext &C, static AttributeSet get(LLVMContext &C,
ArrayRef<std::pair<uint64_t, Attribute> > Attrs); ArrayRef<std::pair<unsigned, Attribute> > Attrs);
static AttributeSet get(LLVMContext &C, static AttributeSet get(LLVMContext &C,
ArrayRef<std::pair<uint64_t, ArrayRef<std::pair<unsigned,
AttributeSetNode*> > Attrs); AttributeSetNode*> > Attrs);
static AttributeSet getImpl(LLVMContext &C, static AttributeSet getImpl(LLVMContext &C,
ArrayRef<std::pair<uint64_t, ArrayRef<std::pair<unsigned,
AttributeSetNode*> > Attrs); AttributeSetNode*> > Attrs);

View File

@ -116,7 +116,7 @@ class AttributeSetImpl : public FoldingSetNode {
LLVMContext &Context; LLVMContext &Context;
typedef std::pair<uint64_t, AttributeSetNode*> IndexAttrPair; typedef std::pair<unsigned, AttributeSetNode*> IndexAttrPair;
SmallVector<IndexAttrPair, 4> AttrNodes; SmallVector<IndexAttrPair, 4> AttrNodes;
// AttributesSet is uniqued, these should not be publicly available. // AttributesSet is uniqued, these should not be publicly available.
@ -124,7 +124,7 @@ class AttributeSetImpl : public FoldingSetNode {
AttributeSetImpl(const AttributeSetImpl &) LLVM_DELETED_FUNCTION; AttributeSetImpl(const AttributeSetImpl &) LLVM_DELETED_FUNCTION;
public: public:
AttributeSetImpl(LLVMContext &C, AttributeSetImpl(LLVMContext &C,
ArrayRef<std::pair<uint64_t, AttributeSetNode*> > attrs) ArrayRef<std::pair<unsigned, AttributeSetNode*> > attrs)
: Context(C), AttrNodes(attrs.begin(), attrs.end()) {} : Context(C), AttrNodes(attrs.begin(), attrs.end()) {}
/// \brief Get the context that created this AttributeSetImpl. /// \brief Get the context that created this AttributeSetImpl.
@ -166,7 +166,7 @@ public:
Profile(ID, AttrNodes); Profile(ID, AttrNodes);
} }
static void Profile(FoldingSetNodeID &ID, static void Profile(FoldingSetNodeID &ID,
ArrayRef<std::pair<uint64_t, AttributeSetNode*> > Nodes) { ArrayRef<std::pair<unsigned, AttributeSetNode*> > Nodes) {
for (unsigned i = 0, e = Nodes.size(); i != e; ++i) { for (unsigned i = 0, e = Nodes.size(); i != e; ++i) {
ID.AddInteger(Nodes[i].first); ID.AddInteger(Nodes[i].first);
ID.AddPointer(Nodes[i].second); ID.AddPointer(Nodes[i].second);

View File

@ -31,12 +31,9 @@ using namespace llvm;
// Attribute Implementation // Attribute Implementation
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
Attribute Attribute::get(LLVMContext &Context, ArrayRef<AttrKind> Kinds) { Attribute Attribute::get(LLVMContext &Context, AttrKind Kind) {
AttrBuilder B; AttrBuilder B;
for (ArrayRef<AttrKind>::iterator I = Kinds.begin(), E = Kinds.end(); return Attribute::get(Context, B.addAttribute(Kind));
I != E; ++I)
B.addAttribute(*I);
return Attribute::get(Context, B);
} }
Attribute Attribute::get(LLVMContext &Context, AttrBuilder &B) { Attribute Attribute::get(LLVMContext &Context, AttrBuilder &B) {
@ -564,7 +561,7 @@ AttributeSet AttributeSet::getParamAttributes(unsigned Idx) const {
// FIXME: Remove. // FIXME: Remove.
return pImpl && hasAttributes(Idx) ? return pImpl && hasAttributes(Idx) ?
AttributeSet::get(pImpl->getContext(), AttributeSet::get(pImpl->getContext(),
ArrayRef<std::pair<uint64_t, Attribute> >( ArrayRef<std::pair<unsigned, Attribute> >(
std::make_pair(Idx, getAttributes(Idx)))) : std::make_pair(Idx, getAttributes(Idx)))) :
AttributeSet(); AttributeSet();
} }
@ -573,7 +570,7 @@ AttributeSet AttributeSet::getRetAttributes() const {
// FIXME: Remove. // FIXME: Remove.
return pImpl && hasAttributes(ReturnIndex) ? return pImpl && hasAttributes(ReturnIndex) ?
AttributeSet::get(pImpl->getContext(), AttributeSet::get(pImpl->getContext(),
ArrayRef<std::pair<uint64_t, Attribute> >( ArrayRef<std::pair<unsigned, Attribute> >(
std::make_pair(ReturnIndex, std::make_pair(ReturnIndex,
getAttributes(ReturnIndex)))) : getAttributes(ReturnIndex)))) :
AttributeSet(); AttributeSet();
@ -583,14 +580,14 @@ AttributeSet AttributeSet::getFnAttributes() const {
// FIXME: Remove. // FIXME: Remove.
return pImpl && hasAttributes(FunctionIndex) ? return pImpl && hasAttributes(FunctionIndex) ?
AttributeSet::get(pImpl->getContext(), AttributeSet::get(pImpl->getContext(),
ArrayRef<std::pair<uint64_t, Attribute> >( ArrayRef<std::pair<unsigned, Attribute> >(
std::make_pair(FunctionIndex, std::make_pair(FunctionIndex,
getAttributes(FunctionIndex)))) : getAttributes(FunctionIndex)))) :
AttributeSet(); AttributeSet();
} }
AttributeSet AttributeSet::getImpl(LLVMContext &C, AttributeSet AttributeSet::getImpl(LLVMContext &C,
ArrayRef<std::pair<uint64_t, ArrayRef<std::pair<unsigned,
AttributeSetNode*> > Attrs) { AttributeSetNode*> > Attrs) {
LLVMContextImpl *pImpl = C.pImpl; LLVMContextImpl *pImpl = C.pImpl;
FoldingSetNodeID ID; FoldingSetNodeID ID;
@ -611,7 +608,7 @@ AttributeSet AttributeSet::getImpl(LLVMContext &C,
} }
AttributeSet AttributeSet::get(LLVMContext &C, AttributeSet AttributeSet::get(LLVMContext &C,
ArrayRef<std::pair<uint64_t, Attribute> > Attrs){ ArrayRef<std::pair<unsigned, Attribute> > Attrs){
// If there are no attributes then return a null AttributesList pointer. // If there are no attributes then return a null AttributesList pointer.
if (Attrs.empty()) if (Attrs.empty())
return AttributeSet(); return AttributeSet();
@ -625,12 +622,12 @@ AttributeSet AttributeSet::get(LLVMContext &C,
} }
#endif #endif
// Create a vector if (uint64_t, AttributeSetNode*) pairs from the attributes // Create a vector if (unsigned, AttributeSetNode*) pairs from the attributes
// list. // list.
SmallVector<std::pair<uint64_t, AttributeSetNode*>, 8> AttrPairVec; SmallVector<std::pair<unsigned, AttributeSetNode*>, 8> AttrPairVec;
for (ArrayRef<std::pair<uint64_t, Attribute> >::iterator I = Attrs.begin(), for (ArrayRef<std::pair<unsigned, Attribute> >::iterator I = Attrs.begin(),
E = Attrs.end(); I != E; ) { E = Attrs.end(); I != E; ) {
uint64_t Index = I->first; unsigned Index = I->first;
SmallVector<Attribute, 4> AttrVec; SmallVector<Attribute, 4> AttrVec;
while (I->first == Index && I != E) { while (I->first == Index && I != E) {
AttrVec.push_back(I->second); AttrVec.push_back(I->second);
@ -645,7 +642,7 @@ AttributeSet AttributeSet::get(LLVMContext &C,
} }
AttributeSet AttributeSet::get(LLVMContext &C, AttributeSet AttributeSet::get(LLVMContext &C,
ArrayRef<std::pair<uint64_t, ArrayRef<std::pair<unsigned,
AttributeSetNode*> > Attrs) { AttributeSetNode*> > Attrs) {
// If there are no attributes then return a null AttributesList pointer. // If there are no attributes then return a null AttributesList pointer.
if (Attrs.empty()) if (Attrs.empty())
@ -657,13 +654,13 @@ AttributeSet AttributeSet::get(LLVMContext &C,
AttributeSet AttributeSet::get(LLVMContext &C, unsigned Idx, AttrBuilder &B) { AttributeSet AttributeSet::get(LLVMContext &C, unsigned Idx, AttrBuilder &B) {
if (!B.hasAttributes()) if (!B.hasAttributes())
return AttributeSet(); return AttributeSet();
return get(C, ArrayRef<std::pair<uint64_t, Attribute> >( return get(C, ArrayRef<std::pair<unsigned, Attribute> >(
std::make_pair(Idx, Attribute::get(C, B)))); std::make_pair(Idx, Attribute::get(C, B))));
} }
AttributeSet AttributeSet::get(LLVMContext &C, unsigned Idx, AttributeSet AttributeSet::get(LLVMContext &C, unsigned Idx,
ArrayRef<Attribute::AttrKind> Kind) { ArrayRef<Attribute::AttrKind> Kind) {
SmallVector<std::pair<uint64_t, Attribute>, 8> Attrs; SmallVector<std::pair<unsigned, Attribute>, 8> Attrs;
for (ArrayRef<Attribute::AttrKind>::iterator I = Kind.begin(), for (ArrayRef<Attribute::AttrKind>::iterator I = Kind.begin(),
E = Kind.end(); I != E; ++I) E = Kind.end(); I != E; ++I)
Attrs.push_back(std::make_pair(Idx, Attribute::get(C, *I))); Attrs.push_back(std::make_pair(Idx, Attribute::get(C, *I)));
@ -671,7 +668,7 @@ AttributeSet AttributeSet::get(LLVMContext &C, unsigned Idx,
} }
AttributeSet AttributeSet::get(LLVMContext &C, ArrayRef<AttributeSet> Attrs) { AttributeSet AttributeSet::get(LLVMContext &C, ArrayRef<AttributeSet> Attrs) {
SmallVector<std::pair<uint64_t, AttributeSetNode*>, 8> AttrNodeVec; SmallVector<std::pair<unsigned, AttributeSetNode*>, 8> AttrNodeVec;
for (unsigned I = 0, E = Attrs.size(); I != E; ++I) { for (unsigned I = 0, E = Attrs.size(); I != E; ++I) {
AttributeSet AS = Attrs[I]; AttributeSet AS = Attrs[I];
if (!AS.pImpl) continue; if (!AS.pImpl) continue;