use llvm:Attributes instead of unsigned

llvm-svn: 148554
This commit is contained in:
Kostya Serebryany 2012-01-20 17:57:16 +00:00
parent a5054ad2f3
commit ca95aa03f9
1 changed files with 10 additions and 10 deletions

View File

@ -733,8 +733,8 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI,
const Decl *TargetDecl,
AttributeListType &PAL,
unsigned &CallingConv) {
unsigned FuncAttrs = 0;
unsigned RetAttrs = 0;
llvm::Attributes FuncAttrs;
llvm::Attributes RetAttrs;
CallingConv = FI.getEffectiveCallingConvention();
@ -820,7 +820,7 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI,
ie = FI.arg_end(); it != ie; ++it) {
QualType ParamType = it->type;
const ABIArgInfo &AI = it->info;
unsigned Attributes = 0;
llvm::Attributes Attrs;
// 'restrict' -> 'noalias' is done in EmitFunctionProlog when we
// have the corresponding parameter variable. It doesn't make
@ -828,9 +828,9 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI,
switch (AI.getKind()) {
case ABIArgInfo::Extend:
if (ParamType->isSignedIntegerOrEnumerationType())
Attributes |= llvm::Attribute::SExt;
Attrs |= llvm::Attribute::SExt;
else if (ParamType->isUnsignedIntegerOrEnumerationType())
Attributes |= llvm::Attribute::ZExt;
Attrs |= llvm::Attribute::ZExt;
// FALL THROUGH
case ABIArgInfo::Direct:
if (RegParm > 0 &&
@ -839,7 +839,7 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI,
RegParm -=
(Context.getTypeSize(ParamType) + PointerWidth - 1) / PointerWidth;
if (RegParm >= 0)
Attributes |= llvm::Attribute::InReg;
Attrs |= llvm::Attribute::InReg;
}
// FIXME: handle sseregparm someday...
@ -853,9 +853,9 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI,
case ABIArgInfo::Indirect:
if (AI.getIndirectByVal())
Attributes |= llvm::Attribute::ByVal;
Attrs |= llvm::Attribute::ByVal;
Attributes |=
Attrs |=
llvm::Attribute::constructAlignmentFromInt(AI.getIndirectAlign());
// byval disables readnone and readonly.
FuncAttrs &= ~(llvm::Attribute::ReadOnly |
@ -877,8 +877,8 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI,
}
}
if (Attributes)
PAL.push_back(llvm::AttributeWithIndex::get(Index, Attributes));
if (Attrs)
PAL.push_back(llvm::AttributeWithIndex::get(Index, Attrs));
++Index;
}
if (FuncAttrs)