[all-commits] [llvm/llvm-project] cdad18: [clang] Fix #embed "fast path" (#121479)

Mariya Podchishchaeva via All-commits all-commits at lists.llvm.org
Fri Jan 3 02:17:38 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: cdad18319425a7bf93cc25b276a7961fe5b1168b
      https://github.com/llvm/llvm-project/commit/cdad18319425a7bf93cc25b276a7961fe5b1168b
  Author: Mariya Podchishchaeva <mariya.podchishchaeva at intel.com>
  Date:   2025-01-03 (Fri, 03 Jan 2025)

  Changed paths:
    M clang/lib/Sema/SemaInit.cpp
    M clang/test/Analysis/embed.c

  Log Message:
  -----------
  [clang] Fix #embed "fast path" (#121479)

When a single #embed directive is used to initialize a char array, the
case is optimized via swap of EmbedExpr to underlying StringLiteral,
resulting in better performance in AST consumers.
While browsing through the code, I realized that
7122b70cfc8e23a069410215c363da76d842bda4
which changed type of EmbedExpr made the "fast path" unreachable. This
patch fixes this unfortunate situation.



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