Make sure that the Attribute object represents one attribute only.
Several places were still treating the Attribute object as respresenting
multiple attributes. Those places now use the AttributeSet to represent
multiple attributes.
llvm-svn: 174003
diff --git a/llvm/lib/IR/Attributes.cpp b/llvm/lib/IR/Attributes.cpp
index 75ba93a..98c12b5 100644
--- a/llvm/lib/IR/Attributes.cpp
+++ b/llvm/lib/IR/Attributes.cpp
@@ -40,6 +40,9 @@
if (!B.hasAttributes())
return Attribute();
+ assert(std::distance(B.begin(), B.end()) == 1 &&
+ "The Attribute object should represent one attribute only!");
+
// Otherwise, build a key to look up the existing attributes.
LLVMContextImpl *pImpl = Context.pImpl;
FoldingSetNodeID ID;