diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2019-09-02 17:48:59 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2019-09-02 17:48:59 +0000 |
commit | 1ac1019db8e01f50b831a8db925b91fd69a5f6ea (patch) | |
tree | cdefa66bea8bea1aea9be528598df875f8a40dc0 /lib/IR/Core.cpp | |
parent | 464f838b7b7a19b95ae4b33010858de341c620a5 (diff) |
Notes
Diffstat (limited to 'lib/IR/Core.cpp')
-rw-r--r-- | lib/IR/Core.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/IR/Core.cpp b/lib/IR/Core.cpp index 310935b5213a..af9ba7b3ca69 100644 --- a/lib/IR/Core.cpp +++ b/lib/IR/Core.cpp @@ -140,7 +140,16 @@ unsigned LLVMGetLastEnumAttributeKind(void) { LLVMAttributeRef LLVMCreateEnumAttribute(LLVMContextRef C, unsigned KindID, uint64_t Val) { - return wrap(Attribute::get(*unwrap(C), (Attribute::AttrKind)KindID, Val)); + auto &Ctx = *unwrap(C); + auto AttrKind = (Attribute::AttrKind)KindID; + + if (AttrKind == Attribute::AttrKind::ByVal) { + // After r362128, byval attributes need to have a type attribute. Provide a + // NULL one until a proper API is added for this. + return wrap(Attribute::getWithByValType(Ctx, NULL)); + } else { + return wrap(Attribute::get(Ctx, AttrKind, Val)); + } } unsigned LLVMGetEnumAttributeKind(LLVMAttributeRef A) { |