*/
CXCursor_TranslationUnit = 300,
- /* Attributes */
+ /* Attribute */
CXCursor_FirstAttr = 400,
/**
* \brief An attribute whose specific kind is not exposed via this
};
struct Info {
- const char *Name, *Type, *Attributes, *HeaderName;
+ const char *Name, *Type, *Attribute, *HeaderName;
LanguageID builtin_lang;
bool operator==(const Info &RHS) const {
return !strcmp(Name, RHS.Name) &&
!strcmp(Type, RHS.Type) &&
- !strcmp(Attributes, RHS.Attributes);
+ !strcmp(Attribute, RHS.Attribute);
}
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).Attributes, 'c') != 0;
+ return strchr(GetRecord(ID).Attribute, 'c') != 0;
}
/// \brief Return true if we know this builtin never throws an exception.
bool isNoThrow(unsigned ID) const {
- return strchr(GetRecord(ID).Attributes, 'n') != 0;
+ return strchr(GetRecord(ID).Attribute, 'n') != 0;
}
/// \brief Return true if we know this builtin never returns.
bool isNoReturn(unsigned ID) const {
- return strchr(GetRecord(ID).Attributes, 'r') != 0;
+ return strchr(GetRecord(ID).Attribute, 'r') != 0;
}
/// \brief Return true if we know this builtin can return twice.
bool isReturnsTwice(unsigned ID) const {
- return strchr(GetRecord(ID).Attributes, 'j') != 0;
+ return strchr(GetRecord(ID).Attribute, '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).Attributes, 'F') != 0;
+ return strchr(GetRecord(ID).Attribute, '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).Attributes, 'f') != 0;
+ return strchr(GetRecord(ID).Attribute, 'f') != 0;
}
/// \brief Determines whether this builtin has custom typechecking.
bool hasCustomTypechecking(unsigned ID) const {
- return strchr(GetRecord(ID).Attributes, 't') != 0;
+ return strchr(GetRecord(ID).Attribute, '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).Attributes, 'e') != 0;
+ return strchr(GetRecord(ID).Attribute, 'e') != 0;
}
private:
DeclSpec &DS, const ParsedTemplateInfo &TemplateInfo,
AccessSpecifier AS, bool EnteringContext,
DeclSpecContext DSC,
- ParsedAttributesWithRange &Attributes);
+ ParsedAttributesWithRange &Attribute);
void ParseCXXMemberSpecification(SourceLocation StartLoc, unsigned TagType,
Decl *TagDecl);
ExprResult ParseCXXMemberInitializer(Decl *D, bool IsFunction,
/// \brief Is this Declarator a redeclaration?
bool Redeclaration : 1;
- /// Attrs - Attributes.
+ /// Attrs - Attribute.
ParsedAttributes Attrs;
/// \brief The asm label, if specified.
Selector SetterSel,
const bool isAssign,
const bool isReadWrite,
- const unsigned Attributes,
+ const unsigned Attribute,
const unsigned AttributesAsWritten,
bool *isOverridingProperty,
TypeSourceInfo *T,
Selector SetterSel,
const bool isAssign,
const bool isReadWrite,
- const unsigned Attributes,
+ const unsigned Attribute,
const unsigned AttributesAsWritten,
TypeSourceInfo *T,
tok::ObjCKeywordKind MethodImplKind,
SmallVectorImpl<Decl *> &Protocols);
/// Ensure attributes are consistent with type.
- /// \param [in, out] Attributes The attributes to check; they will
+ /// \param [in, out] Attribute The attributes to check; they will
/// be modified to be consistent with \p PropertyTy.
void CheckObjCPropertyAttributes(Decl *PropertyPtrTy,
SourceLocation Loc,
- unsigned &Attributes,
+ unsigned &Attribute,
bool propertyInPrimaryClass);
/// Process the specified property declaration and create decls for the
OS << ExceptionSpec;
}
- // FIXME: Attributes
+ // FIXME: Attribute
// 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].Attributes, 'f')) {
+ if (!LangOpts.NoBuiltin || !strchr(BuiltinInfo[i].Attribute, '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].Attributes, 'f'))
+ if (!LangOpts.NoBuiltin || !strchr(TSRecords[i].Attribute, '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].Attributes, 'f'))
+ if (!NoBuiltins || !strchr(BuiltinInfo[i].Attribute, '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].Attributes, 'f'))
+ if (!NoBuiltins || !strchr(TSRecords[i].Attribute, 'f'))
Names.push_back(TSRecords[i].Name);
}
bool
Builtin::Context::isPrintfLike(unsigned ID, unsigned &FormatIdx,
bool &HasVAListArg) {
- const char *Printf = strpbrk(GetRecord(ID).Attributes, "pP");
+ const char *Printf = strpbrk(GetRecord(ID).Attribute, "pP");
if (!Printf)
return false;
bool
Builtin::Context::isScanfLike(unsigned ID, unsigned &FormatIdx,
bool &HasVAListArg) {
- const char *Scanf = strpbrk(GetRecord(ID).Attributes, "sS");
+ const char *Scanf = strpbrk(GetRecord(ID).Attribute, "sS");
if (!Scanf)
return false;
CallingConv = FI.getEffectiveCallingConvention();
if (FI.isNoReturn())
- FuncAttrs.addAttribute(llvm::Attributes::NoReturn);
+ FuncAttrs.addAttribute(llvm::Attribute::NoReturn);
// FIXME: handle sseregparm someday...
if (TargetDecl) {
if (TargetDecl->hasAttr<ReturnsTwiceAttr>())
- FuncAttrs.addAttribute(llvm::Attributes::ReturnsTwice);
+ FuncAttrs.addAttribute(llvm::Attribute::ReturnsTwice);
if (TargetDecl->hasAttr<NoThrowAttr>())
- FuncAttrs.addAttribute(llvm::Attributes::NoUnwind);
+ FuncAttrs.addAttribute(llvm::Attribute::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::Attributes::NoUnwind);
+ FuncAttrs.addAttribute(llvm::Attribute::NoUnwind);
}
if (TargetDecl->hasAttr<NoReturnAttr>())
- FuncAttrs.addAttribute(llvm::Attributes::NoReturn);
+ FuncAttrs.addAttribute(llvm::Attribute::NoReturn);
if (TargetDecl->hasAttr<ReturnsTwiceAttr>())
- FuncAttrs.addAttribute(llvm::Attributes::ReturnsTwice);
+ FuncAttrs.addAttribute(llvm::Attribute::ReturnsTwice);
// 'const' and 'pure' attribute functions are also nounwind.
if (TargetDecl->hasAttr<ConstAttr>()) {
- FuncAttrs.addAttribute(llvm::Attributes::ReadNone);
- FuncAttrs.addAttribute(llvm::Attributes::NoUnwind);
+ FuncAttrs.addAttribute(llvm::Attribute::ReadNone);
+ FuncAttrs.addAttribute(llvm::Attribute::NoUnwind);
} else if (TargetDecl->hasAttr<PureAttr>()) {
- FuncAttrs.addAttribute(llvm::Attributes::ReadOnly);
- FuncAttrs.addAttribute(llvm::Attributes::NoUnwind);
+ FuncAttrs.addAttribute(llvm::Attribute::ReadOnly);
+ FuncAttrs.addAttribute(llvm::Attribute::NoUnwind);
}
if (TargetDecl->hasAttr<MallocAttr>())
- RetAttrs.addAttribute(llvm::Attributes::NoAlias);
+ RetAttrs.addAttribute(llvm::Attribute::NoAlias);
}
if (CodeGenOpts.OptimizeSize)
- FuncAttrs.addAttribute(llvm::Attributes::OptimizeForSize);
+ FuncAttrs.addAttribute(llvm::Attribute::OptimizeForSize);
if (CodeGenOpts.OptimizeSize == 2)
- FuncAttrs.addAttribute(llvm::Attributes::MinSize);
+ FuncAttrs.addAttribute(llvm::Attribute::MinSize);
if (CodeGenOpts.DisableRedZone)
- FuncAttrs.addAttribute(llvm::Attributes::NoRedZone);
+ FuncAttrs.addAttribute(llvm::Attribute::NoRedZone);
if (CodeGenOpts.NoImplicitFloat)
- FuncAttrs.addAttribute(llvm::Attributes::NoImplicitFloat);
+ FuncAttrs.addAttribute(llvm::Attribute::NoImplicitFloat);
QualType RetTy = FI.getReturnType();
unsigned Index = 1;
switch (RetAI.getKind()) {
case ABIArgInfo::Extend:
if (RetTy->hasSignedIntegerRepresentation())
- RetAttrs.addAttribute(llvm::Attributes::SExt);
+ RetAttrs.addAttribute(llvm::Attribute::SExt);
else if (RetTy->hasUnsignedIntegerRepresentation())
- RetAttrs.addAttribute(llvm::Attributes::ZExt);
+ RetAttrs.addAttribute(llvm::Attribute::ZExt);
break;
case ABIArgInfo::Direct:
case ABIArgInfo::Ignore:
case ABIArgInfo::Indirect: {
llvm::AttrBuilder SRETAttrs;
- SRETAttrs.addAttribute(llvm::Attributes::StructRet);
+ SRETAttrs.addAttribute(llvm::Attribute::StructRet);
if (RetAI.getInReg())
- SRETAttrs.addAttribute(llvm::Attributes::InReg);
+ SRETAttrs.addAttribute(llvm::Attribute::InReg);
PAL.push_back(llvm::
AttributeWithIndex::get(Index,
- llvm::Attributes::get(getLLVMContext(),
+ llvm::Attribute::get(getLLVMContext(),
SRETAttrs)));
++Index;
// sret disables readnone and readonly
- FuncAttrs.removeAttribute(llvm::Attributes::ReadOnly)
- .removeAttribute(llvm::Attributes::ReadNone);
+ FuncAttrs.removeAttribute(llvm::Attribute::ReadOnly)
+ .removeAttribute(llvm::Attribute::ReadNone);
break;
}
if (RetAttrs.hasAttributes())
PAL.push_back(llvm::
AttributeWithIndex::get(llvm::AttributeSet::ReturnIndex,
- llvm::Attributes::get(getLLVMContext(),
+ llvm::Attribute::get(getLLVMContext(),
RetAttrs)));
for (CGFunctionInfo::const_arg_iterator it = FI.arg_begin(),
if (AI.getPaddingType()) {
if (AI.getPaddingInReg()) {
llvm::AttrBuilder PadAttrs;
- PadAttrs.addAttribute(llvm::Attributes::InReg);
+ PadAttrs.addAttribute(llvm::Attribute::InReg);
- llvm::Attributes A =llvm::Attributes::get(getLLVMContext(), PadAttrs);
+ llvm::Attribute A =llvm::Attribute::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::Attributes::SExt);
+ Attrs.addAttribute(llvm::Attribute::SExt);
else if (ParamType->isUnsignedIntegerOrEnumerationType())
- Attrs.addAttribute(llvm::Attributes::ZExt);
+ Attrs.addAttribute(llvm::Attribute::ZExt);
// FALL THROUGH
case ABIArgInfo::Direct:
if (AI.getInReg())
- Attrs.addAttribute(llvm::Attributes::InReg);
+ Attrs.addAttribute(llvm::Attribute::InReg);
// FIXME: handle sseregparm someday...
if (Attrs.hasAttributes())
for (unsigned I = 0; I < Extra; ++I)
PAL.push_back(llvm::AttributeWithIndex::get(Index + I,
- llvm::Attributes::get(getLLVMContext(),
+ llvm::Attribute::get(getLLVMContext(),
Attrs)));
Index += Extra;
}
case ABIArgInfo::Indirect:
if (AI.getInReg())
- Attrs.addAttribute(llvm::Attributes::InReg);
+ Attrs.addAttribute(llvm::Attribute::InReg);
if (AI.getIndirectByVal())
- Attrs.addAttribute(llvm::Attributes::ByVal);
+ Attrs.addAttribute(llvm::Attribute::ByVal);
Attrs.addAlignmentAttr(AI.getIndirectAlign());
// byval disables readnone and readonly.
- FuncAttrs.removeAttribute(llvm::Attributes::ReadOnly)
- .removeAttribute(llvm::Attributes::ReadNone);
+ FuncAttrs.removeAttribute(llvm::Attribute::ReadOnly)
+ .removeAttribute(llvm::Attribute::ReadNone);
break;
case ABIArgInfo::Ignore:
if (Attrs.hasAttributes())
PAL.push_back(llvm::AttributeWithIndex::get(Index,
- llvm::Attributes::get(getLLVMContext(),
+ llvm::Attribute::get(getLLVMContext(),
Attrs)));
++Index;
}
if (FuncAttrs.hasAttributes())
PAL.push_back(llvm::
AttributeWithIndex::get(llvm::AttributeSet::FunctionIndex,
- llvm::Attributes::get(getLLVMContext(),
+ llvm::Attribute::get(getLLVMContext(),
FuncAttrs)));
}
// Name the struct return argument.
if (CGM.ReturnTypeUsesSRet(FI)) {
AI->setName("agg.result");
- AI->addAttr(llvm::Attributes::get(getLLVMContext(),
- llvm::Attributes::NoAlias));
+ AI->addAttr(llvm::Attribute::get(getLLVMContext(),
+ llvm::Attribute::NoAlias));
++AI;
}
llvm::Value *V = AI;
if (Arg->getType().isRestrictQualified())
- AI->addAttr(llvm::Attributes::get(getLLVMContext(),
- llvm::Attributes::NoAlias));
+ AI->addAttr(llvm::Attribute::get(getLLVMContext(),
+ llvm::Attribute::NoAlias));
// Ensure the argument is the correct type.
if (V->getType() != ArgI.getCoerceToType())
AttributeList);
llvm::BasicBlock *InvokeDest = 0;
- if (!Attrs.getFnAttributes().hasAttribute(llvm::Attributes::NoUnwind))
+ if (!Attrs.getFnAttributes().hasAttribute(llvm::Attribute::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::Attributes::AlwaysInline);
+ CurFn->addFnAttr(llvm::Attribute::AlwaysInline);
break;
}
Fn->setDoesNotThrow();
if (CGM.getLangOpts().SanitizeAddress)
- Fn->addFnAttr(llvm::Attributes::AddressSafety);
+ Fn->addFnAttr(llvm::Attribute::AddressSafety);
return Fn;
}
llvm::FunctionType::get(CGM.VoidTy, ArgTypes, false);
llvm::AttrBuilder B;
if (!Recover) {
- B.addAttribute(llvm::Attributes::NoReturn)
- .addAttribute(llvm::Attributes::NoUnwind);
+ B.addAttribute(llvm::Attribute::NoReturn)
+ .addAttribute(llvm::Attribute::NoUnwind);
}
- B.addAttribute(llvm::Attributes::UWTable);
+ B.addAttribute(llvm::Attribute::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::Attributes::get(getLLVMContext(), B));
+ llvm::Attribute::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::Attributes::NonLazyBind);
+ f->addFnAttr(llvm::Attribute::NonLazyBind);
}
return fn;
return CGM.CreateRuntimeFunction(llvm::FunctionType::get(ObjectPtrTy,
params, true),
"objc_msgSend",
- llvm::Attributes::get(CGM.getLLVMContext(),
- llvm::Attributes::NonLazyBind));
+ llvm::Attribute::get(CGM.getLLVMContext(),
+ llvm::Attribute::NonLazyBind));
}
/// void objc_msgSend_stret (id, SEL, ...)
return CGM.CreateRuntimeFunction(llvm::FunctionType::get(CGM.Int32Ty,
params, false),
"_setjmp",
- llvm::Attributes::get(CGM.getLLVMContext(),
- llvm::Attributes::NonLazyBind));
+ llvm::Attribute::get(CGM.getLLVMContext(),
+ llvm::Attribute::NonLazyBind));
}
public:
/* IsAlignStack */ false, AsmDialect);
llvm::CallInst *Result = Builder.CreateCall(IA, Args);
Result->addAttribute(llvm::AttributeSet::FunctionIndex,
- llvm::Attributes::get(getLLVMContext(),
- llvm::Attributes::NoUnwind));
+ llvm::Attribute::get(getLLVMContext(),
+ llvm::Attribute::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::Attributes::InlineHint);
+ Fn->addFnAttr(llvm::Attribute::InlineHint);
break;
}
F->setHasUWTable();
if (!hasUnwindExceptions(LangOpts))
- F->addFnAttr(llvm::Attributes::NoUnwind);
+ F->addFnAttr(llvm::Attribute::NoUnwind);
if (D->hasAttr<NakedAttr>()) {
// Naked implies noinline: we should not be inlining such functions.
- F->addFnAttr(llvm::Attributes::Naked);
- F->addFnAttr(llvm::Attributes::NoInline);
+ F->addFnAttr(llvm::Attribute::Naked);
+ F->addFnAttr(llvm::Attribute::NoInline);
}
if (D->hasAttr<NoInlineAttr>())
- F->addFnAttr(llvm::Attributes::NoInline);
+ F->addFnAttr(llvm::Attribute::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::Attributes::NoInline))
- F->addFnAttr(llvm::Attributes::AlwaysInline);
+ !F->getFnAttributes().hasAttribute(llvm::Attribute::NoInline))
+ F->addFnAttr(llvm::Attribute::AlwaysInline);
// FIXME: Communicate hot and cold attributes to LLVM more directly.
if (D->hasAttr<ColdAttr>())
- F->addFnAttr(llvm::Attributes::OptimizeForSize);
+ F->addFnAttr(llvm::Attribute::OptimizeForSize);
if (D->hasAttr<MinSizeAttr>())
- F->addFnAttr(llvm::Attributes::MinSize);
+ F->addFnAttr(llvm::Attribute::MinSize);
if (isa<CXXConstructorDecl>(D) || isa<CXXDestructorDecl>(D))
F->setUnnamedAddr(true);
F->setUnnamedAddr(true);
if (LangOpts.getStackProtector() == LangOptions::SSPOn)
- F->addFnAttr(llvm::Attributes::StackProtect);
+ F->addFnAttr(llvm::Attribute::StackProtect);
else if (LangOpts.getStackProtector() == LangOptions::SSPReq)
- F->addFnAttr(llvm::Attributes::StackProtectReq);
+ F->addFnAttr(llvm::Attribute::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::Attributes::AddressSafety);
+ F->addFnAttr(llvm::Attribute::AddressSafety);
}
unsigned alignment = D->getMaxAlignment() / Context.getCharWidth();
CodeGenModule::GetOrCreateLLVMFunction(StringRef MangledName,
llvm::Type *Ty,
GlobalDecl D, bool ForVTable,
- llvm::Attributes ExtraAttrs) {
+ llvm::Attribute 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::Attributes ExtraAttrs) {
+ llvm::Attribute ExtraAttrs) {
return GetOrCreateLLVMFunction(Name, FTy, GlobalDecl(), /*ForVTable=*/false,
ExtraAttrs);
}
llvm::AttributeSet oldAttrs = callSite.getAttributes();
// Collect any return attributes from the call.
- llvm::Attributes returnAttrs = oldAttrs.getRetAttributes();
+ llvm::Attribute returnAttrs = oldAttrs.getRetAttributes();
if (returnAttrs.hasAttributes())
newAttrs.push_back(llvm::AttributeWithIndex::get(
llvm::AttributeSet::ReturnIndex, returnAttrs));
}
// Add any parameter attributes.
- llvm::Attributes pAttrs = oldAttrs.getParamAttributes(argNo + 1);
+ llvm::Attribute pAttrs = oldAttrs.getParamAttributes(argNo + 1);
if (pAttrs.hasAttributes())
newAttrs.push_back(llvm::AttributeWithIndex::get(argNo + 1, pAttrs));
}
if (dontTransform)
continue;
- llvm::Attributes fnAttrs = oldAttrs.getFnAttributes();
+ llvm::Attribute 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::Attributes ExtraAttrs =
- llvm::Attributes());
+ llvm::Attribute ExtraAttrs =
+ llvm::Attribute());
/// 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::Attributes ExtraAttrs =
- llvm::Attributes());
+ llvm::Attribute ExtraAttrs =
+ llvm::Attribute());
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::Attributes::get(CGM.getLLVMContext(),
- llvm::Attributes::NoUnwind));
+ llvm::Attribute::get(CGM.getLLVMContext(),
+ llvm::Attribute::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::Attributes::get(CGM.getLLVMContext(),
- llvm::Attributes::NoUnwind));
+ llvm::Attribute::get(CGM.getLLVMContext(),
+ llvm::Attribute::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::Attributes::get(CGM.getLLVMContext(),
- llvm::Attributes::NoUnwind));
+ llvm::Attribute::get(CGM.getLLVMContext(),
+ llvm::Attribute::NoUnwind));
}
namespace {
llvm::AttrBuilder B;
B.addStackAlignmentAttr(16);
Fn->addAttribute(llvm::AttributeSet::FunctionIndex,
- llvm::Attributes::get(CGM.getLLVMContext(), B));
+ llvm::Attribute::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::Attributes::NoInline);
+ F->addFnAttr(llvm::Attribute::NoInline);
}
}
F->setCallingConv(CC);
// Step 2: Add attributes goodness.
- F->addFnAttr(llvm::Attributes::NoInline);
+ F->addFnAttr(llvm::Attribute::NoInline);
}
// Step 3: Emit _interrupt_handler alias.
F->setCallingConv(llvm::CallingConv::MSP430_INTR);
// Step 2: Add attributes goodness.
- F->addFnAttr(llvm::Attributes::NoInline);
+ F->addFnAttr(llvm::Attribute::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::Attributes::NoInline);
+ F->addFnAttr(llvm::Attribute::NoInline);
if (FD->hasAttr<ReqdWorkGroupSizeAttr>()) {
};
/// \brief The set of attributes that can be attached to a module.
- struct Attributes {
- Attributes() : IsSystem() { }
+ struct Attribute {
+ Attribute() : 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(Attributes &Attrs);
+ bool parseOptionalAttributes(Attribute &Attrs);
const DirectoryEntry *getOverriddenHeaderSearchDir();
SourceLocation ModuleNameLoc = Id.back().second;
// Parse the optional attribute list.
- Attributes Attrs;
+ Attribute Attrs;
parseOptionalAttributes(Attrs);
// Parse the opening brace.
}
// Parse optional attributes.
- Attributes Attrs;
+ Attribute 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(Attributes &Attrs) {
+bool ModuleMapParser::parseOptionalAttributes(Attribute &Attrs) {
bool HadError = false;
while (Tok.is(MMToken::LSquare)) {
new LateParsedAttribute(this, *AttrName, AttrNameLoc);
LateAttrs->push_back(LA);
- // Attributes in a class are parsed at the end of the class, along
+ // Attribute 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 Attributes:
+// Late Parsed Attribute:
// 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 Attributes(AttrFactory);
+ ParsedAttributesWithRange Attribute(AttrFactory);
ParseClassSpecifier(Kind, Loc, DS, TemplateInfo, AS,
- EnteringContext, DSContext, Attributes);
+ EnteringContext, DSContext, Attribute);
// If there are attributes following class specifier,
// take them over and handle them here.
- if (!Attributes.empty()) {
+ if (!Attribute.empty()) {
AttrsLastTime = true;
- attrs.takeAllFrom(Attributes);
+ attrs.takeAllFrom(Attribute);
}
continue;
}
ParsingFieldDeclarator DeclaratorInfo(*this, DS);
DeclaratorInfo.D.setCommaLoc(CommaLoc);
- // Attributes are only allowed here on successive declarators.
+ // Attribute are only allowed here on successive declarators.
if (!FirstDeclarator)
MaybeParseGNUAttributes(DeclaratorInfo.D);
IsScopedUsingClassTag = Tok.is(tok::kw_class);
ScopedEnumKWLoc = ConsumeToken();
- // Attributes are not allowed between these keywords. Diagnose,
+ // Attribute 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 &Attributes) {
+ ParsedAttributesWithRange &Attribute) {
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(Attributes);
+ MaybeParseCXX0XAttributes(Attribute);
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(Attributes);
+ ProhibitAttributes(Attribute);
// If this is an elaborated type specifier, and we delayed
// diagnostics before, just merge them into the current pool.
HasInitializer = false;
DeclaratorInfo.setCommaLoc(CommaLoc);
- // Attributes are only allowed on the second declarator.
+ // Attribute are only allowed on the second declarator.
MaybeParseGNUAttributes(DeclaratorInfo);
if (Tok.isNot(tok::colon))
T.consumeClose();
- // Attributes here appertain to the array type. C++11 [expr.new]p5.
+ // Attribute here appertain to the array type. C++11 [expr.new]p5.
ParsedAttributes Attrs(AttrFactory);
MaybeParseCXX0XAttributes(Attrs);
if (!OID)
return;
- unsigned Attributes = PD->getPropertyAttributes();
+ unsigned Attribute = PD->getPropertyAttributes();
if (mustSynthesizeSetterGetterMethod(IMD, PD, true /*getter*/)) {
- bool GenGetProperty = !(Attributes & ObjCPropertyDecl::OBJC_PR_nonatomic) &&
- (Attributes & (ObjCPropertyDecl::OBJC_PR_retain |
+ bool GenGetProperty = !(Attribute & ObjCPropertyDecl::OBJC_PR_nonatomic) &&
+ (Attribute & (ObjCPropertyDecl::OBJC_PR_retain |
ObjCPropertyDecl::OBJC_PR_copy));
std::string Getr;
if (GenGetProperty && !objcGetPropertyDefined) {
// Generate the 'setter' function.
std::string Setr;
- bool GenSetProperty = Attributes & (ObjCPropertyDecl::OBJC_PR_retain |
+ bool GenSetProperty = Attribute & (ObjCPropertyDecl::OBJC_PR_retain |
ObjCPropertyDecl::OBJC_PR_copy);
if (GenSetProperty && !objcSetPropertyDefined) {
objcSetPropertyDefined = true;
Setr += ", (id)";
Setr += PD->getName();
Setr += ", ";
- if (Attributes & ObjCPropertyDecl::OBJC_PR_nonatomic)
+ if (Attribute & ObjCPropertyDecl::OBJC_PR_nonatomic)
Setr += "0, ";
else
Setr += "1, ";
- if (Attributes & ObjCPropertyDecl::OBJC_PR_copy)
+ if (Attribute & ObjCPropertyDecl::OBJC_PR_copy)
Setr += "1)";
else
Setr += "0)";
if (!OID)
return;
- unsigned Attributes = PD->getPropertyAttributes();
+ unsigned Attribute = PD->getPropertyAttributes();
if (!PD->getGetterMethodDecl()->isDefined()) {
- bool GenGetProperty = !(Attributes & ObjCPropertyDecl::OBJC_PR_nonatomic) &&
- (Attributes & (ObjCPropertyDecl::OBJC_PR_retain |
+ bool GenGetProperty = !(Attribute & ObjCPropertyDecl::OBJC_PR_nonatomic) &&
+ (Attribute & (ObjCPropertyDecl::OBJC_PR_retain |
ObjCPropertyDecl::OBJC_PR_copy));
std::string Getr;
if (GenGetProperty && !objcGetPropertyDefined) {
// Generate the 'setter' function.
std::string Setr;
- bool GenSetProperty = Attributes & (ObjCPropertyDecl::OBJC_PR_retain |
+ bool GenSetProperty = Attribute & (ObjCPropertyDecl::OBJC_PR_retain |
ObjCPropertyDecl::OBJC_PR_copy);
if (GenSetProperty && !objcSetPropertyDefined) {
objcSetPropertyDefined = true;
Setr += ", (id)";
Setr += PD->getName();
Setr += ", ";
- if (Attributes & ObjCPropertyDecl::OBJC_PR_nonatomic)
+ if (Attribute & ObjCPropertyDecl::OBJC_PR_nonatomic)
Setr += "0, ";
else
Setr += "1, ";
- if (Attributes & ObjCPropertyDecl::OBJC_PR_copy)
+ if (Attribute & ObjCPropertyDecl::OBJC_PR_copy)
Setr += "1)";
else
Setr += "0)";
-//===--- SemaAttr.cpp - Semantic Analysis for Attributes ------------------===//
+//===--- SemaAttr.cpp - Semantic Analysis for Attribute ------------------===//
//
// The LLVM Compiler Infrastructure
//
if (!PD)
return;
- unsigned Attributes = PD->getPropertyAttributes();
- if (Attributes & ObjCPropertyDecl::OBJC_PR_assign) {
+ unsigned Attribute = PD->getPropertyAttributes();
+ if (Attribute & 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 (Attributes & ObjCPropertyDecl::OBJC_PR_weak) {
+ else if (Attribute & 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 Attributes, unsigned NewFlag) {
+static bool ObjCPropertyFlagConflicts(unsigned Attribute, unsigned NewFlag) {
// Check if we've already added this flag.
- if (Attributes & NewFlag)
+ if (Attribute & NewFlag)
return true;
- Attributes |= NewFlag;
+ Attribute |= NewFlag;
// Check for collisions with "readonly".
- if ((Attributes & ObjCDeclSpec::DQ_PR_readonly) &&
- (Attributes & ObjCDeclSpec::DQ_PR_readwrite))
+ if ((Attribute & ObjCDeclSpec::DQ_PR_readonly) &&
+ (Attribute & ObjCDeclSpec::DQ_PR_readwrite))
return true;
// Check for more than one of { assign, copy, retain, strong, weak }.
- unsigned AssignCopyRetMask = Attributes & (ObjCDeclSpec::DQ_PR_assign |
+ unsigned AssignCopyRetMask = Attribute & (ObjCDeclSpec::DQ_PR_assign |
ObjCDeclSpec::DQ_PR_unsafe_unretained |
ObjCDeclSpec::DQ_PR_copy |
ObjCDeclSpec::DQ_PR_retain |
if (!CodeCompleter)
return;
- unsigned Attributes = ODS.getPropertyAttributes();
+ unsigned Attribute = ODS.getPropertyAttributes();
ResultBuilder Results(*this, CodeCompleter->getAllocator(),
CodeCompleter->getCodeCompletionTUInfo(),
CodeCompletionContext::CCC_Other);
Results.EnterNewScope();
- if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_readonly))
+ if (!ObjCPropertyFlagConflicts(Attribute, ObjCDeclSpec::DQ_PR_readonly))
Results.AddResult(CodeCompletionResult("readonly"));
- if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_assign))
+ if (!ObjCPropertyFlagConflicts(Attribute, ObjCDeclSpec::DQ_PR_assign))
Results.AddResult(CodeCompletionResult("assign"));
- if (!ObjCPropertyFlagConflicts(Attributes,
+ if (!ObjCPropertyFlagConflicts(Attribute,
ObjCDeclSpec::DQ_PR_unsafe_unretained))
Results.AddResult(CodeCompletionResult("unsafe_unretained"));
- if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_readwrite))
+ if (!ObjCPropertyFlagConflicts(Attribute, ObjCDeclSpec::DQ_PR_readwrite))
Results.AddResult(CodeCompletionResult("readwrite"));
- if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_retain))
+ if (!ObjCPropertyFlagConflicts(Attribute, ObjCDeclSpec::DQ_PR_retain))
Results.AddResult(CodeCompletionResult("retain"));
- if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_strong))
+ if (!ObjCPropertyFlagConflicts(Attribute, ObjCDeclSpec::DQ_PR_strong))
Results.AddResult(CodeCompletionResult("strong"));
- if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_copy))
+ if (!ObjCPropertyFlagConflicts(Attribute, ObjCDeclSpec::DQ_PR_copy))
Results.AddResult(CodeCompletionResult("copy"));
- if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_nonatomic))
+ if (!ObjCPropertyFlagConflicts(Attribute, ObjCDeclSpec::DQ_PR_nonatomic))
Results.AddResult(CodeCompletionResult("nonatomic"));
- if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_atomic))
+ if (!ObjCPropertyFlagConflicts(Attribute, 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(Attributes, ObjCDeclSpec::DQ_PR_weak))
+ if (!ObjCPropertyFlagConflicts(Attribute, ObjCDeclSpec::DQ_PR_weak))
Results.AddResult(CodeCompletionResult("weak"));
- if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_setter)) {
+ if (!ObjCPropertyFlagConflicts(Attribute, ObjCDeclSpec::DQ_PR_setter)) {
CodeCompletionBuilder Setter(Results.getAllocator(),
Results.getCodeCompletionTUInfo());
Setter.AddTypedTextChunk("setter");
Setter.AddPlaceholderChunk("method");
Results.AddResult(CodeCompletionResult(Setter.TakeString()));
}
- if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_getter)) {
+ if (!ObjCPropertyFlagConflicts(Attribute, ObjCDeclSpec::DQ_PR_getter)) {
CodeCompletionBuilder Getter(Results.getAllocator(),
Results.getCodeCompletionTUInfo());
Getter.AddTypedTextChunk("getter");
// Warn about ignored type attributes, for example:
// __attribute__((aligned)) struct A;
- // Attributes should be placed after tag to apply to type declaration.
+ // Attribute 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-Attributes.html
+/// http://gcc.gnu.org/onlinedocs/gcc/Function-Attribute.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-Attributes.html
+/// http://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Attribute.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-Attributes.html
+/// http://gcc.gnu.org/onlinedocs/gcc/Function-Attribute.html
static void handleFormatAttr(Sema &S, Decl *D, const AttributeList &Attr) {
if (!Attr.getParameterName()) {
if (ExplicitParams)
CheckCXXDefaultArguments(Method);
- // Attributes on the lambda apply to the method.
+ // Attribute 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 Attributes = ODS.getPropertyAttributes();
+ unsigned Attribute = ODS.getPropertyAttributes();
TypeSourceInfo *TSI = GetTypeForDeclarator(FD.D, S);
QualType T = TSI->getType();
- Attributes |= deduceWeakPropertyFromType(*this, T);
+ Attribute |= deduceWeakPropertyFromType(*this, T);
- bool isReadWrite = ((Attributes & ObjCDeclSpec::DQ_PR_readwrite) ||
+ bool isReadWrite = ((Attribute & ObjCDeclSpec::DQ_PR_readwrite) ||
// default is readwrite!
- !(Attributes & ObjCDeclSpec::DQ_PR_readonly));
+ !(Attribute & ObjCDeclSpec::DQ_PR_readonly));
// property is defaulted to 'assign' if it is readwrite and is
// not retain or copy
- bool isAssign = ((Attributes & ObjCDeclSpec::DQ_PR_assign) ||
+ bool isAssign = ((Attribute & ObjCDeclSpec::DQ_PR_assign) ||
(isReadWrite &&
- !(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)));
+ !(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)));
// Proceed with constructing the ObjCPropertDecls.
ObjCContainerDecl *ClassDecl = cast<ObjCContainerDecl>(CurContext);
Decl *Res = HandlePropertyInClassExtension(S, AtLoc, LParenLoc,
FD, GetterSel, SetterSel,
isAssign, isReadWrite,
- Attributes,
+ Attribute,
ODS.getPropertyAttributes(),
isOverridingProperty, TSI,
MethodImplKind);
if (Res) {
- CheckObjCPropertyAttributes(Res, AtLoc, Attributes, false);
+ CheckObjCPropertyAttributes(Res, AtLoc, Attribute, false);
if (getLangOpts().ObjCAutoRefCount)
checkARCPropertyDecl(*this, cast<ObjCPropertyDecl>(Res));
}
ObjCPropertyDecl *Res = CreatePropertyDecl(S, ClassDecl, AtLoc, LParenLoc, FD,
GetterSel, SetterSel,
isAssign, isReadWrite,
- Attributes,
+ Attribute,
ODS.getPropertyAttributes(),
TSI, MethodImplKind);
if (lexicalDC)
Res->setLexicalDeclContext(lexicalDC);
// Validate the attributes on the @property.
- CheckObjCPropertyAttributes(Res, AtLoc, Attributes,
+ CheckObjCPropertyAttributes(Res, AtLoc, Attribute,
(isa<ObjCInterfaceDecl>(ClassDecl) ||
isa<ObjCProtocolDecl>(ClassDecl)));
}
static ObjCPropertyDecl::PropertyAttributeKind
-makePropertyAttributesAsWritten(unsigned Attributes) {
+makePropertyAttributesAsWritten(unsigned Attribute) {
unsigned attributesAsWritten = 0;
- if (Attributes & ObjCDeclSpec::DQ_PR_readonly)
+ if (Attribute & ObjCDeclSpec::DQ_PR_readonly)
attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_readonly;
- if (Attributes & ObjCDeclSpec::DQ_PR_readwrite)
+ if (Attribute & ObjCDeclSpec::DQ_PR_readwrite)
attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_readwrite;
- if (Attributes & ObjCDeclSpec::DQ_PR_getter)
+ if (Attribute & ObjCDeclSpec::DQ_PR_getter)
attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_getter;
- if (Attributes & ObjCDeclSpec::DQ_PR_setter)
+ if (Attribute & ObjCDeclSpec::DQ_PR_setter)
attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_setter;
- if (Attributes & ObjCDeclSpec::DQ_PR_assign)
+ if (Attribute & ObjCDeclSpec::DQ_PR_assign)
attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_assign;
- if (Attributes & ObjCDeclSpec::DQ_PR_retain)
+ if (Attribute & ObjCDeclSpec::DQ_PR_retain)
attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_retain;
- if (Attributes & ObjCDeclSpec::DQ_PR_strong)
+ if (Attribute & ObjCDeclSpec::DQ_PR_strong)
attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_strong;
- if (Attributes & ObjCDeclSpec::DQ_PR_weak)
+ if (Attribute & ObjCDeclSpec::DQ_PR_weak)
attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_weak;
- if (Attributes & ObjCDeclSpec::DQ_PR_copy)
+ if (Attribute & ObjCDeclSpec::DQ_PR_copy)
attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_copy;
- if (Attributes & ObjCDeclSpec::DQ_PR_unsafe_unretained)
+ if (Attribute & ObjCDeclSpec::DQ_PR_unsafe_unretained)
attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_unsafe_unretained;
- if (Attributes & ObjCDeclSpec::DQ_PR_nonatomic)
+ if (Attribute & ObjCDeclSpec::DQ_PR_nonatomic)
attributesAsWritten |= ObjCPropertyDecl::OBJC_PR_nonatomic;
- if (Attributes & ObjCDeclSpec::DQ_PR_atomic)
+ if (Attribute & 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 Attributes,
+ const unsigned Attribute,
const unsigned AttributesAsWritten,
bool *isOverridingProperty,
TypeSourceInfo *T,
PropertyId, AtLoc, LParenLoc, T);
PDecl->setPropertyAttributesAsWritten(
makePropertyAttributesAsWritten(AttributesAsWritten));
- if (Attributes & ObjCDeclSpec::DQ_PR_readonly)
+ if (Attribute & ObjCDeclSpec::DQ_PR_readonly)
PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_readonly);
- if (Attributes & ObjCDeclSpec::DQ_PR_readwrite)
+ if (Attribute & 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,
- Attributes,AttributesAsWritten, T, MethodImplKind, DC);
+ Attribute,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(Attributes);
+ unsigned ClassExtensionMemoryModel = getOwnershipRule(Attribute);
unsigned PrimaryClassMemoryModel = getOwnershipRule(PIkind);
if (PrimaryClassMemoryModel && ClassExtensionMemoryModel &&
(PrimaryClassMemoryModel != ClassExtensionMemoryModel)) {
PIDecl = cast<ObjCPropertyDecl>(ProtocolPtrTy);
}
PIDecl->makeitReadWriteAttribute();
- if (Attributes & ObjCDeclSpec::DQ_PR_retain)
+ if (Attribute & ObjCDeclSpec::DQ_PR_retain)
PIDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_retain);
- if (Attributes & ObjCDeclSpec::DQ_PR_strong)
+ if (Attribute & ObjCDeclSpec::DQ_PR_strong)
PIDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_strong);
- if (Attributes & ObjCDeclSpec::DQ_PR_copy)
+ if (Attribute & 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 =
- (Attributes & ObjCDeclSpec::DQ_PR_readwrite) &&
+ (Attribute & 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 Attributes,
+ const unsigned Attribute,
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 && !(Attributes & ObjCDeclSpec::DQ_PR_assign))
+ isAssign && !(Attribute & ObjCDeclSpec::DQ_PR_assign))
if (const ObjCObjectPointerType *ObjPtrTy =
T->getAs<ObjCObjectPointerType>()) {
ObjCInterfaceDecl *IDecl = ObjPtrTy->getObjectType()->getInterface();
PDecl->setPropertyAttributesAsWritten(
makePropertyAttributesAsWritten(AttributesAsWritten));
- if (Attributes & ObjCDeclSpec::DQ_PR_readonly)
+ if (Attribute & ObjCDeclSpec::DQ_PR_readonly)
PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_readonly);
- if (Attributes & ObjCDeclSpec::DQ_PR_getter)
+ if (Attribute & ObjCDeclSpec::DQ_PR_getter)
PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_getter);
- if (Attributes & ObjCDeclSpec::DQ_PR_setter)
+ if (Attribute & ObjCDeclSpec::DQ_PR_setter)
PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_setter);
if (isReadWrite)
PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_readwrite);
- if (Attributes & ObjCDeclSpec::DQ_PR_retain)
+ if (Attribute & ObjCDeclSpec::DQ_PR_retain)
PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_retain);
- if (Attributes & ObjCDeclSpec::DQ_PR_strong)
+ if (Attribute & ObjCDeclSpec::DQ_PR_strong)
PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_strong);
- if (Attributes & ObjCDeclSpec::DQ_PR_weak)
+ if (Attribute & ObjCDeclSpec::DQ_PR_weak)
PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_weak);
- if (Attributes & ObjCDeclSpec::DQ_PR_copy)
+ if (Attribute & ObjCDeclSpec::DQ_PR_copy)
PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_copy);
- if (Attributes & ObjCDeclSpec::DQ_PR_unsafe_unretained)
+ if (Attribute & 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 (Attributes & ObjCDeclSpec::DQ_PR_nonatomic)
+ if (Attribute & ObjCDeclSpec::DQ_PR_nonatomic)
PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_nonatomic);
else
PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_atomic);
// 'unsafe_unretained' is alias for 'assign'.
- if (Attributes & ObjCDeclSpec::DQ_PR_unsafe_unretained)
+ if (Attribute & 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 Attributes = property->getPropertyAttributesAsWritten();
- bool warn = (Attributes & ObjCDeclSpec::DQ_PR_readonly);
+ unsigned Attribute = property->getPropertyAttributesAsWritten();
+ bool warn = (Attribute & 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 (Attributes & ObjCDeclSpec::DQ_PR_readonly) {
+ if (Attribute & ObjCDeclSpec::DQ_PR_readonly) {
if (!classExtPropertyAttr ||
(classExtPropertyAttr &
(ObjCDeclSpec::DQ_PR_readwrite|
ObjCDeclSpec::DQ_PR_copy |
ObjCDeclSpec::DQ_PR_retain |
ObjCDeclSpec::DQ_PR_strong);
- if (Attributes & setterAttrs) {
+ if (Attribute & setterAttrs) {
const char * which =
- (Attributes & ObjCDeclSpec::DQ_PR_assign) ?
+ (Attribute & ObjCDeclSpec::DQ_PR_assign) ?
"assign" :
- (Attributes & ObjCDeclSpec::DQ_PR_unsafe_unretained) ?
+ (Attribute & ObjCDeclSpec::DQ_PR_unsafe_unretained) ?
"unsafe_unretained" :
- (Attributes & ObjCDeclSpec::DQ_PR_copy) ?
+ (Attribute & ObjCDeclSpec::DQ_PR_copy) ?
"copy" :
- (Attributes & ObjCDeclSpec::DQ_PR_retain) ?
+ (Attribute & ObjCDeclSpec::DQ_PR_retain) ?
"retain" : "strong";
S.Diag(property->getLocation(),
ObjCMethodDecl *SetterMethod = 0;
bool LookedUpGetterSetter = false;
- unsigned Attributes = Property->getPropertyAttributes();
+ unsigned Attribute = Property->getPropertyAttributes();
unsigned AttributesAsWritten = Property->getPropertyAttributesAsWritten();
if (!(AttributesAsWritten & ObjCPropertyDecl::OBJC_PR_atomic) &&
}
// We only care about readwrite atomic property.
- if ((Attributes & ObjCPropertyDecl::OBJC_PR_nonatomic) ||
- !(Attributes & ObjCPropertyDecl::OBJC_PR_readwrite))
+ if ((Attribute & ObjCPropertyDecl::OBJC_PR_nonatomic) ||
+ !(Attribute & ObjCPropertyDecl::OBJC_PR_readwrite))
continue;
if (const ObjCPropertyImplDecl *PIDecl
= IMPDecl->FindPropertyImplDecl(Property->getIdentifier())) {
void Sema::CheckObjCPropertyAttributes(Decl *PDecl,
SourceLocation Loc,
- unsigned &Attributes,
+ unsigned &Attribute,
bool propertyInPrimaryClass) {
// FIXME: Improve the reported location.
if (!PDecl || PDecl->isInvalidDecl())
QualType PropertyTy = PropertyDecl->getType();
if (getLangOpts().ObjCAutoRefCount &&
- (Attributes & ObjCDeclSpec::DQ_PR_readonly) &&
+ (Attribute & 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 ((Attributes & rel) == 0)
+ if ((Attribute & 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 ((Attributes & ObjCDeclSpec::DQ_PR_readonly) &&
- (Attributes & ObjCDeclSpec::DQ_PR_readwrite))
+ if ((Attribute & ObjCDeclSpec::DQ_PR_readonly) &&
+ (Attribute & ObjCDeclSpec::DQ_PR_readwrite))
Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
<< "readonly" << "readwrite";
}
// readonly and readwrite/assign/retain/copy conflict.
- else if ((Attributes & ObjCDeclSpec::DQ_PR_readonly) &&
- (Attributes & (ObjCDeclSpec::DQ_PR_readwrite |
+ else if ((Attribute & ObjCDeclSpec::DQ_PR_readonly) &&
+ (Attribute & (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 = (Attributes & ObjCDeclSpec::DQ_PR_readwrite) ?
+ const char * which = (Attribute & ObjCDeclSpec::DQ_PR_readwrite) ?
"readwrite" :
- (Attributes & ObjCDeclSpec::DQ_PR_assign) ?
+ (Attribute & ObjCDeclSpec::DQ_PR_assign) ?
"assign" :
- (Attributes & ObjCDeclSpec::DQ_PR_unsafe_unretained) ?
+ (Attribute & ObjCDeclSpec::DQ_PR_unsafe_unretained) ?
"unsafe_unretained" :
- (Attributes & ObjCDeclSpec::DQ_PR_copy) ?
+ (Attribute & ObjCDeclSpec::DQ_PR_copy) ?
"copy" : "retain";
- Diag(Loc, (Attributes & (ObjCDeclSpec::DQ_PR_readwrite)) ?
+ Diag(Loc, (Attribute & (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 ((Attributes & (ObjCDeclSpec::DQ_PR_weak | ObjCDeclSpec::DQ_PR_copy |
+ if ((Attribute & (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)
- << (Attributes & ObjCDeclSpec::DQ_PR_weak ? "weak" :
- Attributes & ObjCDeclSpec::DQ_PR_copy ? "copy" : "retain (or strong)");
- Attributes &= ~(ObjCDeclSpec::DQ_PR_weak | ObjCDeclSpec::DQ_PR_copy |
+ << (Attribute & ObjCDeclSpec::DQ_PR_weak ? "weak" :
+ Attribute & ObjCDeclSpec::DQ_PR_copy ? "copy" : "retain (or strong)");
+ Attribute &= ~(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 (Attributes & ObjCDeclSpec::DQ_PR_assign) {
- if (Attributes & ObjCDeclSpec::DQ_PR_copy) {
+ if (Attribute & ObjCDeclSpec::DQ_PR_assign) {
+ if (Attribute & ObjCDeclSpec::DQ_PR_copy) {
Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
<< "assign" << "copy";
- Attributes &= ~ObjCDeclSpec::DQ_PR_copy;
+ Attribute &= ~ObjCDeclSpec::DQ_PR_copy;
}
- if (Attributes & ObjCDeclSpec::DQ_PR_retain) {
+ if (Attribute & ObjCDeclSpec::DQ_PR_retain) {
Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
<< "assign" << "retain";
- Attributes &= ~ObjCDeclSpec::DQ_PR_retain;
+ Attribute &= ~ObjCDeclSpec::DQ_PR_retain;
}
- if (Attributes & ObjCDeclSpec::DQ_PR_strong) {
+ if (Attribute & ObjCDeclSpec::DQ_PR_strong) {
Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
<< "assign" << "strong";
- Attributes &= ~ObjCDeclSpec::DQ_PR_strong;
+ Attribute &= ~ObjCDeclSpec::DQ_PR_strong;
}
if (getLangOpts().ObjCAutoRefCount &&
- (Attributes & ObjCDeclSpec::DQ_PR_weak)) {
+ (Attribute & ObjCDeclSpec::DQ_PR_weak)) {
Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
<< "assign" << "weak";
- Attributes &= ~ObjCDeclSpec::DQ_PR_weak;
+ Attribute &= ~ObjCDeclSpec::DQ_PR_weak;
}
- } else if (Attributes & ObjCDeclSpec::DQ_PR_unsafe_unretained) {
- if (Attributes & ObjCDeclSpec::DQ_PR_copy) {
+ } else if (Attribute & ObjCDeclSpec::DQ_PR_unsafe_unretained) {
+ if (Attribute & ObjCDeclSpec::DQ_PR_copy) {
Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
<< "unsafe_unretained" << "copy";
- Attributes &= ~ObjCDeclSpec::DQ_PR_copy;
+ Attribute &= ~ObjCDeclSpec::DQ_PR_copy;
}
- if (Attributes & ObjCDeclSpec::DQ_PR_retain) {
+ if (Attribute & ObjCDeclSpec::DQ_PR_retain) {
Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
<< "unsafe_unretained" << "retain";
- Attributes &= ~ObjCDeclSpec::DQ_PR_retain;
+ Attribute &= ~ObjCDeclSpec::DQ_PR_retain;
}
- if (Attributes & ObjCDeclSpec::DQ_PR_strong) {
+ if (Attribute & ObjCDeclSpec::DQ_PR_strong) {
Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
<< "unsafe_unretained" << "strong";
- Attributes &= ~ObjCDeclSpec::DQ_PR_strong;
+ Attribute &= ~ObjCDeclSpec::DQ_PR_strong;
}
if (getLangOpts().ObjCAutoRefCount &&
- (Attributes & ObjCDeclSpec::DQ_PR_weak)) {
+ (Attribute & ObjCDeclSpec::DQ_PR_weak)) {
Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
<< "unsafe_unretained" << "weak";
- Attributes &= ~ObjCDeclSpec::DQ_PR_weak;
+ Attribute &= ~ObjCDeclSpec::DQ_PR_weak;
}
- } else if (Attributes & ObjCDeclSpec::DQ_PR_copy) {
- if (Attributes & ObjCDeclSpec::DQ_PR_retain) {
+ } else if (Attribute & ObjCDeclSpec::DQ_PR_copy) {
+ if (Attribute & ObjCDeclSpec::DQ_PR_retain) {
Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
<< "copy" << "retain";
- Attributes &= ~ObjCDeclSpec::DQ_PR_retain;
+ Attribute &= ~ObjCDeclSpec::DQ_PR_retain;
}
- if (Attributes & ObjCDeclSpec::DQ_PR_strong) {
+ if (Attribute & ObjCDeclSpec::DQ_PR_strong) {
Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
<< "copy" << "strong";
- Attributes &= ~ObjCDeclSpec::DQ_PR_strong;
+ Attribute &= ~ObjCDeclSpec::DQ_PR_strong;
}
- if (Attributes & ObjCDeclSpec::DQ_PR_weak) {
+ if (Attribute & ObjCDeclSpec::DQ_PR_weak) {
Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
<< "copy" << "weak";
- Attributes &= ~ObjCDeclSpec::DQ_PR_weak;
+ Attribute &= ~ObjCDeclSpec::DQ_PR_weak;
}
}
- else if ((Attributes & ObjCDeclSpec::DQ_PR_retain) &&
- (Attributes & ObjCDeclSpec::DQ_PR_weak)) {
+ else if ((Attribute & ObjCDeclSpec::DQ_PR_retain) &&
+ (Attribute & ObjCDeclSpec::DQ_PR_weak)) {
Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
<< "retain" << "weak";
- Attributes &= ~ObjCDeclSpec::DQ_PR_retain;
+ Attribute &= ~ObjCDeclSpec::DQ_PR_retain;
}
- else if ((Attributes & ObjCDeclSpec::DQ_PR_strong) &&
- (Attributes & ObjCDeclSpec::DQ_PR_weak)) {
+ else if ((Attribute & ObjCDeclSpec::DQ_PR_strong) &&
+ (Attribute & ObjCDeclSpec::DQ_PR_weak)) {
Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
<< "strong" << "weak";
- Attributes &= ~ObjCDeclSpec::DQ_PR_weak;
+ Attribute &= ~ObjCDeclSpec::DQ_PR_weak;
}
- if ((Attributes & ObjCDeclSpec::DQ_PR_atomic) &&
- (Attributes & ObjCDeclSpec::DQ_PR_nonatomic)) {
+ if ((Attribute & ObjCDeclSpec::DQ_PR_atomic) &&
+ (Attribute & ObjCDeclSpec::DQ_PR_nonatomic)) {
Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
<< "atomic" << "nonatomic";
- Attributes &= ~ObjCDeclSpec::DQ_PR_atomic;
+ Attribute &= ~ObjCDeclSpec::DQ_PR_atomic;
}
// Warn if user supplied no assignment attribute, property is
// readwrite, and this is an object type.
- if (!(Attributes & (ObjCDeclSpec::DQ_PR_assign | ObjCDeclSpec::DQ_PR_copy |
+ if (!(Attribute & (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 (!(Attributes & ObjCDeclSpec::DQ_PR_readonly)) {
+ else if (!(Attribute & ObjCDeclSpec::DQ_PR_readonly)) {
bool isAnyClassTy =
(PropertyTy->isObjCClassType() ||
PropertyTy->isObjCQualifiedClassType());
// (please trim this list while you are at it).
}
- if (!(Attributes & ObjCDeclSpec::DQ_PR_copy)
- &&!(Attributes & ObjCDeclSpec::DQ_PR_readonly)
+ if (!(Attribute & ObjCDeclSpec::DQ_PR_copy)
+ &&!(Attribute & ObjCDeclSpec::DQ_PR_readonly)
&& getLangOpts().getGC() == LangOptions::GCOnly
&& PropertyTy->isBlockPointerType())
Diag(Loc, diag::warn_objc_property_copy_missing_on_block);
- else if ((Attributes & ObjCDeclSpec::DQ_PR_retain) &&
- !(Attributes & ObjCDeclSpec::DQ_PR_readonly) &&
- !(Attributes & ObjCDeclSpec::DQ_PR_strong) &&
+ else if ((Attribute & ObjCDeclSpec::DQ_PR_retain) &&
+ !(Attribute & ObjCDeclSpec::DQ_PR_readonly) &&
+ !(Attribute & ObjCDeclSpec::DQ_PR_strong) &&
PropertyTy->isBlockPointerType())
Diag(Loc, diag::warn_objc_property_retain_of_block);
- if ((Attributes & ObjCDeclSpec::DQ_PR_readonly) &&
- (Attributes & ObjCDeclSpec::DQ_PR_setter))
+ if ((Attribute & ObjCDeclSpec::DQ_PR_readonly) &&
+ (Attribute & ObjCDeclSpec::DQ_PR_setter))
Diag(Loc, diag::warn_objc_readonly_property_has_setter);
}
-//===--- TargetAttributesSema.h - Semantic Analysis For Target Attributes -===//
+//===--- TargetAttributesSema.h - Semantic Analysis For Target Attribute -===//
//
// The LLVM Compiler Infrastructure
//
if (FTL && VisitFunctionTypeLoc(*FTL, true))
return true;
- // FIXME: Attributes?
+ // FIXME: Attribute?
}
if (ND->doesThisDeclarationHaveABody() && !ND->isLateTemplateParsed()) {