llvm / clangir

A new (MLIR based) high-level IR for clang.
https://clangir.org
Other
308 stars 84 forks source link

[CIR][CodeGen][Bugfix] fixes volatile structs copy #623

Closed gitoleg closed 1 month ago

gitoleg commented 1 month ago

This PR fixes a fail on llvm_unreachable for the next case:

volatile A vol_a;
A foo7() {
  return vol_a;
}

Basically, it's just a copy-pasta from the original code-gen. Also, I added the isVolatile attribute for the cit.copy operation