GPUOpen-Drivers / llvm-dialects

LLVM Dialects Library
Apache License 2.0
22 stars 22 forks source link

Error if duplicated mnemonics are found. #88

Closed tsymalla closed 8 months ago

tsymalla commented 8 months ago

We currently don't emit an error when a dialect defines two dialect operations with the same mnemonic. This change emits basic information about duplicate mnemonics.

Since this requires a O(n) loop worst-case, store the mnemonic counts per dialect in a StringMap and iterate over it during finalization of the dialect, which then also bails out.

Can possibly be extended to all kinds of duplicated symbols.