*/
CXCursor_TranslationUnit = 300,
- /* Attribute */
+ /* Attributes */
CXCursor_FirstAttr = 400,
/**
* \brief An attribute whose specific kind is not exposed via this
};
struct Info {
- const char *Name, *Type, *Attribute, *HeaderName;
+ const char *Name, *Type, *Attributes, *HeaderName;
LanguageID builtin_lang;
bool operator==(const Info &RHS) const {
return !strcmp(Name, RHS.Name) &&
!strcmp(Type, RHS.Type) &&
- !strcmp(Attribute, RHS.Attribute);
+ !strcmp(Attributes, RHS.Attributes);
}
bool operator!=(const Info &RHS) const { return !(*this == RHS); }
};
/// \brief Return true if this function has no side effects and doesn't
/// read memory.
bool isConst(unsigned ID) const {
- return strchr(GetRecord(ID).Attribute, 'c') != 0;
+ return strchr(GetRecord(ID).Attributes, 'c') != 0;
}
/// \brief Return true if we know this builtin never throws an exception.
bool isNoThrow(unsigned ID) const {
- return strchr(GetRecord(ID).Attribute, 'n') != 0;
+ return strchr(GetRecord(ID).Attributes, 'n') != 0;
}
/// \brief Return true if we know this builtin never returns.
bool isNoReturn(unsigned ID) const {
- return strchr(GetRecord(ID).Attribute, 'r') != 0;
+ return strchr(GetRecord(ID).Attributes, 'r') != 0;
}
/// \brief Return true if we know this builtin can return twice.
bool isReturnsTwice(unsigned ID) const {
- return strchr(GetRecord(ID).Attribute, 'j') != 0;
+ return strchr(GetRecord(ID).Attributes, 'j') != 0;
}
/// \brief Return true if this is a builtin for a libc/libm function,
/// with a "__builtin_" prefix (e.g. __builtin_abs).
bool isLibFunction(unsigned ID) const {
- return strchr(GetRecord(ID).Attribute, 'F') != 0;
+ return strchr(GetRecord(ID).Attributes, 'F') != 0;
}
/// \brief Determines whether this builtin is a predefined libc/libm
/// function, such as "malloc", where we know the signature a
/// priori.
bool isPredefinedLibFunction(unsigned ID) const {
- return strchr(GetRecord(ID).Attribute, 'f') != 0;
+ return strchr(GetRecord(ID).Attributes, 'f') != 0;
}
/// \brief Determines whether this builtin has custom typechecking.
bool hasCustomTypechecking(unsigned ID) const {
- return strchr(GetRecord(ID).Attribute, 't') != 0;
+ return strchr(GetRecord(ID).Attributes, 't') != 0;
}
/// \brief Completely forget that the given ID was ever considered a builtin,
///
/// Such functions can be const when the MathErrno lang option is disabled.
bool isConstWithoutErrno(unsigned ID) const {
- return strchr(GetRecord(ID).Attribute, 'e') != 0;
+ return strchr(GetRecord(ID).Attributes, 'e') != 0;
}
private:
DeclSpec &DS, const ParsedTemplateInfo &TemplateInfo,
AccessSpecifier AS, bool EnteringContext,
DeclSpecContext DSC,
- ParsedAttributesWithRange &Attribute);
+ ParsedAttributesWithRange &Attributes);
void ParseCXXMemberSpecification(SourceLocation StartLoc, unsigned TagType,
Decl *TagDecl);
ExprResult ParseCXXMemberInitializer(Decl *D, bool IsFunction,
/// \brief Is this Declarator a redeclaration?
bool Redeclaration : 1;
- /// Attrs - Attribute.
+ /// Attrs - Attributes.
ParsedAttributes Attrs;
/// \brief The asm label, if specified.
Selector SetterSel,
const bool isAssign,
const bool isReadWrite,
- const unsigned Attribute,
+ const unsigned Attributes,
const unsigned AttributesAsWritten,
bool *isOverridingProperty,
TypeSourceInfo *T,
Selector SetterSel,
const bool isAssign,
const bool isReadWrite,
- const unsigned Attribute,
+ const unsigned Attributes,
const unsigned AttributesAsWritten,
TypeSourceInfo *T,
tok::ObjCKeywordKind MethodImplKind,
SmallVectorImpl<Decl *> &Protocols);
/// Ensure attributes are consistent with type.
- /// \param [in, out] Attribute The attributes to check; they will
+ /// \param [in, out] Attributes The attributes to check; they will
/// be modified to be consistent with \p PropertyTy.
void CheckObjCPropertyAttributes(Decl *PropertyPtrTy,
SourceLocation Loc,
- unsigned &Attribute,
+ unsigned &Attributes,
bool propertyInPrimaryClass);
/// Process the specified property declaration and create decls for the
OS << ExceptionSpec;
}
- // FIXME: Attribute
+ // FIXME: Attributes
// Print the trailing return type if it was specified in the source.
if (Node->hasExplicitResultType())
const LangOptions& LangOpts) {
// Step #1: mark all target-independent builtins with their ID's.
for (unsigned i = Builtin::NotBuiltin+1; i != Builtin::FirstTSBuiltin; ++i)
- if (!LangOpts.NoBuiltin || !strchr(BuiltinInfo[i].Attribute, 'f')) {
+ if (!LangOpts.NoBuiltin || !strchr(BuiltinInfo[i].Attributes, 'f')) {
if (LangOpts.ObjC1 ||
BuiltinInfo[i].builtin_lang != clang::OBJC_LANG)
Table.get(BuiltinInfo[i].Name).setBuiltinID(i);
// Step #2: Register target-specific builtins.
for (unsigned i = 0, e = NumTSRecords; i != e; ++i)
- if (!LangOpts.NoBuiltin || !strchr(TSRecords[i].Attribute, 'f'))
+ if (!LangOpts.NoBuiltin || !strchr(TSRecords[i].Attributes, 'f'))
Table.get(TSRecords[i].Name).setBuiltinID(i+Builtin::FirstTSBuiltin);
}
bool NoBuiltins) {
// Final all target-independent names
for (unsigned i = Builtin::NotBuiltin+1; i != Builtin::FirstTSBuiltin; ++i)
- if (!NoBuiltins || !strchr(BuiltinInfo[i].Attribute, 'f'))
+ if (!NoBuiltins || !strchr(BuiltinInfo[i].Attributes, 'f'))
Names.push_back(BuiltinInfo[i].Name);
// Find target-specific names.
for (unsigned i = 0, e = NumTSRecords; i != e; ++i)
- if (!NoBuiltins || !strchr(TSRecords[i].Attribute, 'f'))
+ if (!NoBuiltins || !strchr(TSRecords[i].Attributes, 'f'))
Names.push_back(TSRecords[i].Name);
}
bool
Builtin::Context::isPrintfLike(unsigned ID, unsigned &FormatIdx,
bool &HasVAListArg) {
- const char *Printf = strpbrk(GetRecord(ID).Attribute, "pP");
+ const char *Printf = strpbrk(GetRecord(ID).Attributes, "pP");
if (!Printf)
return false;
bool
Builtin::Context::isScanfLike(unsigned ID, unsigned &FormatIdx,
bool &HasVAListArg) {
- const char *Scanf = strpbrk(GetRecord(ID).Attribute, "sS");
+ const char *Scanf = strpbrk(GetRecord(ID).Attributes, "sS");
if (!Scanf)
return false;
CallingConv = FI.getEffectiveCallingConvention();
if (FI.isNoReturn())
- FuncAttrs.addAttribute(llvm::Attribute::NoReturn);
+ FuncAttrs.addAttribute(llvm::Attributes::NoReturn);
// FIXME: handle sseregparm someday...
if (TargetDecl) {
if (TargetDecl->hasAttr<ReturnsTwiceAttr>())
- FuncAttrs.addAttribute(llvm::Attribute::ReturnsTwice);
+ FuncAttrs.addAttribute(llvm::Attributes::ReturnsTwice);
if (TargetDecl->hasAttr<NoThrowAttr>())
- FuncAttrs.addAttribute(llvm::Attribute::NoUnwind);
+ FuncAttrs.addAttribute(llvm::Attributes::NoUnwind);
else if (const FunctionDecl *Fn = dyn_cast<FunctionDecl>(TargetDecl)) {
const FunctionProtoType *FPT = Fn->getType()->getAs<FunctionProtoType>();
if (FPT && FPT->isNothrow(getContext()))
- FuncAttrs.addAttribute(llvm::Attribute::NoUnwind);
+ FuncAttrs.addAttribute(llvm::Attributes::NoUnwind);
}
if (TargetDecl->hasAttr<NoReturnAttr>())
- FuncAttrs.addAttribute(llvm::Attribute::NoReturn);
+ FuncAttrs.addAttribute(llvm::Attributes::NoReturn);
if (TargetDecl->hasAttr<ReturnsTwiceAttr>())
- FuncAttrs.addAttribute(llvm::Attribute::ReturnsTwice);
+ FuncAttrs.addAttribute(llvm::Attributes::ReturnsTwice);
// 'const' and 'pure' attribute functions are also nounwind.
if (TargetDecl->hasAttr<ConstAttr>()) {
- FuncAttrs.addAttribute(llvm::Attribute::ReadNone);
- FuncAttrs.addAttribute(llvm::Attribute::NoUnwind);
+ FuncAttrs.addAttribute(llvm::Attributes::ReadNone);
+ FuncAttrs.addAttribute(llvm::Attributes::NoUnwind);
} else if (TargetDecl->hasAttr<PureAttr>()) {
- FuncAttrs.addAttribute(llvm::Attribute::ReadOnly);
- FuncAttrs.addAttribute(llvm::Attribute::NoUnwind);
+ FuncAttrs.addAttribute(llvm::Attributes::ReadOnly);
+ FuncAttrs.addAttribute(llvm::Attributes::NoUnwind);
}
if (TargetDecl->hasAttr<MallocAttr>())
- RetAttrs.addAttribute(llvm::Attribute::NoAlias);
+ RetAttrs.addAttribute(llvm::Attributes::NoAlias);
}
if (CodeGenOpts.OptimizeSize)
- FuncAttrs.addAttribute(llvm::Attribute::OptimizeForSize);
+ FuncAttrs.addAttribute(llvm::Attributes::OptimizeForSize);
if (CodeGenOpts.OptimizeSize == 2)
- FuncAttrs.addAttribute(llvm::Attribute::MinSize);
+ FuncAttrs.addAttribute(llvm::Attributes::MinSize);
if (CodeGenOpts.DisableRedZone)
- FuncAttrs.addAttribute(llvm::Attribute::NoRedZone);
+ FuncAttrs.addAttribute(llvm::Attributes::NoRedZone);
if (CodeGenOpts.NoImplicitFloat)
- FuncAttrs.addAttribute(llvm::Attribute::NoImplicitFloat);
+ FuncAttrs.addAttribute(llvm::Attributes::NoImplicitFloat);
QualType RetTy = FI.getReturnType();
unsigned Index = 1;
switch (RetAI.getKind()) {
case ABIArgInfo::Extend:
if (RetTy->hasSignedIntegerRepresentation())
- RetAttrs.addAttribute(llvm::Attribute::SExt);
+ RetAttrs.addAttribute(llvm::Attributes::SExt);
else if (RetTy->hasUnsignedIntegerRepresentation())
- RetAttrs.addAttribute(llvm::Attribute::ZExt);
+ RetAttrs.addAttribute(llvm::Attributes::ZExt);
break;
case ABIArgInfo::Direct:
case ABIArgInfo::Ignore:
case ABIArgInfo::Indirect: {
llvm::AttrBuilder SRETAttrs;
- SRETAttrs.addAttribute(llvm::Attribute::StructRet);
+ SRETAttrs.addAttribute(llvm::Attributes::StructRet);
if (RetAI.getInReg())
- SRETAttrs.addAttribute(llvm::Attribute::InReg);
+ SRETAttrs.addAttribute(llvm::Attributes::InReg);
PAL.push_back(llvm::
AttributeWithIndex::get(Index,
- llvm::Attribute::get(getLLVMContext(),
+ llvm::Attributes::get(getLLVMContext(),
SRETAttrs)));
++Index;
// sret disables readnone and readonly
- FuncAttrs.removeAttribute(llvm::Attribute::ReadOnly)
- .removeAttribute(llvm::Attribute::ReadNone);
+ FuncAttrs.removeAttribute(llvm::Attributes::ReadOnly)
+ .removeAttribute(llvm::Attributes::ReadNone);
break;
}
if (RetAttrs.hasAttributes())
PAL.push_back(llvm::
AttributeWithIndex::get(llvm::AttributeSet::ReturnIndex,
- llvm::Attribute::get(getLLVMContext(),
+ llvm::Attributes::get(getLLVMContext(),
RetAttrs)));
for (CGFunctionInfo::const_arg_iterator it = FI.arg_begin(),
if (AI.getPaddingType()) {
if (AI.getPaddingInReg()) {
llvm::AttrBuilder PadAttrs;
- PadAttrs.addAttribute(llvm::Attribute::InReg);
+ PadAttrs.addAttribute(llvm::Attributes::InReg);
- llvm::Attribute A =llvm::Attribute::get(getLLVMContext(), PadAttrs);
+ llvm::Attributes A =llvm::Attributes::get(getLLVMContext(), PadAttrs);
PAL.push_back(llvm::AttributeWithIndex::get(Index, A));
}
// Increment Index if there is padding.
switch (AI.getKind()) {
case ABIArgInfo::Extend:
if (ParamType->isSignedIntegerOrEnumerationType())
- Attrs.addAttribute(llvm::Attribute::SExt);
+ Attrs.addAttribute(llvm::Attributes::SExt);
else if (ParamType->isUnsignedIntegerOrEnumerationType())
- Attrs.addAttribute(llvm::Attribute::ZExt);
+ Attrs.addAttribute(llvm::Attributes::ZExt);
// FALL THROUGH
case ABIArgInfo::Direct:
if (AI.getInReg())
- Attrs.addAttribute(llvm::Attribute::InReg);
+ Attrs.addAttribute(llvm::Attributes::InReg);
// FIXME: handle sseregparm someday...
if (Attrs.hasAttributes())
for (unsigned I = 0; I < Extra; ++I)
PAL.push_back(llvm::AttributeWithIndex::get(Index + I,
- llvm::Attribute::get(getLLVMContext(),
+ llvm::Attributes::get(getLLVMContext(),
Attrs)));
Index += Extra;
}
case ABIArgInfo::Indirect:
if (AI.getInReg())
- Attrs.addAttribute(llvm::Attribute::InReg);
+ Attrs.addAttribute(llvm::Attributes::InReg);
if (AI.getIndirectByVal())
- Attrs.addAttribute(llvm::Attribute::ByVal);
+ Attrs.addAttribute(llvm::Attributes::ByVal);
Attrs.addAlignmentAttr(AI.getIndirectAlign());
// byval disables readnone and readonly.
- FuncAttrs.removeAttribute(llvm::Attribute::ReadOnly)
- .removeAttribute(llvm::Attribute::ReadNone);
+ FuncAttrs.removeAttribute(llvm::Attributes::ReadOnly)
+ .removeAttribute(llvm::Attributes::ReadNone);
break;
case ABIArgInfo::Ignore:
if (Attrs.hasAttributes())
PAL.push_back(llvm::AttributeWithIndex::get(Index,
- llvm::Attribute::get(getLLVMContext(),
+ llvm::Attributes::get(getLLVMContext(),
Attrs)));
++Index;
}
if (FuncAttrs.hasAttributes())
PAL.push_back(llvm::
AttributeWithIndex::get(llvm::AttributeSet::FunctionIndex,
- llvm::Attribute::get(getLLVMContext(),
+ llvm::Attributes::get(getLLVMContext(),
FuncAttrs)));
}
// Name the struct return argument.
if (CGM.ReturnTypeUsesSRet(FI)) {
AI->setName("agg.result");
- AI->addAttr(llvm::Attribute::get(getLLVMContext(),
- llvm::Attribute::NoAlias));
+ AI->addAttr(llvm::Attributes::get(getLLVMContext(),
+ llvm::Attributes::NoAlias));
++AI;
}
llvm::Value *V = AI;
if (Arg->getType().isRestrictQualified())
- AI->addAttr(llvm::Attribute::get(getLLVMContext(),
- llvm::Attribute::NoAlias));
+ AI->addAttr(llvm::Attributes::get(getLLVMContext(),
+ llvm::Attributes::NoAlias));
// Ensure the argument is the correct type.
if (V->getType() != ArgI.getCoerceToType())
AttributeList);
llvm::BasicBlock *InvokeDest = 0;
- if (!Attrs.getFnAttributes().hasAttribute(llvm::Attribute::NoUnwind))
+ if (!Attrs.getFnAttributes().hasAttribute(llvm::Attributes::NoUnwind))
InvokeDest = getInvokeDest();
llvm::CallSite CS;
// -fapple-kext must inline any call to this dtor into
// the caller's body.
if (getLangOpts().AppleKext)
- CurFn->addFnAttr(llvm::Attribute::AlwaysInline);
+ CurFn->addFnAttr(llvm::Attributes::AlwaysInline);
break;
}
Fn->setDoesNotThrow();
if (CGM.getLangOpts().SanitizeAddress)
- Fn->addFnAttr(llvm::Attribute::AddressSafety);
+ Fn->addFnAttr(llvm::Attributes::AddressSafety);
return Fn;
}
llvm::FunctionType::get(CGM.VoidTy, ArgTypes, false);
llvm::AttrBuilder B;
if (!Recover) {
- B.addAttribute(llvm::Attribute::NoReturn)
- .addAttribute(llvm::Attribute::NoUnwind);
+ B.addAttribute(llvm::Attributes::NoReturn)
+ .addAttribute(llvm::Attributes::NoUnwind);
}
- B.addAttribute(llvm::Attribute::UWTable);
+ B.addAttribute(llvm::Attributes::UWTable);
// Checks that have two variants use a suffix to differentiate them
bool NeedsAbortSuffix = (RecoverKind != CRK_Unrecoverable) &&
(NeedsAbortSuffix? "_abort" : "")).str();
llvm::Value *Fn =
CGM.CreateRuntimeFunction(FnType, FunctionName,
- llvm::Attribute::get(getLLVMContext(), B));
+ llvm::Attributes::get(getLLVMContext(), B));
llvm::CallInst *HandlerCall = Builder.CreateCall(Fn, Args);
if (Recover) {
Builder.CreateBr(Cont);
f->setLinkage(llvm::Function::ExternalWeakLinkage);
// set nonlazybind attribute for these APIs for performance.
if (fnName == "objc_retain" || fnName == "objc_release")
- f->addFnAttr(llvm::Attribute::NonLazyBind);
+ f->addFnAttr(llvm::Attributes::NonLazyBind);
}
return fn;
return CGM.CreateRuntimeFunction(llvm::FunctionType::get(ObjectPtrTy,
params, true),
"objc_msgSend",
- llvm::Attribute::get(CGM.getLLVMContext(),
- llvm::Attribute::NonLazyBind));
+ llvm::Attributes::get(CGM.getLLVMContext(),
+ llvm::Attributes::NonLazyBind));
}
/// void objc_msgSend_stret (id, SEL, ...)
return CGM.CreateRuntimeFunction(llvm::FunctionType::get(CGM.Int32Ty,
params, false),
"_setjmp",
- llvm::Attribute::get(CGM.getLLVMContext(),
- llvm::Attribute::NonLazyBind));
+ llvm::Attributes::get(CGM.getLLVMContext(),
+ llvm::Attributes::NonLazyBind));
}
public:
/* IsAlignStack */ false, AsmDialect);
llvm::CallInst *Result = Builder.CreateCall(IA, Args);
Result->addAttribute(llvm::AttributeSet::FunctionIndex,
- llvm::Attribute::get(getLLVMContext(),
- llvm::Attribute::NoUnwind));
+ llvm::Attributes::get(getLLVMContext(),
+ llvm::Attributes::NoUnwind));
// Slap the source location of the inline asm into a !srcloc metadata on the
// call. FIXME: Handle metadata for MS-style inline asms.
for (FunctionDecl::redecl_iterator RI = FD->redecls_begin(),
RE = FD->redecls_end(); RI != RE; ++RI)
if (RI->isInlineSpecified()) {
- Fn->addFnAttr(llvm::Attribute::InlineHint);
+ Fn->addFnAttr(llvm::Attributes::InlineHint);
break;
}
F->setHasUWTable();
if (!hasUnwindExceptions(LangOpts))
- F->addFnAttr(llvm::Attribute::NoUnwind);
+ F->addFnAttr(llvm::Attributes::NoUnwind);
if (D->hasAttr<NakedAttr>()) {
// Naked implies noinline: we should not be inlining such functions.
- F->addFnAttr(llvm::Attribute::Naked);
- F->addFnAttr(llvm::Attribute::NoInline);
+ F->addFnAttr(llvm::Attributes::Naked);
+ F->addFnAttr(llvm::Attributes::NoInline);
}
if (D->hasAttr<NoInlineAttr>())
- F->addFnAttr(llvm::Attribute::NoInline);
+ F->addFnAttr(llvm::Attributes::NoInline);
// (noinline wins over always_inline, and we can't specify both in IR)
if ((D->hasAttr<AlwaysInlineAttr>() || D->hasAttr<ForceInlineAttr>()) &&
- !F->getFnAttributes().hasAttribute(llvm::Attribute::NoInline))
- F->addFnAttr(llvm::Attribute::AlwaysInline);
+ !F->getFnAttributes().hasAttribute(llvm::Attributes::NoInline))
+ F->addFnAttr(llvm::Attributes::AlwaysInline);
// FIXME: Communicate hot and cold attributes to LLVM more directly.
if (D->hasAttr<ColdAttr>())
- F->addFnAttr(llvm::Attribute::OptimizeForSize);
+ F->addFnAttr(llvm::Attributes::OptimizeForSize);
if (D->hasAttr<MinSizeAttr>())
- F->addFnAttr(llvm::Attribute::MinSize);
+ F->addFnAttr(llvm::Attributes::MinSize);
if (isa<CXXConstructorDecl>(D) || isa<CXXDestructorDecl>(D))
F->setUnnamedAddr(true);
F->setUnnamedAddr(true);
if (LangOpts.getStackProtector() == LangOptions::SSPOn)
- F->addFnAttr(llvm::Attribute::StackProtect);
+ F->addFnAttr(llvm::Attributes::StackProtect);
else if (LangOpts.getStackProtector() == LangOptions::SSPReq)
- F->addFnAttr(llvm::Attribute::StackProtectReq);
+ F->addFnAttr(llvm::Attributes::StackProtectReq);
if (LangOpts.SanitizeAddress) {
// When AddressSanitizer is enabled, set AddressSafety attribute
// unless __attribute__((no_address_safety_analysis)) is used.
if (!D->hasAttr<NoAddressSafetyAnalysisAttr>())
- F->addFnAttr(llvm::Attribute::AddressSafety);
+ F->addFnAttr(llvm::Attributes::AddressSafety);
}
unsigned alignment = D->getMaxAlignment() / Context.getCharWidth();
CodeGenModule::GetOrCreateLLVMFunction(StringRef MangledName,
llvm::Type *Ty,
GlobalDecl D, bool ForVTable,
- llvm::Attribute ExtraAttrs) {
+ llvm::Attributes ExtraAttrs) {
// Lookup the entry, lazily creating it if necessary.
llvm::GlobalValue *Entry = GetGlobalValue(MangledName);
if (Entry) {
llvm::Constant *
CodeGenModule::CreateRuntimeFunction(llvm::FunctionType *FTy,
StringRef Name,
- llvm::Attribute ExtraAttrs) {
+ llvm::Attributes ExtraAttrs) {
return GetOrCreateLLVMFunction(Name, FTy, GlobalDecl(), /*ForVTable=*/false,
ExtraAttrs);
}
llvm::AttributeSet oldAttrs = callSite.getAttributes();
// Collect any return attributes from the call.
- llvm::Attribute returnAttrs = oldAttrs.getRetAttributes();
+ llvm::Attributes returnAttrs = oldAttrs.getRetAttributes();
if (returnAttrs.hasAttributes())
newAttrs.push_back(llvm::AttributeWithIndex::get(
llvm::AttributeSet::ReturnIndex, returnAttrs));
}
// Add any parameter attributes.
- llvm::Attribute pAttrs = oldAttrs.getParamAttributes(argNo + 1);
+ llvm::Attributes pAttrs = oldAttrs.getParamAttributes(argNo + 1);
if (pAttrs.hasAttributes())
newAttrs.push_back(llvm::AttributeWithIndex::get(argNo + 1, pAttrs));
}
if (dontTransform)
continue;
- llvm::Attribute fnAttrs = oldAttrs.getFnAttributes();
+ llvm::Attributes fnAttrs = oldAttrs.getFnAttributes();
if (fnAttrs.hasAttributes())
newAttrs.push_back(llvm::
AttributeWithIndex::get(llvm::AttributeSet::FunctionIndex,
/// type and name.
llvm::Constant *CreateRuntimeFunction(llvm::FunctionType *Ty,
StringRef Name,
- llvm::Attribute ExtraAttrs =
- llvm::Attribute());
+ llvm::Attributes ExtraAttrs =
+ llvm::Attributes());
/// CreateRuntimeVariable - Create a new runtime global variable with the
/// specified type and name.
llvm::Constant *CreateRuntimeVariable(llvm::Type *Ty,
llvm::Type *Ty,
GlobalDecl D,
bool ForVTable,
- llvm::Attribute ExtraAttrs =
- llvm::Attribute());
+ llvm::Attributes ExtraAttrs =
+ llvm::Attributes());
llvm::Constant *GetOrCreateLLVMGlobal(StringRef MangledName,
llvm::PointerType *PTy,
const VarDecl *D,
llvm::FunctionType::get(CGM.getTypes().ConvertType(CGM.getContext().IntTy),
GuardPtrTy, /*isVarArg=*/false);
return CGM.CreateRuntimeFunction(FTy, "__cxa_guard_acquire",
- llvm::Attribute::get(CGM.getLLVMContext(),
- llvm::Attribute::NoUnwind));
+ llvm::Attributes::get(CGM.getLLVMContext(),
+ llvm::Attributes::NoUnwind));
}
static llvm::Constant *getGuardReleaseFn(CodeGenModule &CGM,
llvm::FunctionType *FTy =
llvm::FunctionType::get(CGM.VoidTy, GuardPtrTy, /*isVarArg=*/false);
return CGM.CreateRuntimeFunction(FTy, "__cxa_guard_release",
- llvm::Attribute::get(CGM.getLLVMContext(),
- llvm::Attribute::NoUnwind));
+ llvm::Attributes::get(CGM.getLLVMContext(),
+ llvm::Attributes::NoUnwind));
}
static llvm::Constant *getGuardAbortFn(CodeGenModule &CGM,
llvm::FunctionType *FTy =
llvm::FunctionType::get(CGM.VoidTy, GuardPtrTy, /*isVarArg=*/false);
return CGM.CreateRuntimeFunction(FTy, "__cxa_guard_abort",
- llvm::Attribute::get(CGM.getLLVMContext(),
- llvm::Attribute::NoUnwind));
+ llvm::Attributes::get(CGM.getLLVMContext(),
+ llvm::Attributes::NoUnwind));
}
namespace {
llvm::AttrBuilder B;
B.addStackAlignmentAttr(16);
Fn->addAttribute(llvm::AttributeSet::FunctionIndex,
- llvm::Attribute::get(CGM.getLLVMContext(), B));
+ llvm::Attributes::get(CGM.getLLVMContext(), B));
}
}
}
// OpenCL __kernel functions get a kernel calling convention
F->setCallingConv(llvm::CallingConv::PTX_Kernel);
// And kernel functions are not subject to inlining
- F->addFnAttr(llvm::Attribute::NoInline);
+ F->addFnAttr(llvm::Attributes::NoInline);
}
}
F->setCallingConv(CC);
// Step 2: Add attributes goodness.
- F->addFnAttr(llvm::Attribute::NoInline);
+ F->addFnAttr(llvm::Attributes::NoInline);
}
// Step 3: Emit _interrupt_handler alias.
F->setCallingConv(llvm::CallingConv::MSP430_INTR);
// Step 2: Add attributes goodness.
- F->addFnAttr(llvm::Attribute::NoInline);
+ F->addFnAttr(llvm::Attributes::NoInline);
// Step 3: Emit ISR vector alias.
unsigned Num = attr->getNumber() / 2;
if (M.getLangOpts().OpenCL) {
if (FD->hasAttr<OpenCLKernelAttr>()) {
// OpenCL C Kernel functions are not subject to inlining
- F->addFnAttr(llvm::Attribute::NoInline);
+ F->addFnAttr(llvm::Attributes::NoInline);
if (FD->hasAttr<ReqdWorkGroupSizeAttr>()) {
};
/// \brief The set of attributes that can be attached to a module.
- struct Attribute {
- Attribute() : IsSystem() { }
+ struct Attributes {
+ Attributes() : IsSystem() { }
/// \brief Whether this is a system module.
unsigned IsSystem : 1;
void parseUmbrellaDirDecl(SourceLocation UmbrellaLoc);
void parseExportDecl();
void parseInferredModuleDecl(bool Framework, bool Explicit);
- bool parseOptionalAttributes(Attribute &Attrs);
+ bool parseOptionalAttributes(Attributes &Attrs);
const DirectoryEntry *getOverriddenHeaderSearchDir();
SourceLocation ModuleNameLoc = Id.back().second;
// Parse the optional attribute list.
- Attribute Attrs;
+ Attributes Attrs;
parseOptionalAttributes(Attrs);
// Parse the opening brace.
}
// Parse optional attributes.
- Attribute Attrs;
+ Attributes Attrs;
parseOptionalAttributes(Attrs);
if (ActiveModule) {
/// \param Attrs Will be filled in with the parsed attributes.
///
/// \returns true if an error occurred, false otherwise.
-bool ModuleMapParser::parseOptionalAttributes(Attribute &Attrs) {
+bool ModuleMapParser::parseOptionalAttributes(Attributes &Attrs) {
bool HadError = false;
while (Tok.is(MMToken::LSquare)) {
new LateParsedAttribute(this, *AttrName, AttrNameLoc);
LateAttrs->push_back(LA);
- // Attribute in a class are parsed at the end of the class, along
+ // Attributes in a class are parsed at the end of the class, along
// with other late-parsed declarations.
if (!ClassStack.empty() && !LateAttrs->parseSoon())
getCurrentClass().LateParsedDeclarations.push_back(LA);
}
-// Late Parsed Attribute:
+// Late Parsed Attributes:
// See other examples of late parsing in lib/Parse/ParseCXXInlineMethods
void Parser::LateParsedDeclaration::ParseLexedAttributes() {}
// These are attributes following class specifiers.
// To produce better diagnostic, we parse them when
// parsing class specifier.
- ParsedAttributesWithRange Attribute(AttrFactory);
+ ParsedAttributesWithRange Attributes(AttrFactory);
ParseClassSpecifier(Kind, Loc, DS, TemplateInfo, AS,
- EnteringContext, DSContext, Attribute);
+ EnteringContext, DSContext, Attributes);
// If there are attributes following class specifier,
// take them over and handle them here.
- if (!Attribute.empty()) {
+ if (!Attributes.empty()) {
AttrsLastTime = true;
- attrs.takeAllFrom(Attribute);
+ attrs.takeAllFrom(Attributes);
}
continue;
}
ParsingFieldDeclarator DeclaratorInfo(*this, DS);
DeclaratorInfo.D.setCommaLoc(CommaLoc);
- // Attribute are only allowed here on successive declarators.
+ // Attributes are only allowed here on successive declarators.
if (!FirstDeclarator)
MaybeParseGNUAttributes(DeclaratorInfo.D);
IsScopedUsingClassTag = Tok.is(tok::kw_class);
ScopedEnumKWLoc = ConsumeToken();
- // Attribute are not allowed between these keywords. Diagnose,
+ // Attributes are not allowed between these keywords. Diagnose,
// but then just treat them like they appeared in the right place.
ProhibitAttributes(attrs);
const ParsedTemplateInfo &TemplateInfo,
AccessSpecifier AS,
bool EnteringContext, DeclSpecContext DSC,
- ParsedAttributesWithRange &Attribute) {
+ ParsedAttributesWithRange &Attributes) {
DeclSpec::TST TagType;
if (TagTokKind == tok::kw_struct)
TagType = DeclSpec::TST_struct;
// For these, DSC is DSC_type_specifier.
// If there are attributes after class name, parse them.
- MaybeParseCXX0XAttributes(Attribute);
+ MaybeParseCXX0XAttributes(Attributes);
Sema::TagUseKind TUK;
if (DSC == DSC_trailing)
// to caller to handle.
// FIXME: provide fix-it hints if we can.
if (TUK != Sema::TUK_Reference)
- ProhibitAttributes(Attribute);
+ ProhibitAttributes(Attributes);
// If this is an elaborated type specifier, and we delayed
// diagnostics before, just merge them into the current pool.
HasInitializer = false;
DeclaratorInfo.setCommaLoc(CommaLoc);
- // Attribute are only allowed on the second declarator.
+ // Attributes are only allowed on the second declarator.
MaybeParseGNUAttributes(DeclaratorInfo);
if (Tok.isNot(tok::colon))
T.consumeClose();
- // Attribute here appertain to the array type. C++11 [expr.new]p5.
+ // Attributes here appertain to the array type. C++11 [expr.new]p5.
ParsedAttributes Attrs(AttrFactory);
MaybeParseCXX0XAttributes(Attrs);
if (!OID)
return;
- unsigned Attribute = PD->getPropertyAttributes();
+ unsigned Attributes = PD->getPropertyAttributes();
if (mustSynthesizeSetterGetterMethod(IMD, PD, true /*getter*/)) {
- bool GenGetProperty = !(Attribute & ObjCPropertyDecl::OBJC_PR_nonatomic) &&
- (Attribute & (ObjCPropertyDecl::OBJC_PR_retain |
+ bool GenGetProperty = !(Attributes & ObjCPropertyDecl::OBJC_PR_nonatomic) &&
+ (Attributes & (ObjCPropertyDecl::OBJC_PR_retain |
ObjCPropertyDecl::OBJC_PR_copy));
std::string Getr;
if (GenGetProperty && !objcGetPropertyDefined) {
// Generate the 'setter' function.
std::string Setr;
- bool GenSetProperty = Attribute & (ObjCPropertyDecl::OBJC_PR_retain |
+ bool GenSetProperty = Attributes & (ObjCPropertyDecl::OBJC_PR_retain |
ObjCPropertyDecl::OBJC_PR_copy);
if (GenSetProperty && !objcSetPropertyDefined) {
objcSetPropertyDefined = true;
Setr += ", (id)";
Setr += PD->getName();
Setr += ", ";
- if (Attribute & ObjCPropertyDecl::OBJC_PR_nonatomic)
+ if (Attributes & ObjCPropertyDecl::OBJC_PR_nonatomic)
Setr += "0, ";
else
Setr += "1, ";
- if (Attribute & ObjCPropertyDecl::OBJC_PR_copy)
+ if (Attributes & ObjCPropertyDecl::OBJC_PR_copy)
Setr += "1)";
else
Setr += "0)";
if (!OID)
return;
- unsigned Attribute = PD->getPropertyAttributes();
+ unsigned Attributes = PD->getPropertyAttributes();
if (!PD->getGetterMethodDecl()->isDefined()) {
- bool GenGetProperty = !(Attribute & ObjCPropertyDecl::OBJC_PR_nonatomic) &&
- (Attribute & (ObjCPropertyDecl::OBJC_PR_retain |
+ bool GenGetProperty = !(Attributes & ObjCPropertyDecl::OBJC_PR_nonatomic) &&
+ (Attributes & (ObjCPropertyDecl::OBJC_PR_retain |
ObjCPropertyDecl::OBJC_PR_copy));
std::string Getr;
if (GenGetProperty && !objcGetPropertyDefined) {
// Generate the 'setter' function.
std::string Setr;
- bool GenSetProperty = Attribute & (ObjCPropertyDecl::OBJC_PR_retain |
+ bool GenSetProperty = Attributes & (ObjCPropertyDecl::OBJC_PR_retain |
ObjCPropertyDecl::OBJC_PR_copy);
if (GenSetProperty && !objcSetPropertyDefined) {
objcSetPropertyDefined = true;
Setr += ", (id)";
Setr += PD->getName();
Setr += ", ";
- if (Attribute & ObjCPropertyDecl::OBJC_PR_nonatomic)
+ if (Attributes & ObjCPropertyDecl::OBJC_PR_nonatomic)
Setr += "0, ";
else
Setr += "1, ";
- if (Attribute & ObjCPropertyDecl::OBJC_PR_copy)
+ if (Attributes & ObjCPropertyDecl::OBJC_PR_copy)
Setr += "1)";
else
Setr += "0)";
-//===--- SemaAttr.cpp - Semantic Analysis for Attribute ------------------===//
+//===--- SemaAttr.cpp - Semantic Analysis for Attributes ------------------===//
//
// The LLVM Compiler Infrastructure
//
if (!PD)
return;
- unsigned Attribute = PD->getPropertyAttributes();
- if (Attribute & ObjCPropertyDecl::OBJC_PR_assign) {
+ unsigned Attributes = PD->getPropertyAttributes();
+ if (Attributes & ObjCPropertyDecl::OBJC_PR_assign) {
// when 'assign' attribute was not explicitly specified
// by user, ignore it and rely on property type itself
// for lifetime info.
RHS = cast->getSubExpr();
}
}
- else if (Attribute & ObjCPropertyDecl::OBJC_PR_weak) {
+ else if (Attributes & ObjCPropertyDecl::OBJC_PR_weak) {
while (ImplicitCastExpr *cast = dyn_cast<ImplicitCastExpr>(RHS)) {
if (cast->getCastKind() == CK_ARCConsumeObject) {
Diag(Loc, diag::warn_arc_retained_assign)
/// \brief Determine whether the addition of the given flag to an Objective-C
/// property's attributes will cause a conflict.
-static bool ObjCPropertyFlagConflicts(unsigned Attribute, unsigned NewFlag) {
+static bool ObjCPropertyFlagConflicts(unsigned Attributes, unsigned NewFlag) {
// Check if we've already added this flag.
- if (Attribute & NewFlag)
+ if (Attributes & NewFlag)
return true;
- Attribute |= NewFlag;
+ Attributes |= NewFlag;
// Check for collisions with "readonly".
- if ((Attribute & ObjCDeclSpec::DQ_PR_readonly) &&
- (Attribute & ObjCDeclSpec::DQ_PR_readwrite))
+ if ((Attributes & ObjCDeclSpec::DQ_PR_readonly) &&
+ (Attributes & ObjCDeclSpec::DQ_PR_readwrite))
return true;
// Check for more than one of { assign, copy, retain, strong, weak }.
- unsigned AssignCopyRetMask = Attribute & (ObjCDeclSpec::DQ_PR_assign |
+ unsigned AssignCopyRetMask = Attributes & (ObjCDeclSpec::DQ_PR_assign |
ObjCDeclSpec::DQ_PR_unsafe_unretained |
ObjCDeclSpec::DQ_PR_copy |
ObjCDeclSpec::DQ_PR_retain |
if (!CodeCompleter)
return;
- unsigned Attribute = ODS.getPropertyAttributes();
+ unsigned Attributes = ODS.getPropertyAttributes();
ResultBuilder Results(*this, CodeCompleter->getAllocator(),
CodeCompleter->getCodeCompletionTUInfo(),
CodeCompletionContext::CCC_Other);
Results.EnterNewScope();
- if (!ObjCPropertyFlagConflicts(Attribute, ObjCDeclSpec::DQ_PR_readonly))
+ if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_readonly))
Results.AddResult(CodeCompletionResult("readonly"));
- if (!ObjCPropertyFlagConflicts(Attribute, ObjCDeclSpec::DQ_PR_assign))
+ if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_assign))
Results.AddResult(CodeCompletionResult("assign"));
- if (!ObjCPropertyFlagConflicts(Attribute,
+ if (!ObjCPropertyFlagConflicts(Attributes,
ObjCDeclSpec::DQ_PR_unsafe_unretained))
Results.AddResult(CodeCompletionResult("unsafe_unretained"));
- if (!ObjCPropertyFlagConflicts(Attribute, ObjCDeclSpec::DQ_PR_readwrite))
+ if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_readwrite))
Results.AddResult(CodeCompletionResult("readwrite"));
- if (!ObjCPropertyFlagConflicts(Attribute, ObjCDeclSpec::DQ_PR_retain))
+ if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_retain))
Results.AddResult(CodeCompletionResult("retain"));
- if (!ObjCPropertyFlagConflicts(Attribute, ObjCDeclSpec::DQ_PR_strong))
+ if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_strong))
Results.AddResult(CodeCompletionResult("strong"));
- if (!ObjCPropertyFlagConflicts(Attribute, ObjCDeclSpec::DQ_PR_copy))
+ if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_copy))
Results.AddResult(CodeCompletionResult("copy"));
- if (!ObjCPropertyFlagConflicts(Attribute, ObjCDeclSpec::DQ_PR_nonatomic))
+ if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_nonatomic))
Results.AddResult(CodeCompletionResult("nonatomic"));
- if (!ObjCPropertyFlagConflicts(Attribute, ObjCDeclSpec::DQ_PR_atomic))
+ if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_atomic))
Results.AddResult(CodeCompletionResult("atomic"));
// Only suggest "weak" if we're compiling for ARC-with-weak-references or GC.
if (getLangOpts().ObjCARCWeak || getLangOpts().getGC() != LangOptions::NonGC)
- if (!ObjCPropertyFlagConflicts(Attribute, ObjCDeclSpec::DQ_PR_weak))
+ if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_weak))
Results.AddResult(CodeCompletionResult("weak"));
- if (!ObjCPropertyFlagConflicts(Attribute, ObjCDeclSpec::DQ_PR_setter)) {
+ if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_setter)) {
CodeCompletionBuilder Setter(Results.getAllocator(),
Results.getCodeCompletionTUInfo());
Setter.AddTypedTextChunk("setter");
Setter.AddPlaceholderChunk("method");
Results.AddResult(CodeCompletionResult(Setter.TakeString()));
}
- if (!ObjCPropertyFlagConflicts(Attribute, ObjCDeclSpec::DQ_PR_getter)) {
+ if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_getter)) {
CodeCompletionBuilder Getter(Results.getAllocator(),
Results.getCodeCompletionTUInfo());
Getter.AddTypedTextChunk("getter");
// Warn about ignored type attributes, for example:
// __attribute__((aligned)) struct A;
- // Attribute should be placed after tag to apply to type declaration.
+ // Attributes should be placed after tag to apply to type declaration.
if (!DS.getAttributes().empty()) {
DeclSpec::TST TypeSpecType = DS.getTypeSpecType();
if (TypeSpecType == DeclSpec::TST_class ||
}
/// Handle __attribute__((format_arg((idx)))) attribute based on
-/// http://gcc.gnu.org/onlinedocs/gcc/Function-Attribute.html
+/// http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html
static void handleFormatArgAttr(Sema &S, Decl *D, const AttributeList &Attr) {
if (!checkAttributeNumArgs(S, Attr, 1))
return;
}
/// Handle __attribute__((init_priority(priority))) attributes based on
-/// http://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Attribute.html
+/// http://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Attributes.html
static void handleInitPriorityAttr(Sema &S, Decl *D,
const AttributeList &Attr) {
if (!S.getLangOpts().CPlusPlus) {
}
/// Handle __attribute__((format(type,idx,firstarg))) attributes based on
-/// http://gcc.gnu.org/onlinedocs/gcc/Function-Attribute.html
+/// http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html
static void handleFormatAttr(Sema &S, Decl *D, const AttributeList &Attr) {
if (!Attr.getParameterName()) {
if (ExplicitParams)
CheckCXXDefaultArguments(Method);
- // Attribute on the lambda apply to the method.
+ // Attributes on the lambda apply to the method.
ProcessDeclAttributes(CurScope, Method, ParamInfo);
// Introduce the function call operator as the current declaration context.
bool *isOverridingProperty,
tok::ObjCKeywordKind MethodImplKind,
DeclContext *lexicalDC) {
- unsigned Attribute = ODS.getPropertyAttributes();
+ unsigned Attributes = ODS.getPropertyAttributes();
TypeSourceInfo *TSI = GetTypeForDeclarator(FD.D, S);
QualType T = TSI->getType();
- Attribute |= deduceWeakPropertyFromType(*this, T);
+ Attributes |= deduceWeakPropertyFromType(*this, T);
- bool isReadWrite = ((Attribute & ObjCDeclSpec::DQ_PR_readwrite) ||
+ bool isReadWrite = ((Attributes & ObjCDeclSpec::DQ_PR_readwrite) ||
// default is readwrite!
- !(Attribute & ObjCDeclSpec::DQ_PR_readonly));
+ !(Attributes & ObjCDeclSpec::DQ_PR_readonly));
// property is defaulted to 'assign' if it is readwrite and is
// not retain or copy
- bool isAssign = ((Attribute & ObjCDeclSpec::DQ_PR_assign) ||
+ bool isAssign = ((Attributes & ObjCDeclSpec::DQ_PR_assign) ||
(isReadWrite &&
- !(Attribute & ObjCDeclSpec::DQ_PR_retain) &&
- !(Attribute & ObjCDeclSpec::DQ_PR_strong) &&
- !(Attribute & ObjCDeclSpec::DQ_PR_copy) &&
- !(Attribute & ObjCDeclSpec::DQ_PR_unsafe_unretained) &&
- !(Attribute & ObjCDeclSpec::DQ_PR_weak)));
+ !(Attributes & ObjCDeclSpec::DQ_PR_retain) &&
+ !(Attributes & ObjCDeclSpec::DQ_PR_strong) &&
+ !(Attributes & ObjCDeclSpec::DQ_PR_copy) &&
+ !(Attributes & ObjCDeclSpec::DQ_PR_unsafe_unretained) &&
+ !(Attributes & ObjCDeclSpec::DQ_PR_weak)));
// Proceed with constructing the ObjCPropertDecls.
ObjCContainerDecl *ClassDecl = cast<ObjCContainerDecl>(CurContext);
Decl *Res = HandlePropertyInClassExtension(S, AtLoc, LParenLoc,
FD, GetterSel, SetterSel,
isAssign, isReadWrite,
- Attribute,
+ Attributes,
ODS.getPropertyAttributes(),
isOverridingProperty, TSI,
MethodImplKind);
if (Res) {
- CheckObjCPropertyAttributes(Res, AtLoc, Attribute, false);
+ CheckObjCPropertyAttributes(Res, AtLoc, Attributes, false);
if (getLangOpts().ObjCAutoRefCount)
checkARCPropertyDecl(*this, cast<ObjCPropertyDecl>(Res));
}
ObjCPropertyDecl *Res = CreatePropertyDecl(S, ClassDecl, AtLoc, LParenLoc, FD,
GetterSel, SetterSel,
isAssign, isReadWrite,
- Attribute,
+ Attributes,
ODS.getPropertyAttributes(),
TSI, MethodImplKind);
if (lexicalDC)
Res->setLexicalDeclContext(lexicalDC);
// Validate the attributes on the @property.
- CheckObjCPropertyAttributes(Res, AtLoc, Attribute,
+ CheckObjCPropertyAttributes(Res, AtLoc, Attributes,
(isa<ObjCInterfaceDecl>(ClassDecl) ||
isa<ObjCProtocolDecl>(ClassDecl)));
}
static ObjCPropertyDecl::PropertyAttributeKind
-makePropertyAttributesAsWritten(unsigned Attribute) {
+makePropertyAttributesAsWritten(unsigned Attributes) {
unsigned attributesAsWritten = 0;
- if (Attribute & ObjCDeclSpec::DQ_PR_readonly)
+ if (Attributes & ObjCDeclSpec::DQ_PR_readonly)
attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_readonly;
- if (Attribute & ObjCDeclSpec::DQ_PR_readwrite)
+ if (Attributes & ObjCDeclSpec::DQ_PR_readwrite)
attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_readwrite;
- if (Attribute & ObjCDeclSpec::DQ_PR_getter)
+ if (Attributes & ObjCDeclSpec::DQ_PR_getter)
attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_getter;
- if (Attribute & ObjCDeclSpec::DQ_PR_setter)
+ if (Attributes & ObjCDeclSpec::DQ_PR_setter)
attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_setter;
- if (Attribute & ObjCDeclSpec::DQ_PR_assign)
+ if (Attributes & ObjCDeclSpec::DQ_PR_assign)
attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_assign;
- if (Attribute & ObjCDeclSpec::DQ_PR_retain)
+ if (Attributes & ObjCDeclSpec::DQ_PR_retain)
attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_retain;
- if (Attribute & ObjCDeclSpec::DQ_PR_strong)
+ if (Attributes & ObjCDeclSpec::DQ_PR_strong)
attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_strong;
- if (Attribute & ObjCDeclSpec::DQ_PR_weak)
+ if (Attributes & ObjCDeclSpec::DQ_PR_weak)
attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_weak;
- if (Attribute & ObjCDeclSpec::DQ_PR_copy)
+ if (Attributes & ObjCDeclSpec::DQ_PR_copy)
attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_copy;
- if (Attribute & ObjCDeclSpec::DQ_PR_unsafe_unretained)
+ if (Attributes & ObjCDeclSpec::DQ_PR_unsafe_unretained)
attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_unsafe_unretained;
- if (Attribute & ObjCDeclSpec::DQ_PR_nonatomic)
+ if (Attributes & ObjCDeclSpec::DQ_PR_nonatomic)
attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_nonatomic;
- if (Attribute & ObjCDeclSpec::DQ_PR_atomic)
+ if (Attributes & ObjCDeclSpec::DQ_PR_atomic)
attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_atomic;
return (ObjCPropertyDecl::PropertyAttributeKind)attributesAsWritten;
Selector GetterSel, Selector SetterSel,
const bool isAssign,
const bool isReadWrite,
- const unsigned Attribute,
+ const unsigned Attributes,
const unsigned AttributesAsWritten,
bool *isOverridingProperty,
TypeSourceInfo *T,
PropertyId, AtLoc, LParenLoc, T);
PDecl->setPropertyAttributesAsWritten(
makePropertyAttributesAsWritten(AttributesAsWritten));
- if (Attribute & ObjCDeclSpec::DQ_PR_readonly)
+ if (Attributes & ObjCDeclSpec::DQ_PR_readonly)
PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_readonly);
- if (Attribute & ObjCDeclSpec::DQ_PR_readwrite)
+ if (Attributes & ObjCDeclSpec::DQ_PR_readwrite)
PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_readwrite);
// Set setter/getter selector name. Needed later.
PDecl->setGetterName(GetterSel);
ObjCPropertyDecl *PrimaryPDecl =
CreatePropertyDecl(S, CCPrimary, AtLoc, LParenLoc,
FD, GetterSel, SetterSel, isAssign, isReadWrite,
- Attribute,AttributesAsWritten, T, MethodImplKind, DC);
+ Attributes,AttributesAsWritten, T, MethodImplKind, DC);
// A case of continuation class adding a new property in the class. This
// is not what it was meant for. However, gcc supports it and so should we.
unsigned PIkind = PIDecl->getPropertyAttributesAsWritten();
if (isReadWrite && (PIkind & ObjCPropertyDecl::OBJC_PR_readonly)) {
PIkind |= deduceWeakPropertyFromType(*this, PIDecl->getType());
- unsigned ClassExtensionMemoryModel = getOwnershipRule(Attribute);
+ unsigned ClassExtensionMemoryModel = getOwnershipRule(Attributes);
unsigned PrimaryClassMemoryModel = getOwnershipRule(PIkind);
if (PrimaryClassMemoryModel && ClassExtensionMemoryModel &&
(PrimaryClassMemoryModel != ClassExtensionMemoryModel)) {
PIDecl = cast<ObjCPropertyDecl>(ProtocolPtrTy);
}
PIDecl->makeitReadWriteAttribute();
- if (Attribute & ObjCDeclSpec::DQ_PR_retain)
+ if (Attributes & ObjCDeclSpec::DQ_PR_retain)
PIDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_retain);
- if (Attribute & ObjCDeclSpec::DQ_PR_strong)
+ if (Attributes & ObjCDeclSpec::DQ_PR_strong)
PIDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_strong);
- if (Attribute & ObjCDeclSpec::DQ_PR_copy)
+ if (Attributes & ObjCDeclSpec::DQ_PR_copy)
PIDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_copy);
PIDecl->setSetterName(SetterSel);
} else {
// This is a common error where the user often intended the original
// declaration to be readonly.
unsigned diag =
- (Attribute & ObjCDeclSpec::DQ_PR_readwrite) &&
+ (Attributes & ObjCDeclSpec::DQ_PR_readwrite) &&
(PIkind & ObjCPropertyDecl::OBJC_PR_readwrite)
? diag::err_use_continuation_class_redeclaration_readwrite
: diag::err_use_continuation_class;
Selector SetterSel,
const bool isAssign,
const bool isReadWrite,
- const unsigned Attribute,
+ const unsigned Attributes,
const unsigned AttributesAsWritten,
TypeSourceInfo *TInfo,
tok::ObjCKeywordKind MethodImplKind,
// Issue a warning if property is 'assign' as default and its object, which is
// gc'able conforms to NSCopying protocol
if (getLangOpts().getGC() != LangOptions::NonGC &&
- isAssign && !(Attribute & ObjCDeclSpec::DQ_PR_assign))
+ isAssign && !(Attributes & ObjCDeclSpec::DQ_PR_assign))
if (const ObjCObjectPointerType *ObjPtrTy =
T->getAs<ObjCObjectPointerType>()) {
ObjCInterfaceDecl *IDecl = ObjPtrTy->getObjectType()->getInterface();
PDecl->setPropertyAttributesAsWritten(
makePropertyAttributesAsWritten(AttributesAsWritten));
- if (Attribute & ObjCDeclSpec::DQ_PR_readonly)
+ if (Attributes & ObjCDeclSpec::DQ_PR_readonly)
PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_readonly);
- if (Attribute & ObjCDeclSpec::DQ_PR_getter)
+ if (Attributes & ObjCDeclSpec::DQ_PR_getter)
PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_getter);
- if (Attribute & ObjCDeclSpec::DQ_PR_setter)
+ if (Attributes & ObjCDeclSpec::DQ_PR_setter)
PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_setter);
if (isReadWrite)
PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_readwrite);
- if (Attribute & ObjCDeclSpec::DQ_PR_retain)
+ if (Attributes & ObjCDeclSpec::DQ_PR_retain)
PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_retain);
- if (Attribute & ObjCDeclSpec::DQ_PR_strong)
+ if (Attributes & ObjCDeclSpec::DQ_PR_strong)
PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_strong);
- if (Attribute & ObjCDeclSpec::DQ_PR_weak)
+ if (Attributes & ObjCDeclSpec::DQ_PR_weak)
PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_weak);
- if (Attribute & ObjCDeclSpec::DQ_PR_copy)
+ if (Attributes & ObjCDeclSpec::DQ_PR_copy)
PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_copy);
- if (Attribute & ObjCDeclSpec::DQ_PR_unsafe_unretained)
+ if (Attributes & ObjCDeclSpec::DQ_PR_unsafe_unretained)
PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_unsafe_unretained);
if (isAssign)
PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_assign);
// In the semantic attributes, one of nonatomic or atomic is always set.
- if (Attribute & ObjCDeclSpec::DQ_PR_nonatomic)
+ if (Attributes & ObjCDeclSpec::DQ_PR_nonatomic)
PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_nonatomic);
else
PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_atomic);
// 'unsafe_unretained' is alias for 'assign'.
- if (Attribute & ObjCDeclSpec::DQ_PR_unsafe_unretained)
+ if (Attributes & ObjCDeclSpec::DQ_PR_unsafe_unretained)
PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_assign);
if (isAssign)
PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_unsafe_unretained);
static void
DiagnoseClassAndClassExtPropertyMismatch(Sema &S, ObjCInterfaceDecl *ClassDecl,
ObjCPropertyDecl *property) {
- unsigned Attribute = property->getPropertyAttributesAsWritten();
- bool warn = (Attribute & ObjCDeclSpec::DQ_PR_readonly);
+ unsigned Attributes = property->getPropertyAttributesAsWritten();
+ bool warn = (Attributes & ObjCDeclSpec::DQ_PR_readonly);
for (const ObjCCategoryDecl *CDecl = ClassDecl->getFirstClassExtension();
CDecl; CDecl = CDecl->getNextClassExtension()) {
ObjCPropertyDecl *ClassExtProperty = 0;
// can override readonly->readwrite and 'setter' attributes originally
// placed on class's property declaration now make sense in the overridden
// property.
- if (Attribute & ObjCDeclSpec::DQ_PR_readonly) {
+ if (Attributes & ObjCDeclSpec::DQ_PR_readonly) {
if (!classExtPropertyAttr ||
(classExtPropertyAttr &
(ObjCDeclSpec::DQ_PR_readwrite|
ObjCDeclSpec::DQ_PR_copy |
ObjCDeclSpec::DQ_PR_retain |
ObjCDeclSpec::DQ_PR_strong);
- if (Attribute & setterAttrs) {
+ if (Attributes & setterAttrs) {
const char * which =
- (Attribute & ObjCDeclSpec::DQ_PR_assign) ?
+ (Attributes & ObjCDeclSpec::DQ_PR_assign) ?
"assign" :
- (Attribute & ObjCDeclSpec::DQ_PR_unsafe_unretained) ?
+ (Attributes & ObjCDeclSpec::DQ_PR_unsafe_unretained) ?
"unsafe_unretained" :
- (Attribute & ObjCDeclSpec::DQ_PR_copy) ?
+ (Attributes & ObjCDeclSpec::DQ_PR_copy) ?
"copy" :
- (Attribute & ObjCDeclSpec::DQ_PR_retain) ?
+ (Attributes & ObjCDeclSpec::DQ_PR_retain) ?
"retain" : "strong";
S.Diag(property->getLocation(),
ObjCMethodDecl *SetterMethod = 0;
bool LookedUpGetterSetter = false;
- unsigned Attribute = Property->getPropertyAttributes();
+ unsigned Attributes = Property->getPropertyAttributes();
unsigned AttributesAsWritten = Property->getPropertyAttributesAsWritten();
if (!(AttributesAsWritten & ObjCPropertyDecl::OBJC_PR_atomic) &&
}
// We only care about readwrite atomic property.
- if ((Attribute & ObjCPropertyDecl::OBJC_PR_nonatomic) ||
- !(Attribute & ObjCPropertyDecl::OBJC_PR_readwrite))
+ if ((Attributes & ObjCPropertyDecl::OBJC_PR_nonatomic) ||
+ !(Attributes & ObjCPropertyDecl::OBJC_PR_readwrite))
continue;
if (const ObjCPropertyImplDecl *PIDecl
= IMPDecl->FindPropertyImplDecl(Property->getIdentifier())) {
void Sema::CheckObjCPropertyAttributes(Decl *PDecl,
SourceLocation Loc,
- unsigned &Attribute,
+ unsigned &Attributes,
bool propertyInPrimaryClass) {
// FIXME: Improve the reported location.
if (!PDecl || PDecl->isInvalidDecl())
QualType PropertyTy = PropertyDecl->getType();
if (getLangOpts().ObjCAutoRefCount &&
- (Attribute & ObjCDeclSpec::DQ_PR_readonly) &&
+ (Attributes & ObjCDeclSpec::DQ_PR_readonly) &&
PropertyTy->isObjCRetainableType()) {
// 'readonly' property with no obvious lifetime.
// its life time will be determined by its backing ivar.
ObjCDeclSpec::DQ_PR_strong |
ObjCDeclSpec::DQ_PR_weak |
ObjCDeclSpec::DQ_PR_assign);
- if ((Attribute & rel) == 0)
+ if ((Attributes & rel) == 0)
return;
}
// we postpone most property diagnosis until class's implementation
// because, its readonly attribute may be overridden in its class
// extensions making other attributes, which make no sense, to make sense.
- if ((Attribute & ObjCDeclSpec::DQ_PR_readonly) &&
- (Attribute & ObjCDeclSpec::DQ_PR_readwrite))
+ if ((Attributes & ObjCDeclSpec::DQ_PR_readonly) &&
+ (Attributes & ObjCDeclSpec::DQ_PR_readwrite))
Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
<< "readonly" << "readwrite";
}
// readonly and readwrite/assign/retain/copy conflict.
- else if ((Attribute & ObjCDeclSpec::DQ_PR_readonly) &&
- (Attribute & (ObjCDeclSpec::DQ_PR_readwrite |
+ else if ((Attributes & ObjCDeclSpec::DQ_PR_readonly) &&
+ (Attributes & (ObjCDeclSpec::DQ_PR_readwrite |
ObjCDeclSpec::DQ_PR_assign |
ObjCDeclSpec::DQ_PR_unsafe_unretained |
ObjCDeclSpec::DQ_PR_copy |
ObjCDeclSpec::DQ_PR_retain |
ObjCDeclSpec::DQ_PR_strong))) {
- const char * which = (Attribute & ObjCDeclSpec::DQ_PR_readwrite) ?
+ const char * which = (Attributes & ObjCDeclSpec::DQ_PR_readwrite) ?
"readwrite" :
- (Attribute & ObjCDeclSpec::DQ_PR_assign) ?
+ (Attributes & ObjCDeclSpec::DQ_PR_assign) ?
"assign" :
- (Attribute & ObjCDeclSpec::DQ_PR_unsafe_unretained) ?
+ (Attributes & ObjCDeclSpec::DQ_PR_unsafe_unretained) ?
"unsafe_unretained" :
- (Attribute & ObjCDeclSpec::DQ_PR_copy) ?
+ (Attributes & ObjCDeclSpec::DQ_PR_copy) ?
"copy" : "retain";
- Diag(Loc, (Attribute & (ObjCDeclSpec::DQ_PR_readwrite)) ?
+ Diag(Loc, (Attributes & (ObjCDeclSpec::DQ_PR_readwrite)) ?
diag::err_objc_property_attr_mutually_exclusive :
diag::warn_objc_property_attr_mutually_exclusive)
<< "readonly" << which;
}
// Check for copy or retain on non-object types.
- if ((Attribute & (ObjCDeclSpec::DQ_PR_weak | ObjCDeclSpec::DQ_PR_copy |
+ if ((Attributes & (ObjCDeclSpec::DQ_PR_weak | ObjCDeclSpec::DQ_PR_copy |
ObjCDeclSpec::DQ_PR_retain | ObjCDeclSpec::DQ_PR_strong)) &&
!PropertyTy->isObjCRetainableType() &&
!PropertyDecl->getAttr<ObjCNSObjectAttr>()) {
Diag(Loc, diag::err_objc_property_requires_object)
- << (Attribute & ObjCDeclSpec::DQ_PR_weak ? "weak" :
- Attribute & ObjCDeclSpec::DQ_PR_copy ? "copy" : "retain (or strong)");
- Attribute &= ~(ObjCDeclSpec::DQ_PR_weak | ObjCDeclSpec::DQ_PR_copy |
+ << (Attributes & ObjCDeclSpec::DQ_PR_weak ? "weak" :
+ Attributes & ObjCDeclSpec::DQ_PR_copy ? "copy" : "retain (or strong)");
+ Attributes &= ~(ObjCDeclSpec::DQ_PR_weak | ObjCDeclSpec::DQ_PR_copy |
ObjCDeclSpec::DQ_PR_retain | ObjCDeclSpec::DQ_PR_strong);
PropertyDecl->setInvalidDecl();
}
// Check for more than one of { assign, copy, retain }.
- if (Attribute & ObjCDeclSpec::DQ_PR_assign) {
- if (Attribute & ObjCDeclSpec::DQ_PR_copy) {
+ if (Attributes & ObjCDeclSpec::DQ_PR_assign) {
+ if (Attributes & ObjCDeclSpec::DQ_PR_copy) {
Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
<< "assign" << "copy";
- Attribute &= ~ObjCDeclSpec::DQ_PR_copy;
+ Attributes &= ~ObjCDeclSpec::DQ_PR_copy;
}
- if (Attribute & ObjCDeclSpec::DQ_PR_retain) {
+ if (Attributes & ObjCDeclSpec::DQ_PR_retain) {
Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
<< "assign" << "retain";
- Attribute &= ~ObjCDeclSpec::DQ_PR_retain;
+ Attributes &= ~ObjCDeclSpec::DQ_PR_retain;
}
- if (Attribute & ObjCDeclSpec::DQ_PR_strong) {
+ if (Attributes & ObjCDeclSpec::DQ_PR_strong) {
Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
<< "assign" << "strong";
- Attribute &= ~ObjCDeclSpec::DQ_PR_strong;
+ Attributes &= ~ObjCDeclSpec::DQ_PR_strong;
}
if (getLangOpts().ObjCAutoRefCount &&
- (Attribute & ObjCDeclSpec::DQ_PR_weak)) {
+ (Attributes & ObjCDeclSpec::DQ_PR_weak)) {
Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
<< "assign" << "weak";
- Attribute &= ~ObjCDeclSpec::DQ_PR_weak;
+ Attributes &= ~ObjCDeclSpec::DQ_PR_weak;
}
- } else if (Attribute & ObjCDeclSpec::DQ_PR_unsafe_unretained) {
- if (Attribute & ObjCDeclSpec::DQ_PR_copy) {
+ } else if (Attributes & ObjCDeclSpec::DQ_PR_unsafe_unretained) {
+ if (Attributes & ObjCDeclSpec::DQ_PR_copy) {
Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
<< "unsafe_unretained" << "copy";
- Attribute &= ~ObjCDeclSpec::DQ_PR_copy;
+ Attributes &= ~ObjCDeclSpec::DQ_PR_copy;
}
- if (Attribute & ObjCDeclSpec::DQ_PR_retain) {
+ if (Attributes & ObjCDeclSpec::DQ_PR_retain) {
Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
<< "unsafe_unretained" << "retain";
- Attribute &= ~ObjCDeclSpec::DQ_PR_retain;
+ Attributes &= ~ObjCDeclSpec::DQ_PR_retain;
}
- if (Attribute & ObjCDeclSpec::DQ_PR_strong) {
+ if (Attributes & ObjCDeclSpec::DQ_PR_strong) {
Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
<< "unsafe_unretained" << "strong";
- Attribute &= ~ObjCDeclSpec::DQ_PR_strong;
+ Attributes &= ~ObjCDeclSpec::DQ_PR_strong;
}
if (getLangOpts().ObjCAutoRefCount &&
- (Attribute & ObjCDeclSpec::DQ_PR_weak)) {
+ (Attributes & ObjCDeclSpec::DQ_PR_weak)) {
Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
<< "unsafe_unretained" << "weak";
- Attribute &= ~ObjCDeclSpec::DQ_PR_weak;
+ Attributes &= ~ObjCDeclSpec::DQ_PR_weak;
}
- } else if (Attribute & ObjCDeclSpec::DQ_PR_copy) {
- if (Attribute & ObjCDeclSpec::DQ_PR_retain) {
+ } else if (Attributes & ObjCDeclSpec::DQ_PR_copy) {
+ if (Attributes & ObjCDeclSpec::DQ_PR_retain) {
Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
<< "copy" << "retain";
- Attribute &= ~ObjCDeclSpec::DQ_PR_retain;
+ Attributes &= ~ObjCDeclSpec::DQ_PR_retain;
}
- if (Attribute & ObjCDeclSpec::DQ_PR_strong) {
+ if (Attributes & ObjCDeclSpec::DQ_PR_strong) {
Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
<< "copy" << "strong";
- Attribute &= ~ObjCDeclSpec::DQ_PR_strong;
+ Attributes &= ~ObjCDeclSpec::DQ_PR_strong;
}
- if (Attribute & ObjCDeclSpec::DQ_PR_weak) {
+ if (Attributes & ObjCDeclSpec::DQ_PR_weak) {
Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
<< "copy" << "weak";
- Attribute &= ~ObjCDeclSpec::DQ_PR_weak;
+ Attributes &= ~ObjCDeclSpec::DQ_PR_weak;
}
}
- else if ((Attribute & ObjCDeclSpec::DQ_PR_retain) &&
- (Attribute & ObjCDeclSpec::DQ_PR_weak)) {
+ else if ((Attributes & ObjCDeclSpec::DQ_PR_retain) &&
+ (Attributes & ObjCDeclSpec::DQ_PR_weak)) {
Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
<< "retain" << "weak";
- Attribute &= ~ObjCDeclSpec::DQ_PR_retain;
+ Attributes &= ~ObjCDeclSpec::DQ_PR_retain;
}
- else if ((Attribute & ObjCDeclSpec::DQ_PR_strong) &&
- (Attribute & ObjCDeclSpec::DQ_PR_weak)) {
+ else if ((Attributes & ObjCDeclSpec::DQ_PR_strong) &&
+ (Attributes & ObjCDeclSpec::DQ_PR_weak)) {
Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
<< "strong" << "weak";
- Attribute &= ~ObjCDeclSpec::DQ_PR_weak;
+ Attributes &= ~ObjCDeclSpec::DQ_PR_weak;
}
- if ((Attribute & ObjCDeclSpec::DQ_PR_atomic) &&
- (Attribute & ObjCDeclSpec::DQ_PR_nonatomic)) {
+ if ((Attributes & ObjCDeclSpec::DQ_PR_atomic) &&
+ (Attributes & ObjCDeclSpec::DQ_PR_nonatomic)) {
Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
<< "atomic" << "nonatomic";
- Attribute &= ~ObjCDeclSpec::DQ_PR_atomic;
+ Attributes &= ~ObjCDeclSpec::DQ_PR_atomic;
}
// Warn if user supplied no assignment attribute, property is
// readwrite, and this is an object type.
- if (!(Attribute & (ObjCDeclSpec::DQ_PR_assign | ObjCDeclSpec::DQ_PR_copy |
+ if (!(Attributes & (ObjCDeclSpec::DQ_PR_assign | ObjCDeclSpec::DQ_PR_copy |
ObjCDeclSpec::DQ_PR_unsafe_unretained |
ObjCDeclSpec::DQ_PR_retain | ObjCDeclSpec::DQ_PR_strong |
ObjCDeclSpec::DQ_PR_weak)) &&
// With arc, @property definitions should default to (strong) when
// not specified; including when property is 'readonly'.
PropertyDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_strong);
- else if (!(Attribute & ObjCDeclSpec::DQ_PR_readonly)) {
+ else if (!(Attributes & ObjCDeclSpec::DQ_PR_readonly)) {
bool isAnyClassTy =
(PropertyTy->isObjCClassType() ||
PropertyTy->isObjCQualifiedClassType());
// (please trim this list while you are at it).
}
- if (!(Attribute & ObjCDeclSpec::DQ_PR_copy)
- &&!(Attribute & ObjCDeclSpec::DQ_PR_readonly)
+ if (!(Attributes & ObjCDeclSpec::DQ_PR_copy)
+ &&!(Attributes & ObjCDeclSpec::DQ_PR_readonly)
&& getLangOpts().getGC() == LangOptions::GCOnly
&& PropertyTy->isBlockPointerType())
Diag(Loc, diag::warn_objc_property_copy_missing_on_block);
- else if ((Attribute & ObjCDeclSpec::DQ_PR_retain) &&
- !(Attribute & ObjCDeclSpec::DQ_PR_readonly) &&
- !(Attribute & ObjCDeclSpec::DQ_PR_strong) &&
+ else if ((Attributes & ObjCDeclSpec::DQ_PR_retain) &&
+ !(Attributes & ObjCDeclSpec::DQ_PR_readonly) &&
+ !(Attributes & ObjCDeclSpec::DQ_PR_strong) &&
PropertyTy->isBlockPointerType())
Diag(Loc, diag::warn_objc_property_retain_of_block);
- if ((Attribute & ObjCDeclSpec::DQ_PR_readonly) &&
- (Attribute & ObjCDeclSpec::DQ_PR_setter))
+ if ((Attributes & ObjCDeclSpec::DQ_PR_readonly) &&
+ (Attributes & ObjCDeclSpec::DQ_PR_setter))
Diag(Loc, diag::warn_objc_readonly_property_has_setter);
}
-//===--- TargetAttributesSema.h - Semantic Analysis For Target Attribute -===//
+//===--- TargetAttributesSema.h - Semantic Analysis For Target Attributes -===//
//
// The LLVM Compiler Infrastructure
//
if (FTL && VisitFunctionTypeLoc(*FTL, true))
return true;
- // FIXME: Attribute?
+ // FIXME: Attributes?
}
if (ND->doesThisDeclarationHaveABody() && !ND->isLateTemplateParsed()) {