summaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/CGObjC.cpp
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2017-04-19 17:28:52 +0000
committerReid Kleckner <rnk@google.com>2017-04-19 17:28:52 +0000
commitbfb79c8fec5e58a34d73d75ec302ea3e8cae1750 (patch)
treeaf8c7f674f4318bb28c9ef28ff0be53c7f1b4ca0 /lib/CodeGen/CGObjC.cpp
parent9192aede9d38af6d44143c44c8682381aec246d4 (diff)
Prefer addAttr(Attribute::AttrKind) over the AttributeList overload
This should simplify the call sites, which typically want to tweak one attribute at a time. It should also avoid creating ephemeral AttributeLists that live forever. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300718 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGObjC.cpp')
-rw-r--r--lib/CodeGen/CGObjC.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/CodeGen/CGObjC.cpp b/lib/CodeGen/CGObjC.cpp
index 357d1ab818..76e7df861f 100644
--- a/lib/CodeGen/CGObjC.cpp
+++ b/lib/CodeGen/CGObjC.cpp
@@ -1850,12 +1850,8 @@ static llvm::Constant *createARCRuntimeFunction(CodeGenModule &CGM,
F->addFnAttr(llvm::Attribute::NonLazyBind);
}
- if (IsForwarding(Name)) {
- llvm::AttrBuilder B;
- B.addAttribute(llvm::Attribute::Returned);
-
- F->arg_begin()->addAttr(llvm::AttributeList::get(F->getContext(), 1, B));
- }
+ if (IsForwarding(Name))
+ F->arg_begin()->addAttr(llvm::Attribute::Returned);
}
return RTF;