[all-commits] [llvm/llvm-project] 2e9037: [Clang] Reset FP options before function instantia...

Serge Pavlov via All-commits all-commits at lists.llvm.org
Wed Jul 5 02:35:33 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2e903709de003dc6ae980197f4a0850a158dd9b8
  Author: Serge Pavlov <sepavloff at gmail.com>
  Date:   2023-07-05 (Wed, 05 Jul 2023)

  Changed paths:
    M clang/include/clang/Sema/Sema.h
    M clang/lib/Parse/ParseTemplate.cpp
    M clang/lib/Sema/SemaTemplate.cpp
    M clang/lib/Serialization/ASTReader.cpp
    M clang/lib/Serialization/ASTWriter.cpp
    M clang/test/CodeGen/fp-template.cpp

  Log Message:
  [Clang] Reset FP options before function instantiations

This is recommit of 98390ccb80569e8fbb20e6c996b4b8cff87fbec6, reverted
in 82a3969d710f5fb7a2ee4c9afadb648653923fef, because it caused
https://github.com/llvm/llvm-project/issues/63542. Although the problem
described in the issue is independent of the reverted patch, fail of
PCH/late-parsed-instantiations.cpp indeed obseved on PowerPC and is
likely to be caused by wrong serialization of `LateParsedTemplate`
objects. In this patch the serialization is fixed.

Original commit message is below.

Previously function template instantiations occurred with FP options
that were in effect at the end of translation unit. It was a problem
for late template parsing as these FP options were used as attributes of
AST nodes and may result in crash. To fix it FP options are set to the
state of the point of template definition.

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

More information about the All-commits mailing list