Format ref-structs correctly
This commit is contained in:
parent
94d1c15897
commit
8e7facc593
@ -564,13 +564,13 @@ namespace types {
|
|||||||
fields.push_back(field.second->codegen(builder, structs));
|
fields.push_back(field.second->codegen(builder, structs));
|
||||||
}
|
}
|
||||||
|
|
||||||
auto ty = llvm::StructType::get(*builder.context, fields);
|
auto ty = llvm::StructType::create(*builder.context, fields);
|
||||||
if (this->m_name)
|
if (this->m_name)
|
||||||
ty->setName(*this->m_name);
|
ty->setName(*this->m_name);
|
||||||
return ty;
|
return ty;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
auto ty = llvm::StructType::get(*builder.context);
|
auto ty = llvm::StructType::create(*builder.context);
|
||||||
if (this->m_name)
|
if (this->m_name)
|
||||||
ty->setName(*this->m_name);
|
ty->setName(*this->m_name);
|
||||||
return ty;
|
return ty;
|
||||||
|
|||||||
@ -164,6 +164,10 @@ namespace types {
|
|||||||
std::string StructType::formatted() {
|
std::string StructType::formatted() {
|
||||||
std::stringstream out{ "" };
|
std::stringstream out{ "" };
|
||||||
out << "struct";
|
out << "struct";
|
||||||
|
if (this->m_is_ref)
|
||||||
|
out << "(ref)";
|
||||||
|
out << " ";
|
||||||
|
|
||||||
if (this->m_name) {
|
if (this->m_name) {
|
||||||
out << *this->m_name << " ";
|
out << *this->m_name << " ";
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user