[all-commits] [llvm/llvm-project] 6c75ab: Introduce _BitInt, deprecate _ExtInt

Aaron Ballman via All-commits all-commits at lists.llvm.org
Mon Dec 6 09:52:23 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6c75ab5f66b403f7ca67e86aeed3a58abe10570b
      https://github.com/llvm/llvm-project/commit/6c75ab5f66b403f7ca67e86aeed3a58abe10570b
  Author: Aaron Ballman <aaron at aaronballman.com>
  Date:   2021-12-06 (Mon, 06 Dec 2021)

  Changed paths:
    M clang-tools-extra/test/clang-tidy/checkers/bugprone-implicit-widening-of-multiplication-result-extint.cpp
    M clang/docs/LanguageExtensions.rst
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/AST/ASTContext.h
    M clang/include/clang/AST/RecursiveASTVisitor.h
    M clang/include/clang/AST/Type.h
    M clang/include/clang/AST/TypeLoc.h
    M clang/include/clang/AST/TypeProperties.td
    M clang/include/clang/Basic/DiagnosticGroups.td
    M clang/include/clang/Basic/DiagnosticParseKinds.td
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/include/clang/Basic/Specifiers.h
    M clang/include/clang/Basic/TargetInfo.h
    M clang/include/clang/Basic/TokenKinds.def
    M clang/include/clang/Basic/TypeNodes.td
    M clang/include/clang/Parse/Parser.h
    M clang/include/clang/Sema/DeclSpec.h
    M clang/include/clang/Sema/Sema.h
    M clang/include/clang/Serialization/TypeBitCodes.def
    M clang/lib/AST/ASTContext.cpp
    M clang/lib/AST/ASTStructuralEquivalence.cpp
    M clang/lib/AST/ExprConstant.cpp
    M clang/lib/AST/ItaniumMangle.cpp
    M clang/lib/AST/MicrosoftMangle.cpp
    M clang/lib/AST/Type.cpp
    M clang/lib/AST/TypePrinter.cpp
    M clang/lib/Basic/Targets/AArch64.h
    M clang/lib/Basic/Targets/AMDGPU.h
    M clang/lib/Basic/Targets/ARC.h
    M clang/lib/Basic/Targets/ARM.h
    M clang/lib/Basic/Targets/Hexagon.h
    M clang/lib/Basic/Targets/Lanai.h
    M clang/lib/Basic/Targets/Mips.h
    M clang/lib/Basic/Targets/NVPTX.h
    M clang/lib/Basic/Targets/PNaCl.h
    M clang/lib/Basic/Targets/PPC.h
    M clang/lib/Basic/Targets/RISCV.h
    M clang/lib/Basic/Targets/SPIR.h
    M clang/lib/Basic/Targets/Sparc.h
    M clang/lib/Basic/Targets/SystemZ.h
    M clang/lib/Basic/Targets/WebAssembly.h
    M clang/lib/Basic/Targets/X86.h
    M clang/lib/Basic/Targets/XCore.h
    M clang/lib/CodeGen/ABIInfo.h
    M clang/lib/CodeGen/CGBuiltin.cpp
    M clang/lib/CodeGen/CGCall.cpp
    M clang/lib/CodeGen/CGDebugInfo.cpp
    M clang/lib/CodeGen/CGDebugInfo.h
    M clang/lib/CodeGen/CodeGenFunction.cpp
    M clang/lib/CodeGen/CodeGenTBAA.cpp
    M clang/lib/CodeGen/CodeGenTypes.cpp
    M clang/lib/CodeGen/ItaniumCXXABI.cpp
    M clang/lib/CodeGen/TargetInfo.cpp
    M clang/lib/Parse/ParseDecl.cpp
    M clang/lib/Parse/ParseExpr.cpp
    M clang/lib/Parse/ParseExprCXX.cpp
    M clang/lib/Parse/ParseTentative.cpp
    M clang/lib/Sema/DeclSpec.cpp
    M clang/lib/Sema/Sema.cpp
    M clang/lib/Sema/SemaChecking.cpp
    M clang/lib/Sema/SemaDecl.cpp
    M clang/lib/Sema/SemaDeclAttr.cpp
    M clang/lib/Sema/SemaExpr.cpp
    M clang/lib/Sema/SemaLookup.cpp
    M clang/lib/Sema/SemaStmtAsm.cpp
    M clang/lib/Sema/SemaTemplate.cpp
    M clang/lib/Sema/SemaTemplateDeduction.cpp
    M clang/lib/Sema/SemaTemplateVariadic.cpp
    M clang/lib/Sema/SemaType.cpp
    M clang/lib/Sema/TreeTransform.h
    M clang/lib/Serialization/ASTReader.cpp
    M clang/lib/Serialization/ASTWriter.cpp
    M clang/test/CXX/temp/temp.param/p7.cpp
    M clang/test/CodeGen/attr-noundef.cpp
    M clang/test/CodeGen/builtins-overflow.c
    M clang/test/CodeGen/ext-int-cc.c
    M clang/test/CodeGen/ext-int-sanitizer.cpp
    M clang/test/CodeGen/ext-int.c
    M clang/test/CodeGen/extend-arg-64.c
    M clang/test/CodeGenCXX/ext-int.cpp
    M clang/test/CodeGenOpenCL/ext-int-shift.cl
    M clang/test/OpenMP/nvptx_unsupported_type_messages.cpp
    M clang/test/Parser/ext-int.cpp
    M clang/test/Sema/builtins-overflow.c
    M clang/test/Sema/builtins.c
    M clang/test/Sema/ext-int.c
    M clang/test/Sema/invalid-bitwidth-expr.mm
    M clang/test/SemaCXX/ext-int-asm.cpp
    M clang/test/SemaCXX/ext-int.cpp
    M clang/tools/libclang/CIndex.cpp

  Log Message:
  -----------
  Introduce _BitInt, deprecate _ExtInt

WG14 adopted the _ExtInt feature from Clang for C23, but renamed the
type to be _BitInt. This patch does the vast majority of the work to
rename _ExtInt to _BitInt, which accounts for most of its size. The new
type is exposed in older C modes and all C++ modes as a conforming
extension. However, there are functional changes worth calling out:

* Deprecates _ExtInt with a fix-it to help users migrate to _BitInt.
* Updates the mangling for the type.
* Updates the documentation and adds a release note to warn users what
is going on.
* Adds new diagnostics for use of _BitInt to call out when it's used as
a Clang extension or as a pre-C23 compatibility concern.
* Adds new tests for the new diagnostic behaviors.

I want to call out the ABI break specifically. We do not believe that
this break will cause a significant imposition for early adopters of
the feature, and so this is being done as a full break. If it turns out
there are critical uses where recompilation is not an option for some
reason, we can consider using ABI tags to ease the transition.




More information about the All-commits mailing list