llvmlite icon indicating copy to clipboard operation
llvmlite copied to clipboard

can't add global type definitions to module

Open bpmason1 opened this issue 5 years ago • 1 comments

After creating a structure type using LiteralStructType how can I add that type definition to my module.

As an example, for the C code:

typedef struct{
  int height;
  int width;
} Rect;

clang emits llvm IR

%struct.Rect = type { i32, i32 }

The %struct.Rect is later used as the type argument to getelementptr when the type is used within functions,

From the documentation there doesn't appear to be a way to append a global type definition to the llvmlite module in this way.

bpmason1 avatar Dec 17 '20 23:12 bpmason1

@bpmason1 thank you for submitting this. I have labelled it as a question that will need some triage.

esc avatar Jan 07 '21 11:01 esc