From ca95aa03f930624b9a6852f962e66f7f0b2fee5c Mon Sep 17 00:00:00 2001 From: Kostya Serebryany Date: Fri, 20 Jan 2012 17:57:16 +0000 Subject: [PATCH] use llvm:Attributes instead of unsigned llvm-svn: 148554 --- clang/lib/CodeGen/CGCall.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp index 72b40d3d595c..1de8f0e3f9d1 100644 --- a/clang/lib/CodeGen/CGCall.cpp +++ b/clang/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)