[all-commits] [llvm/llvm-project] 06be34: [Clang] avoid relying on StringMap iteration order...

erikdesjardins via All-commits all-commits at lists.llvm.org
Wed Feb 1 13:54:23 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 06be346311b9341d3d11120a631263de863f937c
      https://github.com/llvm/llvm-project/commit/06be346311b9341d3d11120a631263de863f937c
  Author: Erik Desjardins <erikdesjardinspublic at gmail.com>
  Date:   2023-02-01 (Wed, 01 Feb 2023)

  Changed paths:
    M clang/lib/Frontend/CompilerInvocation.cpp

  Log Message:
  -----------
  [Clang] avoid relying on StringMap iteration order when roundtripping -analyzer-config

I am working on another patch that changes StringMap's hash function,
which changes the iteration order here, and breaks some tests,
specifically:

    clang/test/Analysis/NSString.m
    clang/test/Analysis/shallow-mode.m

with errors like:

    generated arguments do not match in round-trip
    generated arguments #1 in round-trip: <...> "-analyzer-config" "ipa=inlining" "-analyzer-config" "max-nodes=75000" <...>
    generated arguments #2 in round-trip: <...> "-analyzer-config" "max-nodes=75000" "-analyzer-config" "ipa=inlining" <...>

To avoid this, sort the options by key, instead of using the default map
iteration order.

Reviewed By: jansvoboda11, MaskRay

Differential Revision: https://reviews.llvm.org/D142861




More information about the All-commits mailing list