mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-13 09:33:50 +00:00
s/ParamAttrsWithIndex/FnAttributeWithIndex/g
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56535 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3d8cd9ec10
commit
e3d76d37e9
@ -89,12 +89,12 @@ const Attributes OptimizeForSize = 1<<2; // opt_size
|
||||
|
||||
/// This is just a pair of values to associate a set of parameter attributes
|
||||
/// with a parameter index.
|
||||
struct ParamAttrsWithIndex {
|
||||
struct FnAttributeWithIndex {
|
||||
Attributes Attrs; ///< The attributes that are set, or'd together.
|
||||
unsigned Index; ///< Index of the parameter for which the attributes apply.
|
||||
|
||||
static ParamAttrsWithIndex get(unsigned Idx, Attributes Attrs) {
|
||||
ParamAttrsWithIndex P;
|
||||
static FnAttributeWithIndex get(unsigned Idx, Attributes Attrs) {
|
||||
FnAttributeWithIndex P;
|
||||
P.Index = Idx;
|
||||
P.Attrs = Attrs;
|
||||
return P;
|
||||
@ -124,7 +124,7 @@ public:
|
||||
//===--------------------------------------------------------------------===//
|
||||
|
||||
/// get - Return a ParamAttrs list with the specified parameter in it.
|
||||
static PAListPtr get(const ParamAttrsWithIndex *Attr, unsigned NumAttrs);
|
||||
static PAListPtr get(const FnAttributeWithIndex *Attr, unsigned NumAttrs);
|
||||
|
||||
/// get - Return a ParamAttr list with the parameters specified by the
|
||||
/// consecutive random access iterator range.
|
||||
@ -199,9 +199,9 @@ public:
|
||||
/// (including the function itself).
|
||||
unsigned getNumSlots() const;
|
||||
|
||||
/// getSlot - Return the ParamAttrsWithIndex at the specified slot. This
|
||||
/// getSlot - Return the FnAttributeWithIndex at the specified slot. This
|
||||
/// holds a parameter number plus a set of attributes.
|
||||
const ParamAttrsWithIndex &getSlot(unsigned Slot) const;
|
||||
const FnAttributeWithIndex &getSlot(unsigned Slot) const;
|
||||
|
||||
private:
|
||||
explicit PAListPtr(AttributeListImpl *L);
|
||||
|
@ -322,7 +322,7 @@ bool BitcodeReader::ParseParamAttrBlock() {
|
||||
|
||||
SmallVector<uint64_t, 64> Record;
|
||||
|
||||
SmallVector<ParamAttrsWithIndex, 8> Attrs;
|
||||
SmallVector<FnAttributeWithIndex, 8> Attrs;
|
||||
|
||||
// Read all the records.
|
||||
while (1) {
|
||||
@ -357,7 +357,7 @@ bool BitcodeReader::ParseParamAttrBlock() {
|
||||
|
||||
for (unsigned i = 0, e = Record.size(); i != e; i += 2) {
|
||||
if (Record[i+1] != ParamAttr::None)
|
||||
Attrs.push_back(ParamAttrsWithIndex::get(Record[i], Record[i+1]));
|
||||
Attrs.push_back(FnAttributeWithIndex::get(Record[i], Record[i+1]));
|
||||
}
|
||||
|
||||
ParamAttrs.push_back(PAListPtr::get(Attrs.begin(), Attrs.end()));
|
||||
|
@ -119,7 +119,7 @@ static void WriteParamAttrTable(const ValueEnumerator &VE,
|
||||
for (unsigned i = 0, e = Attrs.size(); i != e; ++i) {
|
||||
const PAListPtr &A = Attrs[i];
|
||||
for (unsigned i = 0, e = A.getNumSlots(); i != e; ++i) {
|
||||
const ParamAttrsWithIndex &PAWI = A.getSlot(i);
|
||||
const FnAttributeWithIndex &PAWI = A.getSlot(i);
|
||||
Record.push_back(PAWI.Index);
|
||||
Record.push_back(PAWI.Attrs);
|
||||
}
|
||||
|
@ -434,8 +434,8 @@ namespace {
|
||||
nl(Out);
|
||||
if (!PAL.isEmpty()) {
|
||||
Out << '{'; in(); nl(Out);
|
||||
Out << "SmallVector<ParamAttrsWithIndex, 4> Attrs;"; nl(Out);
|
||||
Out << "ParamAttrsWithIndex PAWI;"; nl(Out);
|
||||
Out << "SmallVector<FnAttributeWithIndex, 4> Attrs;"; nl(Out);
|
||||
Out << "FnAttributeWithIndex PAWI;"; nl(Out);
|
||||
for (unsigned i = 0; i < PAL.getNumSlots(); ++i) {
|
||||
uint16_t index = PAL.getSlot(i).Index;
|
||||
Attributes attrs = PAL.getSlot(i).Attrs;
|
||||
|
@ -504,12 +504,12 @@ Function *ArgPromotion::DoPromotion(Function *F,
|
||||
// ParamAttrs - Keep track of the parameter attributes for the arguments
|
||||
// that we are *not* promoting. For the ones that we do promote, the parameter
|
||||
// attributes are lost
|
||||
SmallVector<ParamAttrsWithIndex, 8> ParamAttrsVec;
|
||||
SmallVector<FnAttributeWithIndex, 8> ParamAttrsVec;
|
||||
const PAListPtr &PAL = F->getParamAttrs();
|
||||
|
||||
// Add any return attributes.
|
||||
if (Attributes attrs = PAL.getParamAttrs(0))
|
||||
ParamAttrsVec.push_back(ParamAttrsWithIndex::get(0, attrs));
|
||||
ParamAttrsVec.push_back(FnAttributeWithIndex::get(0, attrs));
|
||||
|
||||
// First, determine the new argument list
|
||||
unsigned ArgIndex = 1;
|
||||
@ -526,7 +526,7 @@ Function *ArgPromotion::DoPromotion(Function *F,
|
||||
// Unchanged argument
|
||||
Params.push_back(I->getType());
|
||||
if (Attributes attrs = PAL.getParamAttrs(ArgIndex))
|
||||
ParamAttrsVec.push_back(ParamAttrsWithIndex::get(Params.size(), attrs));
|
||||
ParamAttrsVec.push_back(FnAttributeWithIndex::get(Params.size(), attrs));
|
||||
} else if (I->use_empty()) {
|
||||
// Dead argument (which are always marked as promotable)
|
||||
++NumArgumentsDead;
|
||||
@ -622,7 +622,7 @@ Function *ArgPromotion::DoPromotion(Function *F,
|
||||
|
||||
// Add any return attributes.
|
||||
if (Attributes attrs = CallPAL.getParamAttrs(0))
|
||||
ParamAttrsVec.push_back(ParamAttrsWithIndex::get(0, attrs));
|
||||
ParamAttrsVec.push_back(FnAttributeWithIndex::get(0, attrs));
|
||||
|
||||
// Loop over the operands, inserting GEP and loads in the caller as
|
||||
// appropriate.
|
||||
@ -634,7 +634,7 @@ Function *ArgPromotion::DoPromotion(Function *F,
|
||||
Args.push_back(*AI); // Unmodified argument
|
||||
|
||||
if (Attributes Attrs = CallPAL.getParamAttrs(ArgIndex))
|
||||
ParamAttrsVec.push_back(ParamAttrsWithIndex::get(Args.size(), Attrs));
|
||||
ParamAttrsVec.push_back(FnAttributeWithIndex::get(Args.size(), Attrs));
|
||||
|
||||
} else if (ByValArgsToTransform.count(I)) {
|
||||
// Emit a GEP and load for each element of the struct.
|
||||
@ -689,7 +689,7 @@ Function *ArgPromotion::DoPromotion(Function *F,
|
||||
for (; AI != CS.arg_end(); ++AI, ++ArgIndex) {
|
||||
Args.push_back(*AI);
|
||||
if (Attributes Attrs = CallPAL.getParamAttrs(ArgIndex))
|
||||
ParamAttrsVec.push_back(ParamAttrsWithIndex::get(Args.size(), Attrs));
|
||||
ParamAttrsVec.push_back(FnAttributeWithIndex::get(Args.size(), Attrs));
|
||||
}
|
||||
|
||||
Instruction *New;
|
||||
|
@ -226,7 +226,7 @@ bool DAE::DeleteDeadVarargs(Function &Fn) {
|
||||
// Drop any attributes that were on the vararg arguments.
|
||||
PAListPtr PAL = CS.getParamAttrs();
|
||||
if (!PAL.isEmpty() && PAL.getSlot(PAL.getNumSlots() - 1).Index > NumArgs) {
|
||||
SmallVector<ParamAttrsWithIndex, 8> ParamAttrsVec;
|
||||
SmallVector<FnAttributeWithIndex, 8> ParamAttrsVec;
|
||||
for (unsigned i = 0; PAL.getSlot(i).Index <= NumArgs; ++i)
|
||||
ParamAttrsVec.push_back(PAL.getSlot(i));
|
||||
PAL = PAListPtr::get(ParamAttrsVec.begin(), ParamAttrsVec.end());
|
||||
@ -589,7 +589,7 @@ bool DAE::RemoveDeadStuffFromFunction(Function *F) {
|
||||
std::vector<const Type*> Params;
|
||||
|
||||
// Set up to build a new list of parameter attributes.
|
||||
SmallVector<ParamAttrsWithIndex, 8> ParamAttrsVec;
|
||||
SmallVector<FnAttributeWithIndex, 8> ParamAttrsVec;
|
||||
const PAListPtr &PAL = F->getParamAttrs();
|
||||
|
||||
// The existing function return attributes.
|
||||
@ -661,7 +661,7 @@ bool DAE::RemoveDeadStuffFromFunction(Function *F) {
|
||||
&& "Return attributes no longer compatible?");
|
||||
|
||||
if (RAttrs)
|
||||
ParamAttrsVec.push_back(ParamAttrsWithIndex::get(0, RAttrs));
|
||||
ParamAttrsVec.push_back(FnAttributeWithIndex::get(0, RAttrs));
|
||||
|
||||
// Remember which arguments are still alive.
|
||||
SmallVector<bool, 10> ArgAlive(FTy->getNumParams(), false);
|
||||
@ -679,7 +679,7 @@ bool DAE::RemoveDeadStuffFromFunction(Function *F) {
|
||||
// Get the original parameter attributes (skipping the first one, that is
|
||||
// for the return value.
|
||||
if (Attributes Attrs = PAL.getParamAttrs(i + 1))
|
||||
ParamAttrsVec.push_back(ParamAttrsWithIndex::get(Params.size(), Attrs));
|
||||
ParamAttrsVec.push_back(FnAttributeWithIndex::get(Params.size(), Attrs));
|
||||
} else {
|
||||
++NumArgumentsEliminated;
|
||||
DOUT << "DAE - Removing argument " << i << " (" << I->getNameStart()
|
||||
@ -734,7 +734,7 @@ bool DAE::RemoveDeadStuffFromFunction(Function *F) {
|
||||
// Adjust in case the function was changed to return void.
|
||||
RAttrs &= ~ParamAttr::typeIncompatible(NF->getReturnType());
|
||||
if (RAttrs)
|
||||
ParamAttrsVec.push_back(ParamAttrsWithIndex::get(0, RAttrs));
|
||||
ParamAttrsVec.push_back(FnAttributeWithIndex::get(0, RAttrs));
|
||||
|
||||
// Declare these outside of the loops, so we can reuse them for the second
|
||||
// loop, which loops the varargs.
|
||||
@ -747,7 +747,7 @@ bool DAE::RemoveDeadStuffFromFunction(Function *F) {
|
||||
Args.push_back(*I);
|
||||
// Get original parameter attributes, but skip return attributes.
|
||||
if (Attributes Attrs = CallPAL.getParamAttrs(i + 1))
|
||||
ParamAttrsVec.push_back(ParamAttrsWithIndex::get(Args.size(), Attrs));
|
||||
ParamAttrsVec.push_back(FnAttributeWithIndex::get(Args.size(), Attrs));
|
||||
}
|
||||
|
||||
if (ExtraArgHack)
|
||||
@ -757,7 +757,7 @@ bool DAE::RemoveDeadStuffFromFunction(Function *F) {
|
||||
for (CallSite::arg_iterator E = CS.arg_end(); I != E; ++I, ++i) {
|
||||
Args.push_back(*I);
|
||||
if (Attributes Attrs = CallPAL.getParamAttrs(i + 1))
|
||||
ParamAttrsVec.push_back(ParamAttrsWithIndex::get(Args.size(), Attrs));
|
||||
ParamAttrsVec.push_back(FnAttributeWithIndex::get(Args.size(), Attrs));
|
||||
}
|
||||
|
||||
// Reconstruct the ParamAttrsList based on the vector we constructed.
|
||||
|
@ -206,12 +206,12 @@ Function *SRETPromotion::cloneFunctionBody(Function *F,
|
||||
std::vector<const Type*> Params;
|
||||
|
||||
// ParamAttrs - Keep track of the parameter attributes for the arguments.
|
||||
SmallVector<ParamAttrsWithIndex, 8> ParamAttrsVec;
|
||||
SmallVector<FnAttributeWithIndex, 8> ParamAttrsVec;
|
||||
const PAListPtr &PAL = F->getParamAttrs();
|
||||
|
||||
// Add any return attributes.
|
||||
if (Attributes attrs = PAL.getParamAttrs(0))
|
||||
ParamAttrsVec.push_back(ParamAttrsWithIndex::get(0, attrs));
|
||||
ParamAttrsVec.push_back(FnAttributeWithIndex::get(0, attrs));
|
||||
|
||||
// Skip first argument.
|
||||
Function::arg_iterator I = F->arg_begin(), E = F->arg_end();
|
||||
@ -222,7 +222,7 @@ Function *SRETPromotion::cloneFunctionBody(Function *F,
|
||||
while (I != E) {
|
||||
Params.push_back(I->getType());
|
||||
if (Attributes Attrs = PAL.getParamAttrs(ParamIndex))
|
||||
ParamAttrsVec.push_back(ParamAttrsWithIndex::get(ParamIndex - 1, Attrs));
|
||||
ParamAttrsVec.push_back(FnAttributeWithIndex::get(ParamIndex - 1, Attrs));
|
||||
++I;
|
||||
++ParamIndex;
|
||||
}
|
||||
@ -256,7 +256,7 @@ void SRETPromotion::updateCallSites(Function *F, Function *NF) {
|
||||
SmallVector<Value*, 16> Args;
|
||||
|
||||
// ParamAttrs - Keep track of the parameter attributes for the arguments.
|
||||
SmallVector<ParamAttrsWithIndex, 8> ArgAttrsVec;
|
||||
SmallVector<FnAttributeWithIndex, 8> ArgAttrsVec;
|
||||
|
||||
while (!F->use_empty()) {
|
||||
CallSite CS = CallSite::get(*F->use_begin());
|
||||
@ -265,7 +265,7 @@ void SRETPromotion::updateCallSites(Function *F, Function *NF) {
|
||||
const PAListPtr &PAL = F->getParamAttrs();
|
||||
// Add any return attributes.
|
||||
if (Attributes attrs = PAL.getParamAttrs(0))
|
||||
ArgAttrsVec.push_back(ParamAttrsWithIndex::get(0, attrs));
|
||||
ArgAttrsVec.push_back(FnAttributeWithIndex::get(0, attrs));
|
||||
|
||||
// Copy arguments, however skip first one.
|
||||
CallSite::arg_iterator AI = CS.arg_begin(), AE = CS.arg_end();
|
||||
@ -277,7 +277,7 @@ void SRETPromotion::updateCallSites(Function *F, Function *NF) {
|
||||
while (AI != AE) {
|
||||
Args.push_back(*AI);
|
||||
if (Attributes Attrs = PAL.getParamAttrs(ParamIndex))
|
||||
ArgAttrsVec.push_back(ParamAttrsWithIndex::get(ParamIndex - 1, Attrs));
|
||||
ArgAttrsVec.push_back(FnAttributeWithIndex::get(ParamIndex - 1, Attrs));
|
||||
++ParamIndex;
|
||||
++AI;
|
||||
}
|
||||
|
@ -9189,7 +9189,7 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) {
|
||||
// inserting cast instructions as necessary...
|
||||
std::vector<Value*> Args;
|
||||
Args.reserve(NumActualArgs);
|
||||
SmallVector<ParamAttrsWithIndex, 8> attrVec;
|
||||
SmallVector<FnAttributeWithIndex, 8> attrVec;
|
||||
attrVec.reserve(NumCommonArgs);
|
||||
|
||||
// Get any return attributes.
|
||||
@ -9201,7 +9201,7 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) {
|
||||
|
||||
// Add the new return attributes.
|
||||
if (RAttrs)
|
||||
attrVec.push_back(ParamAttrsWithIndex::get(0, RAttrs));
|
||||
attrVec.push_back(FnAttributeWithIndex::get(0, RAttrs));
|
||||
|
||||
AI = CS.arg_begin();
|
||||
for (unsigned i = 0; i != NumCommonArgs; ++i, ++AI) {
|
||||
@ -9217,7 +9217,7 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) {
|
||||
|
||||
// Add any parameter attributes.
|
||||
if (Attributes PAttrs = CallerPAL.getParamAttrs(i + 1))
|
||||
attrVec.push_back(ParamAttrsWithIndex::get(i + 1, PAttrs));
|
||||
attrVec.push_back(FnAttributeWithIndex::get(i + 1, PAttrs));
|
||||
}
|
||||
|
||||
// If the function takes more arguments than the call was taking, add them
|
||||
@ -9247,7 +9247,7 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) {
|
||||
|
||||
// Add any parameter attributes.
|
||||
if (Attributes PAttrs = CallerPAL.getParamAttrs(i + 1))
|
||||
attrVec.push_back(ParamAttrsWithIndex::get(i + 1, PAttrs));
|
||||
attrVec.push_back(FnAttributeWithIndex::get(i + 1, PAttrs));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -9346,7 +9346,7 @@ Instruction *InstCombiner::transformCallThroughTrampoline(CallSite CS) {
|
||||
std::vector<Value*> NewArgs;
|
||||
NewArgs.reserve(unsigned(CS.arg_end()-CS.arg_begin())+1);
|
||||
|
||||
SmallVector<ParamAttrsWithIndex, 8> NewAttrs;
|
||||
SmallVector<FnAttributeWithIndex, 8> NewAttrs;
|
||||
NewAttrs.reserve(Attrs.getNumSlots() + 1);
|
||||
|
||||
// Insert the nest argument into the call argument list, which may
|
||||
@ -9354,7 +9354,7 @@ Instruction *InstCombiner::transformCallThroughTrampoline(CallSite CS) {
|
||||
|
||||
// Add any function result attributes.
|
||||
if (Attributes Attr = Attrs.getParamAttrs(0))
|
||||
NewAttrs.push_back(ParamAttrsWithIndex::get(0, Attr));
|
||||
NewAttrs.push_back(FnAttributeWithIndex::get(0, Attr));
|
||||
|
||||
{
|
||||
unsigned Idx = 1;
|
||||
@ -9366,7 +9366,7 @@ Instruction *InstCombiner::transformCallThroughTrampoline(CallSite CS) {
|
||||
if (NestVal->getType() != NestTy)
|
||||
NestVal = new BitCastInst(NestVal, NestTy, "nest", Caller);
|
||||
NewArgs.push_back(NestVal);
|
||||
NewAttrs.push_back(ParamAttrsWithIndex::get(NestIdx, NestAttr));
|
||||
NewAttrs.push_back(FnAttributeWithIndex::get(NestIdx, NestAttr));
|
||||
}
|
||||
|
||||
if (I == E)
|
||||
@ -9376,7 +9376,7 @@ Instruction *InstCombiner::transformCallThroughTrampoline(CallSite CS) {
|
||||
NewArgs.push_back(*I);
|
||||
if (Attributes Attr = Attrs.getParamAttrs(Idx))
|
||||
NewAttrs.push_back
|
||||
(ParamAttrsWithIndex::get(Idx + (Idx >= NestIdx), Attr));
|
||||
(FnAttributeWithIndex::get(Idx + (Idx >= NestIdx), Attr));
|
||||
|
||||
++Idx, ++I;
|
||||
} while (1);
|
||||
|
@ -84,9 +84,9 @@ class AttributeListImpl : public FoldingSetNode {
|
||||
AttributeListImpl(const AttributeListImpl &); // Do not implement
|
||||
~AttributeListImpl(); // Private implementation
|
||||
public:
|
||||
SmallVector<ParamAttrsWithIndex, 4> Attrs;
|
||||
SmallVector<FnAttributeWithIndex, 4> Attrs;
|
||||
|
||||
AttributeListImpl(const ParamAttrsWithIndex *Attr, unsigned NumAttrs)
|
||||
AttributeListImpl(const FnAttributeWithIndex *Attr, unsigned NumAttrs)
|
||||
: Attrs(Attr, Attr+NumAttrs) {
|
||||
RefCount = 0;
|
||||
}
|
||||
@ -97,7 +97,7 @@ public:
|
||||
void Profile(FoldingSetNodeID &ID) const {
|
||||
Profile(ID, &Attrs[0], Attrs.size());
|
||||
}
|
||||
static void Profile(FoldingSetNodeID &ID, const ParamAttrsWithIndex *Attr,
|
||||
static void Profile(FoldingSetNodeID &ID, const FnAttributeWithIndex *Attr,
|
||||
unsigned NumAttrs) {
|
||||
for (unsigned i = 0; i != NumAttrs; ++i)
|
||||
ID.AddInteger(uint64_t(Attr[i].Attrs) << 32 | unsigned(Attr[i].Index));
|
||||
@ -112,7 +112,7 @@ AttributeListImpl::~AttributeListImpl() {
|
||||
}
|
||||
|
||||
|
||||
PAListPtr PAListPtr::get(const ParamAttrsWithIndex *Attrs, unsigned NumAttrs) {
|
||||
PAListPtr PAListPtr::get(const FnAttributeWithIndex *Attrs, unsigned NumAttrs) {
|
||||
// If there are no attributes then return a null ParamAttrsList pointer.
|
||||
if (NumAttrs == 0)
|
||||
return PAListPtr();
|
||||
@ -176,9 +176,9 @@ unsigned PAListPtr::getNumSlots() const {
|
||||
return PAList ? PAList->Attrs.size() : 0;
|
||||
}
|
||||
|
||||
/// getSlot - Return the ParamAttrsWithIndex at the specified slot. This
|
||||
/// getSlot - Return the FnAttributeWithIndex at the specified slot. This
|
||||
/// holds a parameter number plus a set of attributes.
|
||||
const ParamAttrsWithIndex &PAListPtr::getSlot(unsigned Slot) const {
|
||||
const FnAttributeWithIndex &PAListPtr::getSlot(unsigned Slot) const {
|
||||
assert(PAList && Slot < PAList->Attrs.size() && "Slot # out of range!");
|
||||
return PAList->Attrs[Slot];
|
||||
}
|
||||
@ -190,7 +190,7 @@ const ParamAttrsWithIndex &PAListPtr::getSlot(unsigned Slot) const {
|
||||
Attributes PAListPtr::getParamAttrs(unsigned Idx) const {
|
||||
if (PAList == 0) return ParamAttr::None;
|
||||
|
||||
const SmallVector<ParamAttrsWithIndex, 4> &Attrs = PAList->Attrs;
|
||||
const SmallVector<FnAttributeWithIndex, 4> &Attrs = PAList->Attrs;
|
||||
for (unsigned i = 0, e = Attrs.size(); i != e && Attrs[i].Index <= Idx; ++i)
|
||||
if (Attrs[i].Index == Idx)
|
||||
return Attrs[i].Attrs;
|
||||
@ -202,7 +202,7 @@ Attributes PAListPtr::getParamAttrs(unsigned Idx) const {
|
||||
bool PAListPtr::hasAttrSomewhere(Attributes Attr) const {
|
||||
if (PAList == 0) return false;
|
||||
|
||||
const SmallVector<ParamAttrsWithIndex, 4> &Attrs = PAList->Attrs;
|
||||
const SmallVector<FnAttributeWithIndex, 4> &Attrs = PAList->Attrs;
|
||||
for (unsigned i = 0, e = Attrs.size(); i != e; ++i)
|
||||
if (Attrs[i].Attrs & Attr)
|
||||
return true;
|
||||
@ -225,11 +225,11 @@ PAListPtr PAListPtr::addAttr(unsigned Idx, Attributes Attrs) const {
|
||||
if (NewAttrs == OldAttrs)
|
||||
return *this;
|
||||
|
||||
SmallVector<ParamAttrsWithIndex, 8> NewAttrList;
|
||||
SmallVector<FnAttributeWithIndex, 8> NewAttrList;
|
||||
if (PAList == 0)
|
||||
NewAttrList.push_back(ParamAttrsWithIndex::get(Idx, Attrs));
|
||||
NewAttrList.push_back(FnAttributeWithIndex::get(Idx, Attrs));
|
||||
else {
|
||||
const SmallVector<ParamAttrsWithIndex, 4> &OldAttrList = PAList->Attrs;
|
||||
const SmallVector<FnAttributeWithIndex, 4> &OldAttrList = PAList->Attrs;
|
||||
unsigned i = 0, e = OldAttrList.size();
|
||||
// Copy attributes for arguments before this one.
|
||||
for (; i != e && OldAttrList[i].Index < Idx; ++i)
|
||||
@ -241,7 +241,7 @@ PAListPtr PAListPtr::addAttr(unsigned Idx, Attributes Attrs) const {
|
||||
++i;
|
||||
}
|
||||
|
||||
NewAttrList.push_back(ParamAttrsWithIndex::get(Idx, Attrs));
|
||||
NewAttrList.push_back(FnAttributeWithIndex::get(Idx, Attrs));
|
||||
|
||||
// Copy attributes for arguments after this one.
|
||||
NewAttrList.insert(NewAttrList.end(),
|
||||
@ -264,8 +264,8 @@ PAListPtr PAListPtr::removeAttr(unsigned Idx, Attributes Attrs) const {
|
||||
if (NewAttrs == OldAttrs)
|
||||
return *this;
|
||||
|
||||
SmallVector<ParamAttrsWithIndex, 8> NewAttrList;
|
||||
const SmallVector<ParamAttrsWithIndex, 4> &OldAttrList = PAList->Attrs;
|
||||
SmallVector<FnAttributeWithIndex, 8> NewAttrList;
|
||||
const SmallVector<FnAttributeWithIndex, 4> &OldAttrList = PAList->Attrs;
|
||||
unsigned i = 0, e = OldAttrList.size();
|
||||
|
||||
// Copy attributes for arguments before this one.
|
||||
@ -277,7 +277,7 @@ PAListPtr PAListPtr::removeAttr(unsigned Idx, Attributes Attrs) const {
|
||||
Attrs = OldAttrList[i].Attrs & ~Attrs;
|
||||
++i;
|
||||
if (Attrs) // If any attributes left for this parameter, add them.
|
||||
NewAttrList.push_back(ParamAttrsWithIndex::get(Idx, Attrs));
|
||||
NewAttrList.push_back(FnAttributeWithIndex::get(Idx, Attrs));
|
||||
|
||||
// Copy attributes for arguments after this one.
|
||||
NewAttrList.insert(NewAttrList.end(),
|
||||
@ -289,7 +289,7 @@ PAListPtr PAListPtr::removeAttr(unsigned Idx, Attributes Attrs) const {
|
||||
void PAListPtr::dump() const {
|
||||
cerr << "PAL[ ";
|
||||
for (unsigned i = 0; i < getNumSlots(); ++i) {
|
||||
const ParamAttrsWithIndex &PAWI = getSlot(i);
|
||||
const FnAttributeWithIndex &PAWI = getSlot(i);
|
||||
cerr << "{" << PAWI.Index << "," << PAWI.Attrs << "} ";
|
||||
}
|
||||
|
||||
|
@ -365,7 +365,7 @@ PAListPtr Intrinsic::getParamAttrs(ID id) {
|
||||
// Intrinsics cannot throw exceptions.
|
||||
Attr |= ParamAttr::NoUnwind;
|
||||
|
||||
ParamAttrsWithIndex PAWI = ParamAttrsWithIndex::get(0, Attr);
|
||||
FnAttributeWithIndex PAWI = FnAttributeWithIndex::get(0, Attr);
|
||||
return PAListPtr::get(&PAWI, 1);
|
||||
}
|
||||
|
||||
|
@ -455,7 +455,7 @@ void Verifier::VerifyFunctionAttrs(const FunctionType *FT,
|
||||
bool SawNest = false;
|
||||
|
||||
for (unsigned i = 0, e = Attrs.getNumSlots(); i != e; ++i) {
|
||||
const ParamAttrsWithIndex &Attr = Attrs.getSlot(i);
|
||||
const FnAttributeWithIndex &Attr = Attrs.getSlot(i);
|
||||
|
||||
const Type *Ty;
|
||||
if (Attr.Index == 0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user