[Mlir-commits] [llvm] [flang] [mlir] [lld] [clang] [ELF] Merge exportDynamic into versionId (PR #71272)

Peter Smith llvmlistbot at llvm.org
Mon Nov 6 08:59:05 PST 2023


https://github.com/smithp35 commented:

I think it makes sense to reuse the field if we can save a flag. The potential for someone to use the versionId as an index, or otherwise misuse it in the future makes me a bit nervous.

A possible alternative is to use a different name for the versionId, say dynamicVersion and make this private. This could have a getVersionId(), setVersionId() hasVersionId() exportDynamic() and isExportDynamic(). Essentially make all uses of the previous variables into functions that use the same underlying variable dynamicVersion but don't use it directly.

Not got a strong opinion so just a suggestion.

The getVersionId() could assert hasVersionId() which could check that it wasn't the magic value.

https://github.com/llvm/llvm-project/pull/71272


More information about the Mlir-commits mailing list