[llvm] 8e5b155 - [IR] Inline AttrBuilder::addAttribute. It just sets 1 bit. NFC.
Benjamin Kramer via llvm-commits
llvm-commits at lists.llvm.org
Sat Aug 29 10:13:58 PDT 2020
Author: Benjamin Kramer
Date: 2020-08-29T19:13:49+02:00
New Revision: 8e5b1557e5b32ec59336b0c80f1e35bf5d626ba6
URL: https://github.com/llvm/llvm-project/commit/8e5b1557e5b32ec59336b0c80f1e35bf5d626ba6
DIFF: https://github.com/llvm/llvm-project/commit/8e5b1557e5b32ec59336b0c80f1e35bf5d626ba6.diff
LOG: [IR] Inline AttrBuilder::addAttribute. It just sets 1 bit. NFC.
Added:
Modified:
llvm/include/llvm/IR/Attributes.h
llvm/lib/IR/Attributes.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/IR/Attributes.h b/llvm/include/llvm/IR/Attributes.h
index 6b1d6fa749fe..74293fdfe8d8 100644
--- a/llvm/include/llvm/IR/Attributes.h
+++ b/llvm/include/llvm/IR/Attributes.h
@@ -753,7 +753,14 @@ class AttrBuilder {
void clear();
/// Add an attribute to the builder.
- AttrBuilder &addAttribute(Attribute::AttrKind Val);
+ AttrBuilder &addAttribute(Attribute::AttrKind Val) {
+ assert((unsigned)Val < Attribute::EndAttrKinds &&
+ "Attribute out of range!");
+ assert(!Attribute::doesAttrKindHaveArgument(Val) &&
+ "Adding integer attribute without adding a value!");
+ Attrs[Val] = true;
+ return *this;
+ }
/// Add the Attribute object to the builder.
AttrBuilder &addAttribute(Attribute A);
diff --git a/llvm/lib/IR/Attributes.cpp b/llvm/lib/IR/Attributes.cpp
index 157f9a79e4ef..a3940c0fa7fb 100644
--- a/llvm/lib/IR/Attributes.cpp
+++ b/llvm/lib/IR/Attributes.cpp
@@ -1559,14 +1559,6 @@ void AttrBuilder::clear() {
PreallocatedType = nullptr;
}
-AttrBuilder &AttrBuilder::addAttribute(Attribute::AttrKind Val) {
- assert((unsigned)Val < Attribute::EndAttrKinds && "Attribute out of range!");
- assert(!Attribute::doesAttrKindHaveArgument(Val) &&
- "Adding integer attribute without adding a value!");
- Attrs[Val] = true;
- return *this;
-}
-
AttrBuilder &AttrBuilder::addAttribute(Attribute Attr) {
if (Attr.isStringAttribute()) {
addAttribute(Attr.getKindAsString(), Attr.getValueAsString());
More information about the llvm-commits
mailing list