Closed mhasel closed 1 month ago
this problem came with the refactoring when we started to parallelize codegen into separate objects. In early versions we generated everything into one object and llvm took care of this situation by appending a number to duplicate global variables:
We probably need to pick unique llvm-names for the global constants now.
this problem came with the refactoring when we started to parallelize codegen into separate objects. In early versions we generated everything into one object and llvm took care of this situation by appending a number to duplicate global variables:
We probably need to pick unique llvm-names for the global constants now.
@ghaith and I took a look at this last week and came to the same conclusion. This might be an easy fix by mangling the global with the pou qualifier, but I have not tried it yet: https://github.com/PLC-lang/rusty/blob/2294494aaec1fef2a0b10e6e98308e6dcb7b8bc7/src/codegen/generators/variable_generator.rs#L118-L119C102
Describe the bug Given you have multiple enums with overlapping/same variants across multiple files, when you try to compile them then linking will fail with
regressed commit: 94a74fd
To Reproduce Steps to reproduce the behavior: foo.st:
bar.st:
Compiling with
plc foo.st bar.st
: