llvm/lib/AsmParser
Reid Kleckner 7dde8e89fc 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
2017-04-10 23:31:05 +00:00
..
CMakeLists.txt modules: Add explicit dependency on intrinsics_gen 2015-06-16 00:44:12 +00:00
LLLexer.cpp [IR] Add AllowContract to FastMathFlags 2017-03-28 20:11:52 +00:00
LLLexer.h Remove empty non-virtual destructors or mark them =default when non-public 2015-04-11 15:32:26 +00:00
LLParser.cpp Reland "[IR] Make AttributeSetNode public, avoid temporary AttributeList copies" 2017-04-10 23:31:05 +00:00
LLParser.h Reland "[IR] Make AttributeSetNode public, avoid temporary AttributeList copies" 2017-04-10 23:31:05 +00:00
LLToken.h [IR] Add AllowContract to FastMathFlags 2017-03-28 20:11:52 +00:00
LLVMBuild.txt LLVMBuild: Remove trailing newline, which irked me. 2011-12-12 19:48:00 +00:00
Parser.cpp [AsmParser] Expose an API to parse a string starting with a type. 2016-03-08 00:37:07 +00:00