[LLVM-C] Fix ByVal Attribute crashing
commit55fd6ec301489bbcdc1c9a9a3ea68d125db0fda8
authorHans Wennborg <hans@hanshq.net>
Wed, 28 Aug 2019 09:21:56 +0000 (28 09:21 +0000)
committerHans Wennborg <hans@hanshq.net>
Wed, 28 Aug 2019 09:21:56 +0000 (28 09:21 +0000)
tree4a375e9ad8764aa19104dec98119200835093995
parentcbb4ef7bbfc6beb76cf8bf14aa9c9827d661e786
[LLVM-C] Fix ByVal Attribute crashing

With the introduction of the typed byval attribute change there was no
way that the LLVM-C API could create the correct class Attribute. If a
program that uses the C API creates a ByVal attribute and annotates a
function with that attribute LLVM will crash when it assembles or write
that module containing the function out as bitcode.

This change is a minimal fix to at least allow code to work, this is
because the byval change is on the 9.0 and I don't want to introduce new
LLVM-C API this late in the release cycle.

By Jakob Bornecrantz!

Differential revision: https://reviews.llvm.org/D66144

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370176 91177308-0d34-0410-b5e6-96231b3b80d8
lib/IR/Core.cpp