diff options
author | Reid Kleckner <rnk@google.com> | 2017-04-10 23:31:05 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2017-04-10 23:31:05 +0000 |
commit | 7dde8e89fc9e76729f9420314597395d1b47431b (patch) | |
tree | 0fc0be07886670cd80d4fe9429225bb8ce449d38 /lib/IR/AttributeImpl.h | |
parent | ed488fa93ddf897c033554c46d37d66258f37bbe (diff) |
Reland "[IR] Make AttributeSetNode public, avoid temporary AttributeList copies"
This re-lands r299875.
I introduced a bug in Clang code responsible for replacing K&R, no
prototype declarations with a real function definition with a prototype.
The bug was here:
// Collect any return attributes from the call.
- if (oldAttrs.hasAttributes(llvm::AttributeList::ReturnIndex))
- newAttrs.push_back(llvm::AttributeList::get(newFn->getContext(),
- oldAttrs.getRetAttributes()));
+ newAttrs.push_back(oldAttrs.getRetAttributes());
Previously getRetAttributes() carried AttributeList::ReturnIndex in its
AttributeList. Now that we return the AttributeSetNode* directly, it no
longer carries that index, and we call this overload with a single node:
AttributeList::get(LLVMContext&, ArrayRef<AttributeSetNode*>)
That aborted with an assertion on x86_32 targets. I added an explicit
triple to the test and added CHECKs to help find issues like this in the
future sooner.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299899 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/IR/AttributeImpl.h')
-rw-r--r-- | lib/IR/AttributeImpl.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/IR/AttributeImpl.h b/lib/IR/AttributeImpl.h index 01140b70bfc..77f1067c7ac 100644 --- a/lib/IR/AttributeImpl.h +++ b/lib/IR/AttributeImpl.h @@ -16,10 +16,10 @@ #ifndef LLVM_LIB_IR_ATTRIBUTEIMPL_H #define LLVM_LIB_IR_ATTRIBUTEIMPL_H -#include "AttributeSetNode.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/FoldingSet.h" #include "llvm/ADT/StringRef.h" +#include "llvm/IR/AttributeSetNode.h" #include "llvm/IR/Attributes.h" #include "llvm/Support/TrailingObjects.h" #include <algorithm> |