[all-commits] [llvm/llvm-project] 878d96: [clang][CodeGen] Handle throw expression in condit...

Raul Tambre via All-commits all-commits at lists.llvm.org
Wed Apr 8 12:32:27 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 878d96011acc0314ae7e5f87aca515286abbe4db
      https://github.com/llvm/llvm-project/commit/878d96011acc0314ae7e5f87aca515286abbe4db
  Author: Raul Tambre <raul at tambre.ee>
  Date:   2020-04-08 (Wed, 08 Apr 2020)

  Changed paths:
    M clang/lib/CodeGen/CGExpr.cpp
    M clang/test/CodeGenCXX/throw-expressions.cpp

  Log Message:
  -----------
  [clang][CodeGen] Handle throw expression in conditional operator constant folding

Summary:
We're smart and do constant folding when emitting conditional operators.
Thus we emit the live value as a lvalue. This doesn't work if the live value is a throw expression.
Handle this by emitting the throw and returning the dead value as the lvalue.

Fixes PR28184.

Reviewers: rsmith

Reviewed By: rsmith

Subscribers: cfe-commits

Tags: #clang

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




More information about the All-commits mailing list