[all-commits] [llvm/llvm-project] 1eddce: Fix non-determinism issue with implicit lambda cap...

Erich Keane via All-commits all-commits at lists.llvm.org
Fri Jun 12 09:17:11 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 1eddce4177cfddc86d4696b758904443b0b4f193
      https://github.com/llvm/llvm-project/commit/1eddce4177cfddc86d4696b758904443b0b4f193
  Author: Erich Keane <erich.keane at intel.com>
  Date:   2020-06-12 (Fri, 12 Jun 2020)

  Changed paths:
    M clang/include/clang/Sema/Sema.h
    M clang/lib/Sema/SemaExpr.cpp
    A clang/test/CodeGenCXX/lambda-deterministic-captures.cpp

  Log Message:
  -----------
  Fix non-determinism issue with implicit lambda captures.

We were using llvm::SmallPtrSet for our ODR-use set which was also used
for instantiating the implicit lambda captures. The order in which the
captures are added depends on this, so the lambda's layout ended up
changing.  The test just uses floats, but this was noticed with other
types as well.

This test replaces the short-lived SmallPtrSet (it lasts only for an
expression, which, though is a long time for lambdas, is at least not
forever) with a SmallSetVector.




More information about the All-commits mailing list