[all-commits] [llvm/llvm-project] 3665da: Re-commit "[clang][Interp] Unify visiting variable...

Timm Bäder via All-commits all-commits at lists.llvm.org
Sat Jan 21 01:24:15 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3665da3d0091ab765d54ce643bd82d353c040631
      https://github.com/llvm/llvm-project/commit/3665da3d0091ab765d54ce643bd82d353c040631
  Author: Timm Bäder <tbaeder at redhat.com>
  Date:   2023-01-21 (Sat, 21 Jan 2023)

  Changed paths:
    M clang/lib/AST/Interp/ByteCodeExprGen.cpp
    M clang/lib/AST/Interp/ByteCodeExprGen.h
    M clang/lib/AST/Interp/ByteCodeStmtGen.cpp
    M clang/lib/AST/Interp/ByteCodeStmtGen.h
    M clang/lib/AST/Interp/Program.cpp
    M clang/lib/AST/Interp/Program.h

  Log Message:
  -----------
  Re-commit "[clang][Interp] Unify visiting variable declarations"

We often visit the same variable multiple times, e.g. once when checking
its initializer and later when compiling the function. Unify both of
those in visitVarDecl() and do the returning of the value in
visitDecl().

This time, use a VariableScope instead of a DeclScope for local
variables. This way, we don't emit Destroy ops for the local variables
immediately after creating them.

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




More information about the All-commits mailing list