aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2012-12-20 19:22:21 +0000
committerBill Wendling <isanbard@gmail.com>2012-12-20 19:22:21 +0000
commitad017fa7a4df7389d245d02a49b3c79ed70bedb9 (patch)
treebcbd290037266bae92bfb10705c40e830ea71a07
parenta367a0236211dd2c81a363c4b47b40e0ac6a8797 (diff)
Revert r170500. It over-zealously converted *ALL* things named Attributes, which is wrong here.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170721 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang-c/Index.h2
-rw-r--r--include/clang/Basic/Builtins.h20
-rw-r--r--include/clang/Parse/Parser.h2
-rw-r--r--include/clang/Sema/DeclSpec.h2
-rw-r--r--include/clang/Sema/Sema.h8
-rw-r--r--lib/AST/StmtPrinter.cpp2
-rw-r--r--lib/Basic/Builtins.cpp12
-rw-r--r--lib/CodeGen/CGCall.cpp80
-rw-r--r--lib/CodeGen/CGClass.cpp2
-rw-r--r--lib/CodeGen/CGDeclCXX.cpp2
-rw-r--r--lib/CodeGen/CGExpr.cpp8
-rw-r--r--lib/CodeGen/CGObjC.cpp2
-rw-r--r--lib/CodeGen/CGObjCMac.cpp8
-rw-r--r--lib/CodeGen/CGStmt.cpp4
-rw-r--r--lib/CodeGen/CodeGenFunction.cpp2
-rw-r--r--lib/CodeGen/CodeGenModule.cpp32
-rw-r--r--lib/CodeGen/CodeGenModule.h8
-rw-r--r--lib/CodeGen/ItaniumCXXABI.cpp12
-rw-r--r--lib/CodeGen/TargetInfo.cpp10
-rw-r--r--lib/Lex/ModuleMap.cpp12
-rw-r--r--lib/Parse/ParseDecl.cpp16
-rw-r--r--lib/Parse/ParseDeclCXX.cpp8
-rw-r--r--lib/Parse/ParseExprCXX.cpp2
-rw-r--r--lib/Rewrite/Frontend/RewriteModernObjC.cpp12
-rw-r--r--lib/Rewrite/Frontend/RewriteObjC.cpp12
-rw-r--r--lib/Sema/SemaAttr.cpp2
-rw-r--r--lib/Sema/SemaChecking.cpp6
-rw-r--r--lib/Sema/SemaCodeComplete.cpp38
-rw-r--r--lib/Sema/SemaDecl.cpp2
-rw-r--r--lib/Sema/SemaDeclAttr.cpp6
-rw-r--r--lib/Sema/SemaLambda.cpp2
-rw-r--r--lib/Sema/SemaObjCProperty.cpp236
-rw-r--r--lib/Sema/TargetAttributesSema.h2
-rw-r--r--tools/libclang/CIndex.cpp2
34 files changed, 288 insertions, 288 deletions
diff --git a/include/clang-c/Index.h b/include/clang-c/Index.h
index 272badfd09..ea84de6d79 100644
--- a/include/clang-c/Index.h
+++ b/include/clang-c/Index.h
@@ -2016,7 +2016,7 @@ enum CXCursorKind {
*/
CXCursor_TranslationUnit = 300,
- /* Attribute */
+ /* Attributes */
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 ac75be7819..257daf10ec 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, *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); }
};
@@ -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).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,
@@ -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).Attribute, 'e') != 0;
+ return strchr(GetRecord(ID).Attributes, 'e') != 0;
}
private:
diff --git a/include/clang/Parse/Parser.h b/include/clang/Parse/Parser.h
index 8340bd2fc9..66c1d35cbf 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 &Attribute);
+ ParsedAttributesWithRange &Attributes);
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 912071f3ef..bc8fc64699 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 - Attribute.
+ /// Attrs - Attributes.
ParsedAttributes Attrs;
/// \brief The asm label, if specified.
diff --git a/include/clang/Sema/Sema.h b/include/clang/Sema/Sema.h
index 290f326d95..ab66c9dbb8 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 Attribute,
+ const unsigned Attributes,
const unsigned AttributesAsWritten,
bool *isOverridingProperty,
TypeSourceInfo *T,
@@ -2397,7 +2397,7 @@ public:
Selector SetterSel,
const bool isAssign,
const bool isReadWrite,
- const unsigned Attribute,
+ const unsigned Attributes,
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] 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
diff --git a/lib/AST/StmtPrinter.cpp b/lib/AST/StmtPrinter.cpp
index f021c71dca..fb9c70c690 100644
--- a/lib/AST/StmtPrinter.cpp
+++ b/lib/AST/StmtPrinter.cpp
@@ -1399,7 +1399,7 @@ void StmtPrinter::VisitLambdaExpr(LambdaExpr *Node) {
OS << ExceptionSpec;
}
- // FIXME: Attribute
+ // FIXME: Attributes
// 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 0341a2d1b5..242c204d6d 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].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);
@@ -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].Attribute, 'f'))
+ if (!LangOpts.NoBuiltin || !strchr(TSRecords[i].Attributes, '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].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);
}
@@ -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).Attribute, "pP");
+ const char *Printf = strpbrk(GetRecord(ID).Attributes, "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).Attribute, "sS");
+ const char *Scanf = strpbrk(GetRecord(ID).Attributes, "sS");
if (!Scanf)
return false;
diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp
index 31cff910a2..77498cb8fb 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::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;
@@ -1018,9 +1018,9 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI,
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:
@@ -1028,18 +1028,18 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI,
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;
}
@@ -1050,7 +1050,7 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI,
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(),
@@ -1062,9 +1062,9 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI,
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.
@@ -1077,13 +1077,13 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI,
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...
@@ -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::Attribute::get(getLLVMContext(),
+ llvm::Attributes::get(getLLVMContext(),
Attrs)));
Index += Extra;
}
@@ -1101,16 +1101,16 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI,
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:
@@ -1130,14 +1130,14 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI,
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)));
}
@@ -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::Attribute::get(getLLVMContext(),
- llvm::Attribute::NoAlias));
+ AI->addAttr(llvm::Attributes::get(getLLVMContext(),
+ llvm::Attributes::NoAlias));
++AI;
}
@@ -1258,8 +1258,8 @@ void CodeGenFunction::EmitFunctionProlog(const CGFunctionInfo &FI,
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())
@@ -2234,7 +2234,7 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo,
AttributeList);
llvm::BasicBlock *InvokeDest = 0;
- if (!Attrs.getFnAttributes().hasAttribute(llvm::Attribute::NoUnwind))
+ if (!Attrs.getFnAttributes().hasAttribute(llvm::Attributes::NoUnwind))
InvokeDest = getInvokeDest();
llvm::CallSite CS;
diff --git a/lib/CodeGen/CGClass.cpp b/lib/CodeGen/CGClass.cpp
index 4e0fe9a58b..5d93a8bfef 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::Attribute::AlwaysInline);
+ CurFn->addFnAttr(llvm::Attributes::AlwaysInline);
break;
}
diff --git a/lib/CodeGen/CGDeclCXX.cpp b/lib/CodeGen/CGDeclCXX.cpp
index c7535cba6e..ed46178d31 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::Attribute::AddressSafety);
+ Fn->addFnAttr(llvm::Attributes::AddressSafety);
return Fn;
}
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp
index daab163d27..8440eded83 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::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) &&
@@ -2032,7 +2032,7 @@ void CodeGenFunction::EmitCheck(llvm::Value *Checked, StringRef CheckName,
(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);
diff --git a/lib/CodeGen/CGObjC.cpp b/lib/CodeGen/CGObjC.cpp
index c003f9f3db..b06bdc7ff4 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::Attribute::NonLazyBind);
+ f->addFnAttr(llvm::Attributes::NonLazyBind);
}
return fn;
diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp
index e886e8fe3b..aff804cd4b 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::Attribute::get(CGM.getLLVMContext(),
- llvm::Attribute::NonLazyBind));
+ llvm::Attributes::get(CGM.getLLVMContext(),
+ llvm::Attributes::NonLazyBind));
}
/// void objc_msgSend_stret (id, SEL, ...)
@@ -582,8 +582,8 @@ public:
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:
diff --git a/lib/CodeGen/CGStmt.cpp b/lib/CodeGen/CGStmt.cpp
index 30bd115cb7..eafa550765 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::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.
diff --git a/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp
index 9c616cc6ad..b35c7983b2 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::Attribute::InlineHint);
+ Fn->addFnAttr(llvm::Attributes::InlineHint);
break;
}
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp
index 2e7a61ab29..d8da042d5c 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::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);
@@ -594,15 +594,15 @@ void CodeGenModule::SetLLVMFunctionAttributesForDefinition(const Decl *D,
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(l