[all-commits] [llvm/llvm-project] 3ac429: [clang] Don't short-circuit constant evaluation fo...

cmagahern via All-commits all-commits at lists.llvm.org
Thu Jan 19 18:04:40 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3ac4299d3798eb7078905d5fc8f23781556c90a1
      https://github.com/llvm/llvm-project/commit/3ac4299d3798eb7078905d5fc8f23781556c90a1
  Author: Charles Magahern <cmagahern at apple.com>
  Date:   2023-01-19 (Thu, 19 Jan 2023)

  Changed paths:
    M clang/lib/AST/ExprConstant.cpp
    M clang/test/CodeGen/2007-06-15-AnnotateAttribute.c

  Log Message:
  -----------
  [clang] Don't short-circuit constant evaluation for array or record types

FastEvaluateAsRValue returns `true` without setting a result value for when a
given constant expression is an array or record type.

Clang attributes must be able to support constant expressions that are array or
record types, so proceed with the slower path for evaluation in the case where
`FastEvaluateAsRValue` does not yield an evaluation result.

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




More information about the All-commits mailing list