From: Kostya Serebryany Date: Fri, 20 Jan 2012 17:57:16 +0000 (+0000) Subject: use llvm:Attributes instead of unsigned X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c891666f477bfee387c10a429038eb6d98e9d175;p=clang use llvm:Attributes instead of unsigned git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148554 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp index 72b40d3d59..1de8f0e3f9 100644 --- a/lib/CodeGen/CGCall.cpp +++ b/lib/CodeGen/CGCall.cpp @@ -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)