ApsarasX/llvm-bindings

[Feature] There seems to be no bindings for "ConstantArray"

wavpro opened this issue · 6 comments

Which LLVM APIs do you want llvm-bindings to provide
There seems to be no bindings for "ConstantArray", which is quite an important datatype since it's needed for most string implementations. Could it be added to the bindings or is there some issue preventing that?

OK, I will add class ConstantArray as soon as possible.

Thank you so much!

How are you going to use class ConstantArray?

I have added class ConstantArray in 3b609cb, but haven't pushed new version to npm yet.

In the commit, I just added two methods for class ConstantArray, which are:

public static get(type: ArrayType, values: Constant[]): Constant;

public getType(): ArrayType;

Do you need to use other methods of class ConstantArray?

I have released v0.3.8 into npm.

For details, please see https://github.com/ApsarasX/llvm-bindings/releases/tag/v0.3.8

@wavpro Do you still have questions about this issue?

@ApsarasX I think there might be a bug in

if (info.Length() < 2 || !StructType::IsClassOf(info[0]) || !info[1].IsArray()) {

Shouldn't it be ArrayType::IsClassOf? See #19.