diff options
34 files changed, 288 insertions, 288 deletions
diff --git a/include/clang-c/Index.h b/include/clang-c/Index.h index ea84de6d79..272badfd09 100644 --- a/include/clang-c/Index.h +++ b/include/clang-c/Index.h @@ -2016,7 +2016,7 @@ enum CXCursorKind { */ CXCursor_TranslationUnit = 300, - /* Attributes */ + /* Attribute */ CXCursor_FirstAttr = 400, /** * \brief An attribute whose specific kind is not exposed via this diff --git a/include/clang/Basic/Builtins.h b/include/clang/Basic/Builtins.h index 257daf10ec..ac75be7819 100644 --- a/include/clang/Basic/Builtins.h +++ b/include/clang/Basic/Builtins.h @@ -46,13 +46,13 @@ enum ID { }; 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); } }; @@ -91,40 +91,40 @@ public: /// \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, @@ -152,7 +152,7 @@ public: /// /// 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: diff --git a/include/clang/Parse/Parser.h b/include/clang/Parse/Parser.h index 66c1d35cbf..8340bd2fc9 100644 --- a/include/clang/Parse/Parser.h +++ b/include/clang/Parse/Parser.h @@ -2091,7 +2091,7 @@ 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, diff --git a/include/clang/Sema/DeclSpec.h b/include/clang/Sema/DeclSpec.h index bc8fc64699..912071f3ef 100644 --- a/include/clang/Sema/DeclSpec.h +++ b/include/clang/Sema/DeclSpec.h @@ -1506,7 +1506,7 @@ private: /// \brief Is this Declarator a redeclaration? bool Redeclaration : 1; - /// Attrs - Attributes. + /// Attrs - Attribute. ParsedAttributes Attrs; /// \brief The asm label, if specified. diff --git a/include/clang/Sema/Sema.h b/include/clang/Sema/Sema.h index ab66c9dbb8..290f326d95 100644 --- a/include/clang/Sema/Sema.h +++ b/include/clang/Sema/Sema.h @@ -2380,7 +2380,7 @@ public: Selector SetterSel, const bool isAssign, const bool isReadWrite, - const unsigned Attributes, + const unsigned Attribute, const unsigned AttributesAsWritten, bool *isOverridingProperty, TypeSourceInfo *T, @@ -2397,7 +2397,7 @@ public: Selector SetterSel, const bool isAssign, const bool isReadWrite, - const unsigned Attributes, + const unsigned Attribute, const unsigned AttributesAsWritten, TypeSourceInfo *T, tok::ObjCKeywordKind MethodImplKind, @@ -6148,11 +6148,11 @@ public: 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 diff --git a/lib/AST/StmtPrinter.cpp b/lib/AST/StmtPrinter.cpp index ff9039e3f3..0c741495b9 100644 --- a/lib/AST/StmtPrinter.cpp +++ b/lib/AST/StmtPrinter.cpp @@ -1399,7 +1399,7 @@ void StmtPrinter::VisitLambdaExpr(LambdaExpr *Node) { OS << ExceptionSpec; } - // FIXME: Attributes + // FIXME: Attribute // Print the trailing return type if it was specified in the source. if (Node->hasExplicitResultType()) diff --git a/lib/Basic/Builtins.cpp b/lib/Basic/Builtins.cpp index 242c204d6d..0341a2d1b5 100644 --- a/lib/Basic/Builtins.cpp +++ b/lib/Basic/Builtins.cpp @@ -51,7 +51,7 @@ void Builtin::Context::InitializeBuiltins(IdentifierTable &Table, 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); @@ -59,7 +59,7 @@ void Builtin::Context::InitializeBuiltins(IdentifierTable &Table, // 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); } @@ -68,12 +68,12 @@ Builtin::Context::GetBuiltinNames(SmallVectorImpl<const char *> &Names, 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); } @@ -84,7 +84,7 @@ void Builtin::Context::ForgetBuiltin(unsigned ID, IdentifierTable &Table) { 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; @@ -103,7 +103,7 @@ Builtin::Context::isPrintfLike(unsigned ID, unsigned &FormatIdx, 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; diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp index 77498cb8fb..31cff910a2 100644 --- a/lib/CodeGen/CGCall.cpp +++ b/lib/CodeGen/CGCall.cpp @@ -971,46 +971,46 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI, 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; @@ -1018,9 +1018,9 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI, 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: @@ -1028,18 +1028,18 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI, 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; } @@ -1050,7 +1050,7 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI, 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(), @@ -1062,9 +1062,9 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI, 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. @@ -1077,13 +1077,13 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI, 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... @@ -1093,7 +1093,7 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI, 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; } @@ -1101,16 +1101,16 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI, 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: @@ -1130,14 +1130,14 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI, 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))); } @@ -1186,8 +1186,8 @@ void CodeGenFunction::EmitFunctionProlog(const CGFunctionInfo &FI, // 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; } @@ -1258,8 +1258,8 @@ void CodeGenFunction::EmitFunctionProlog(const CGFunctionInfo &FI, 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()) @@ -2234,7 +2234,7 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo, AttributeList); llvm::BasicBlock *InvokeDest = 0; - if (!Attrs.getFnAttributes().hasAttribute(llvm::Attributes::NoUnwind)) + if (!Attrs.getFnAttributes().hasAttribute(llvm::Attribute::NoUnwind)) InvokeDest = getInvokeDest(); llvm::CallSite CS; diff --git a/lib/CodeGen/CGClass.cpp b/lib/CodeGen/CGClass.cpp index 5d93a8bfef..4e0fe9a58b 100644 --- a/lib/CodeGen/CGClass.cpp +++ b/lib/CodeGen/CGClass.cpp @@ -946,7 +946,7 @@ void CodeGenFunction::EmitDestructorBody(FunctionArgList &Args) { // -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; } diff --git a/lib/CodeGen/CGDeclCXX.cpp b/lib/CodeGen/CGDeclCXX.cpp index ed46178d31..c7535cba6e 100644 --- a/lib/CodeGen/CGDeclCXX.cpp +++ b/lib/CodeGen/CGDeclCXX.cpp @@ -233,7 +233,7 @@ CreateGlobalInitOrDestructFunction(CodeGenModule &CGM, Fn->setDoesNotThrow(); if (CGM.getLangOpts().SanitizeAddress) - Fn->addFnAttr(llvm::Attributes::AddressSafety); + Fn->addFnAttr(llvm::Attribute::AddressSafety); return Fn; } diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index 8440eded83..daab163d27 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -2020,10 +2020,10 @@ void CodeGenFunction::EmitCheck(llvm::Value *Checked, StringRef CheckName, 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) && @@ -2032,7 +2032,7 @@ void CodeGenFunction::EmitCheck(llvm::Value *Checked, StringRef CheckName, (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); diff --git a/lib/CodeGen/CGObjC.cpp b/lib/CodeGen/CGObjC.cpp index b06bdc7ff4..c003f9f3db 100644 --- a/lib/CodeGen/CGObjC.cpp +++ b/lib/CodeGen/CGObjC.cpp @@ -1713,7 +1713,7 @@ static llvm::Constant *createARCRuntimeFunction(CodeGenModule &CGM, 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; diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp index aff804cd4b..e886e8fe3b 100644 --- a/lib/CodeGen/CGObjCMac.cpp +++ b/lib/CodeGen/CGObjCMac.cpp @@ -64,8 +64,8 @@ private: 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, ...) @@ -582,8 +582,8 @@ public: 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: diff --git a/lib/CodeGen/CGStmt.cpp b/lib/CodeGen/CGStmt.cpp index eafa550765..30bd115cb7 100644 --- a/lib/CodeGen/CGStmt.cpp +++ b/lib/CodeGen/CGStmt.cpp @@ -1641,8 +1641,8 @@ void CodeGenFunction::EmitAsmStmt(const AsmStmt &S) { /* 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. diff --git a/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp index b35c7983b2..9c616cc6ad 100644 --- a/lib/CodeGen/CodeGenFunction.cpp +++ b/lib/CodeGen/CodeGenFunction.cpp @@ -354,7 +354,7 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, QualType RetTy, 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; } diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index d8da042d5c..2e7a61ab29 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -563,28 +563,28 @@ void CodeGenModule::SetLLVMFunctionAttributesForDefinition(const Decl *D, 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); @@ -594,15 +594,15 @@ void CodeGenModule::SetLLVMFunctionAttributesForDefinition(const Decl *D, 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(); @@ -1106,7 +1106,7 @@ llvm::Constant * 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) { @@ -1214,7 +1214,7 @@ llvm::Constant *CodeGenModule::GetAddrOfFunction(GlobalDecl GD, llvm::Constant * CodeGenModule::CreateRuntimeFunction(llvm::FunctionType *FTy, StringRef Name, - llvm::Attributes ExtraAttrs) { + llvm::Attribute ExtraAttrs) { return GetOrCreateLLVMFunction(Name, FTy, GlobalDecl(), /*ForVTable=*/false, ExtraAttrs); } @@ -1823,7 +1823,7 @@ static void replaceUsesOfNonProtoConstant(llvm::Constant *old, 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)); @@ -1844,14 +1844,14 @@ static void replaceUsesOfNonProtoConstant(llvm::Constant *old, |