FailedChanges

Summary

  1. [SyntaxTree][Synthesis] Fix allocation in `createTree` for more general use (details)
  2. [DFSan] Add bcmp wrapper. (details)
  3. [Sema] Introduce BuiltinAttr, per-declaration builtin-ness (details)
Commit 1e19165bd89db6671a80e0b25b32d5c7ae79455c by ecaldas
[SyntaxTree][Synthesis] Fix allocation in `createTree` for more general use

Prior to this change `createTree` could not create arbitrary syntax
trees. Now it dispatches to the constructor of the concrete syntax tree
according to the `NodeKind` passed as argument. This allows reuse inside
the Synthesis API.  # Please enter the commit message for your changes.
Lines starting

Differential Revision: https://reviews.llvm.org/D87820
The file was modifiedclang/lib/Tooling/Syntax/Synthesis.cpp
The file was modifiedclang/include/clang/Tooling/Syntax/BuildTree.h
Commit 50dd545b00ed72a9ed2031cb5eb9bf26dd5af0c0 by mascasa
[DFSan] Add bcmp wrapper.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D87801
The file was modifiedcompiler-rt/lib/dfsan/done_abilist.txt
The file was modifiedcompiler-rt/test/dfsan/custom.cpp
The file was modifiedcompiler-rt/lib/dfsan/dfsan_custom.cpp
Commit e09107ab80dced55414fa458cf78e6cdfe90da6e by raul.tambre
[Sema] Introduce BuiltinAttr, per-declaration builtin-ness

Instead of relying on whether a certain identifier is a builtin, introduce BuiltinAttr to specify a declaration as having builtin semantics.

This fixes incompatible redeclarations of builtins, as reverting the identifier as being builtin due to one incompatible redeclaration would have broken rest of the builtin calls.
Mostly-compatible redeclarations of builtins also no longer have builtin semantics. They don't call the builtin nor inherit their attributes.
A long-standing FIXME regarding builtins inside a namespace enclosed in extern "C" not being recognized is also addressed.

Due to the more correct handling attributes for builtin functions are added in more places, resulting in more useful warnings.
Tests are updated to reflect that.

Intrinsics without an inline definition in intrin.h had `inline` and `static` removed as they had no effect and caused them to no longer be recognized as builtins otherwise.

A pthread_create() related test is XFAIL-ed, as it relied on it being recognized as a builtin based on its name.
The builtin declaration syntax is too restrictive and doesn't allow custom structs, function pointers, etc.
It seems to be the only case and fixing this would require reworking the current builtin syntax, so this seems acceptable.

Fixes PR45410.

Reviewed By: rsmith, yutsumi

Differential Revision: https://reviews.llvm.org/D77491
The file was modifiedclang/test/Sema/warn-fortify-source.c
The file was modifiedclang/include/clang/Basic/Builtins.def
The file was modifiedclang/lib/Sema/SemaDecl.cpp
The file was modifiedclang/include/clang/Basic/IdentifierTable.h
The file was modifiedclang/lib/AST/Decl.cpp
The file was modifiedclang/test/CodeGen/callback_pthread_create.c
The file was modifiedclang/include/clang/Basic/Attr.td
The file was modifiedclang/test/AST/ast-dump-attr.cpp
The file was modifiedclang/test/Sema/implicit-builtin-decl.c
The file was modifiedclang/test/SemaCXX/cxx11-compat.cpp
The file was modifiedclang/lib/Headers/intrin.h
The file was modifiedclang/lib/Serialization/ASTReader.cpp
The file was modifiedclang/test/CodeGenCXX/builtins.cpp
The file was modifiedclang/lib/Serialization/ASTWriter.cpp
The file was modifiedclang/include/clang/Sema/Sema.h
The file was modifiedclang/lib/Sema/SemaExpr.cpp
The file was modifiedclang/test/SemaCXX/warn-unused-local-typedef.cpp
The file was modifiedclang/lib/Sema/SemaLookup.cpp
The file was addedclang/test/CodeGen/builtin-redeclaration.c