[all-commits] [llvm/llvm-project] 2c2099: [RISCV] Detect duplicate extensions in parseNormal...

Craig Topper via All-commits all-commits at lists.llvm.org
Tue May 7 20:57:17 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2c209957819328481554e7c5929d134502b4972a
      https://github.com/llvm/llvm-project/commit/2c209957819328481554e7c5929d134502b4972a
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2024-05-07 (Tue, 07 May 2024)

  Changed paths:
    M llvm/include/llvm/TargetParser/RISCVISAInfo.h
    M llvm/lib/TargetParser/RISCVISAInfo.cpp
    M llvm/unittests/TargetParser/RISCVISAInfoTest.cpp

  Log Message:
  -----------
  [RISCV] Detect duplicate extensions in parseNormalizedArchString. (#91416)

This detects the same extension name being added twice. Mostly I'm
worried about the case that the same string appears with two different
versions. We will only preserve one of the versions.

We could allow the same version to be repeated, but that doesn't seem
useful at the moment.

I've updated addExtension to use map::emplace instead of
map::operator[]. This means we only keep the first version if there are
duplicates. Previously we kept the last version, but that shouldn't matter
now that we don't allow duplicates. parseArchString already doesn't allow
duplicates.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list