arcana-lab / memoir

A case for representing data collections and objects in the LLVM IR
MIT License
11 stars 2 forks source link

What is the type of Struct::getType() ? #48

Closed peteryongzhong closed 1 year ago

peteryongzhong commented 1 year ago

Might be a somewhat stupid question about C++ namespaces. I was always assuming that memoir::Struct::getType() would be of type memoir::StructType as opposed to llvm::StructType.

Therefore, getNumFields, should be available. But in https://github.com/arcana-lab/memoir/blob/d13ca91156cc34b3b8513592dcdfe017d1b49b75/compiler/passes/object_lowering/src/ObjectLowering.cpp#L53

The compiler emits an error as it is believing it to be an LLVM type instead.

image

I apologzie if this is a little too stupid but am a little curious on if i somehow misunderstood the namespaces.

tommymcm commented 1 year ago

memoir::Struct::getType() is a memoir::StructType. Anything that is an LLVM type in the memoir compiler passes is marked explicitly as llvm::.

tommymcm commented 1 year ago

@jiujiu1123 is this issue still open? I wasn't able to reproduce it today.

tommymcm commented 1 year ago

Fixed with 8897dd29b5fb93f360c0d4e7f3ff6574eb0cce47