llvm-project/clang/test
Serge Pavlov f7819ce166 [FPEnv] Allow CompoundStmt to keep FP options
This is a recommit of b822efc740,
reverted in dc34d8df4c. The commit caused
fails because the test ast-print-fp-pragmas.c did not specify particular
target, and it failed on targets which do not support constrained
intrinsics. The original commit message is below.

AST does not have special nodes for pragmas. Instead a pragma modifies
some state variables of Sema, which in turn results in modified
attributes of AST nodes. This technique applies to floating point
operations as well. Every AST node that can depend on FP options keeps
current set of them.

This technique works well for options like exception behavior or fast
math options. They represent instructions to the compiler how to modify
code generation for the affected nodes. However treatment of FP control
modes has problems with this technique. Modifying FP control mode
(like rounding direction) usually requires operations on hardware, like
writing to control registers. It must be done prior to the first
operation that depends on the control mode. In particular, such
operations are required for implementation of `pragma STDC FENV_ROUND`,
compiler should set up necessary rounding direction at the beginning of
compound statement where the pragma occurs. As there is no representation
for pragmas in AST, the code generation becomes a complicated task in
this case.

To solve this issue FP options are kept inside CompoundStmt. Unlike to FP
options in expressions, these does not affect any operation on FP values,
but only inform the codegen about the FP options that act in the body of
the statement. As all pragmas that modify FP environment may occurs only
at the start of compound statement or at global level, such solution
works for all relevant pragmas. The options are kept as a difference
from the options in the enclosing compound statement or default options,
it helps codegen to set only changed control modes.

Differential Revision: https://reviews.llvm.org/D123952
2022-07-03 17:06:26 +07:00
..
APINotes
ARCMT
AST [FPEnv] Allow CompoundStmt to keep FP options 2022-07-03 17:06:26 +07:00
ASTMerge
Analysis [OpenMP] Initial parsing and semantic support for 'parallel masked taskloop simd' construct 2022-07-01 08:57:15 -07:00
C/drs Test a few more C99 DRs 2022-07-01 13:54:11 -04:00
CXX Revert "Re-apply "Deferred Concept Instantiation Implementation""" 2022-07-01 11:20:16 -07:00
ClangScanDeps [Lex] Make sure to notify `MultipleIncludeOpt` for "read tokens" during fast dependency directive lexing 2022-06-29 15:50:16 -07:00
CodeCompletion
CodeGen [LLVM][LTO][LLD] Enable Profile Guided Layout (--call-graph-profile-sort) for FullLTO 2022-07-01 13:57:36 +01:00
CodeGenCUDA [HIP] add -fhip-kernel-arg-name 2022-06-24 11:15:36 -04:00
CodeGenCUDASPIRV
CodeGenCXX Fix miscompile with [[no_unique_address]] struct fields. 2022-06-29 13:08:40 -07:00
CodeGenCoroutines [Coroutines] Convert coroutine.presplit to enum attr 2022-06-14 14:23:46 +08:00
CodeGenHIP
CodeGenHLSL [HLSL] Enable half type for hlsl. 2022-06-23 12:56:26 -07:00
CodeGenObjC Revert "[clang] Introduce -fstrict-flex-arrays=<n> for stricter handling of flexible arrays" 2022-06-27 14:03:09 -07:00
CodeGenObjCXX [DeadArgElim] Re-apply: Set unused arguments for internal functions 2022-05-12 08:46:16 -07:00
CodeGenOpenCL [AMDGPU] Add WMMA clang builtins 2022-07-01 08:55:25 +02:00
CodeGenOpenCLCXX
CodeGenSYCL
Coverage
CoverageMapping [clang][NFC] Cleanup some coroutine tests 2022-05-16 05:15:12 -07:00
Driver [Driver] Always use --as-needed with libunwind 2022-06-30 03:33:40 +00:00
ExtractAPI [clang][extract-api] Don't emit symbols prefixed with an underscore 2022-05-25 19:02:18 +01:00
FixIt [Clang][C++23] P2071 Named universal character escapes 2022-06-25 19:03:33 +02:00
Format
Frontend [clang] Reject non-declaration C++11 attributes on declarations 2022-06-15 11:58:26 +02:00
Headers [OpenCL] Reword unknown extension pragma diagnostic 2022-06-15 10:54:46 +01:00
Import
Index Revert "[clang][test] mark tests added in ee8524087c as unsupported on AIX" 2022-05-30 09:35:26 -04:00
Integration
InterfaceStubs
Interpreter Revert "[NFC] Add a missing test for for clang-repl" 2022-07-01 23:55:55 +08:00
Layout
Lexer Improve handling of static assert messages. 2022-06-29 14:57:35 +02:00
LibClang
Misc Improve handling of static assert messages. 2022-06-29 14:57:35 +02:00
Modules [NFC] [Modules] Add test for inherit default arguments 2022-06-30 15:48:22 +08:00
OpenMP [OpenMP][NFC] Reuse check lines for Clang/OpenMP tests 2022-07-01 21:34:11 -05:00
PCH Improve the formatting of static_assert messages 2022-06-30 23:59:21 +02:00
Parser [Clang][C++23] P2071 Named universal character escapes 2022-06-25 19:03:33 +02:00
ParserHLSL [HLSL] Adjust access specifier behavior 2022-04-28 10:37:50 -05:00
ParserSYCL
Preprocessor [Clang][Preprocessor] Fix inconsistent `FLT_EVAL_METHOD` when compiling vs preprocessing 2022-06-29 19:36:22 +01:00
Profile [NFC] Rename Instrinsic to Intrinsic 2022-04-25 18:13:23 +01:00
Refactor
Rewriter
Sema Improve the formatting of static_assert messages 2022-06-30 23:59:21 +02:00
SemaCUDA Fix test; we now expect a pedantic warning 2022-05-11 06:52:21 -04:00
SemaCXX Improve the formatting of static_assert messages 2022-06-30 23:59:21 +02:00
SemaHLSL [HLSL] Change WaveActiveCountBits to wrapper of __builtin_hlsl_wave_active_count_bits 2022-06-30 06:16:51 -07:00
SemaObjC [clang] Reject non-declaration C++11 attributes on declarations 2022-06-15 11:58:26 +02:00
SemaObjCXX Change the behavior of implicit int diagnostics 2022-05-04 08:35:47 -04:00
SemaOpenCL [OpenCL] Reduce emitting candidate notes for builtins 2022-06-27 09:55:44 +01:00
SemaOpenCLCXX
SemaSYCL
SemaTemplate Revert "Re-apply "Deferred Concept Instantiation Implementation""" 2022-07-01 11:20:16 -07:00
TableGen
Templight
Tooling Revert "[clang-diff] Fix assertion error when dealing with wide strings" 2022-06-07 14:58:10 -07:00
Unit [lit] Fix setup of sanitizer environment 2022-05-19 19:24:16 -07:00
VFS Reland "[dwarf] Emit a DIGlobalVariable for constant strings." 2022-05-18 13:56:45 -07:00
clang-rename
utils/update_cc_test_checks Revert "[utils] Avoid hardcoding metadata ids in update_cc_test_checks" 2022-05-10 14:04:19 -07:00
.clang-format
CMakeLists.txt [clang-fuzzer] Add a tiny tool to generate a fuzzing dictionary for clang 2022-05-09 18:25:29 +02:00
TestRunner.sh
lit.cfg.py cmake: configure clang lit to use hmaptool from source directly 2022-06-16 13:08:50 +02:00
lit.site.cfg.py.in