[PATCH] D95665: [Builtins][FIX] Allow targets to opt-out of `long double` builtins

Johannes Doerfert via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 28 22:43:54 PST 2021


jdoerfert created this revision.
jdoerfert added reviewers: tra, hliao, yaxunl, ldionne, compnerd, Fznamznon, erichkeane, rsmith, mclow.lists.
Herald added subscribers: kerbowa, nhaehnle, jvesely, jholewinski.
Herald added a reviewer: bollu.
jdoerfert requested review of this revision.
Herald added a project: clang.

If a target doesn't support `long double`, e.g., a GPU, it should not
expose the builtins that deal with them in the first place. This patch
also adjusts `__has_builtin` to return false in those cases.

This is a first step to fix PR48923, second is to adjust libcxx and
add the `__has_builtin` guards.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D95665

Files:
  clang/include/clang/Basic/Builtins.h
  clang/include/clang/Basic/TargetInfo.h
  clang/lib/Basic/Builtins.cpp
  clang/lib/Basic/TargetInfo.cpp
  clang/lib/Basic/Targets/AMDGPU.cpp
  clang/lib/Basic/Targets/NVPTX.cpp
  clang/lib/Frontend/ChainedIncludesSource.cpp
  clang/lib/Frontend/FrontendAction.cpp
  clang/lib/Lex/PPMacroExpansion.cpp
  clang/test/Parser/builtin_long_double.c
  clang/test/Preprocessor/has_builtin_long_double.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D95665.320053.patch
Type: text/x-patch
Size: 10688 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210129/30e6ab2e/attachment-0001.bin>


More information about the cfe-commits mailing list