The LLVM C API is missing type attributes as is needed by attributes such as sret and byval. This patch adds three missing wrapper functions.
Details
Diff Detail
Unit Tests
Time | Test | |
---|---|---|
50 ms | x64 debian > Flang.Semantics::resolve102.f90 |
Event Timeline
As far as I know we don't have any C API unit tests, but sorely need them if you want to try adding the first
I see echo.cpp utilizing LLVMCreateEnumAttribute (but nothing using LLVMCreateStringAttribute), but I am not familiar with that code.
I submitted this change as there seemed little interest in https://bugs.llvm.org/show_bug.cgi?id=48249 from anyone else and there was a suggestion on the Discord that if I submitted a patch then maybe someone could have a look at it. The code is straightforward, but I don't know LLVM well enough to set up any tests. Both my project (C3) and the Odin Language is looking to use these functions as soon as they are included.
Just so I understand @arsenm: are API unit tests needed to approve this pull request? If so, who is planning on adding them? I mean the C API as it currently works cannot even correctly provide byval and sret according to spec.
clang-tidy: warning: invalid case style for function 'LLVMCreateTypeAttribute' [readability-identifier-naming]
not useful