From 5362a71c02e7d448a8ce98cf00c47e353fba5d04 Mon Sep 17 00:00:00 2001 From: Ed Schouten Date: Sat, 4 Jul 2009 13:58:54 +0000 Subject: Import Clang r74788. --- lib/CodeGen/CGCall.cpp | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'lib/CodeGen/CGCall.cpp') diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp index 30c5d28c227e..97391bc620be 100644 --- a/lib/CodeGen/CGCall.cpp +++ b/lib/CodeGen/CGCall.cpp @@ -142,8 +142,8 @@ void CodeGenTypes::GetExpandedTypes(QualType Ty, assert(!RD->hasFlexibleArrayMember() && "Cannot expand structure with flexible array."); - for (RecordDecl::field_iterator i = RD->field_begin(Context), - e = RD->field_end(Context); i != e; ++i) { + for (RecordDecl::field_iterator i = RD->field_begin(), e = RD->field_end(); + i != e; ++i) { const FieldDecl *FD = *i; assert(!FD->isBitField() && "Cannot expand structure with bit-field members."); @@ -167,8 +167,8 @@ CodeGenFunction::ExpandTypeFromArgs(QualType Ty, LValue LV, assert(LV.isSimple() && "Unexpected non-simple lvalue during struct expansion."); llvm::Value *Addr = LV.getAddress(); - for (RecordDecl::field_iterator i = RD->field_begin(getContext()), - e = RD->field_end(getContext()); i != e; ++i) { + for (RecordDecl::field_iterator i = RD->field_begin(), e = RD->field_end(); + i != e; ++i) { FieldDecl *FD = *i; QualType FT = FD->getType(); @@ -194,8 +194,8 @@ CodeGenFunction::ExpandTypeToArgs(QualType Ty, RValue RV, RecordDecl *RD = RT->getDecl(); assert(RV.isAggregate() && "Unexpected rvalue during struct expansion"); llvm::Value *Addr = RV.getAggregateAddr(); - for (RecordDecl::field_iterator i = RD->field_begin(getContext()), - e = RD->field_end(getContext()); i != e; ++i) { + for (RecordDecl::field_iterator i = RD->field_begin(), e = RD->field_end(); + i != e; ++i) { FieldDecl *FD = *i; QualType FT = FD->getType(); @@ -377,13 +377,13 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI, // FIXME: handle sseregparm someday... if (TargetDecl) { - if (TargetDecl->hasAttr(getContext())) + if (TargetDecl->hasAttr()) FuncAttrs |= llvm::Attribute::NoUnwind; - if (TargetDecl->hasAttr(getContext())) + if (TargetDecl->hasAttr()) FuncAttrs |= llvm::Attribute::NoReturn; - if (TargetDecl->hasAttr(getContext())) + if (TargetDecl->hasAttr()) FuncAttrs |= llvm::Attribute::ReadNone; - else if (TargetDecl->hasAttr(getContext())) + else if (TargetDecl->hasAttr()) FuncAttrs |= llvm::Attribute::ReadOnly; } @@ -392,6 +392,11 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI, if (CompileOpts.NoImplicitFloat) FuncAttrs |= llvm::Attribute::NoImplicitFloat; + if (Features.getStackProtectorMode() == LangOptions::SSPOn) + FuncAttrs |= llvm::Attribute::StackProtect; + else if (Features.getStackProtectorMode() == LangOptions::SSPReq) + FuncAttrs |= llvm::Attribute::StackProtectReq; + QualType RetTy = FI.getReturnType(); unsigned Index = 1; const ABIArgInfo &RetAI = FI.getReturnInfo(); @@ -433,7 +438,7 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI, signed RegParm = 0; if (TargetDecl) if (const RegparmAttr *RegParmAttr - = TargetDecl->getAttr(getContext())) + = TargetDecl->getAttr()) RegParm = RegParmAttr->getNumParams(); unsigned PointerWidth = getContext().Target.getPointerWidth(0); -- cgit v1.3