ArgTypeIterator end,
AttributeListType &PAL) {
unsigned FuncAttrs = 0;
+ unsigned RetAttrs = 0;
if (TargetDecl) {
if (TargetDecl->getAttr<NoThrowAttr>())
case ABIArgInfo::Default:
if (RetTy->isPromotableIntegerType()) {
if (RetTy->isSignedIntegerType()) {
- FuncAttrs |= llvm::Attribute::SExt;
+ RetAttrs |= llvm::Attribute::SExt;
} else if (RetTy->isUnsignedIntegerType()) {
- FuncAttrs |= llvm::Attribute::ZExt;
+ RetAttrs |= llvm::Attribute::ZExt;
}
}
break;
assert(0 && "Invalid ABI kind for return argument");
}
- if (FuncAttrs)
- PAL.push_back(llvm::AttributeWithIndex::get(0, FuncAttrs));
+ if (RetAttrs)
+ PAL.push_back(llvm::AttributeWithIndex::get(0, RetAttrs));
for (++begin; begin != end; ++begin) {
QualType ParamType = *begin;
unsigned Attributes = 0;
PAL.push_back(llvm::AttributeWithIndex::get(Index, Attributes));
++Index;
}
+ if (FuncAttrs)
+ PAL.push_back(llvm::AttributeWithIndex::get(~0, FuncAttrs));
+
}
void CodeGenFunction::EmitFunctionProlog(llvm::Function *Fn,
}
if (!Features.Exceptions)
- F->addAttribute(0, llvm::Attribute::NoUnwind);
+ F->addAttribute(~0, llvm::Attribute::NoUnwind);
}
void CodeGenModule::SetMethodAttributes(const ObjCMethodDecl *MD,