Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
129 commits
Select commit Hold shift + click to select a range
2cec041
[nsan] Add nsan_preinit.cpp and make it static library only
MaskRay Jul 11, 2024
d9d977f
Fix assert for [CGData] Outlined Hash Tree #89792 (#98383)
kyulee-com Jul 11, 2024
4710e0f
[NFC][Clang] Move functions of BranchProtectionInfo out of line (#98329)
DanielKristofKiss Jul 11, 2024
dbd00a5
[SPIRV] Improve type inference of operand presented by opaque pointer…
VyacheslavLevytskyy Jul 11, 2024
0483f14
[NFC][Coroutines] Remove redundant checks for replacing PrepareFns (#…
yuxuanchen1997 Jul 11, 2024
7eae9bb
[mlir][scf] Fix doc on `emitNormalizedLoopBounds`, NFC (#98372)
ubfx Jul 11, 2024
c74ba57
[RISCV] Convert AVLs with vlenb to VLMAX where possible (#97800)
lukel97 Jul 11, 2024
ccceeeb
[compiler-rt][test] Fix typo in stderr redirection (#98397)
connieyzhu Jul 11, 2024
b65aba2
Revert "[NFC][Clang] Move functions of BranchProtectionInfo out of li…
DanielKristofKiss Jul 11, 2024
2ca3f87
[gn build] Port c74ba57e0bd9
llvmgnsyncbot Jul 11, 2024
0b15f89
Revert "[nsan] Add nsan_preinit.cpp and make it static library only"
vitalybuka Jul 11, 2024
7868033
[AArch64] Update AUTIxSPPC and RETAxSPPC instructions for registers (…
Stylie777 Jul 11, 2024
6a90769
Revert "[CodeGen] Remove `applySplitCriticalEdges` in `MachineDominat…
nikic Jul 11, 2024
a18f45f
[lldb] Fix string truncation method when substring is the prefix of s…
xgupta Jul 11, 2024
00fd188
[C++20][Modules] static data members of template classes should be al…
dmpolukhin Jul 11, 2024
ce92b2f
[Xtensa] Implement lowering SELECT_CC, SETCC. (#97017)
andreisfr Jul 11, 2024
d4e46f0
[AMDGPU] Fix machine verification failure from INIT_EXEC lowering (#9…
jayfoad Jul 11, 2024
bf4167f
[Clang] Don't crash if input file is not a module. (#98439)
chestnykh Jul 11, 2024
eb61956
[ObjC][CodeGen] Assume a for-in loop is in bounds and cannot overflow…
AZero13 Jul 11, 2024
55c0048
[Clang][Driver] Skip empty strings in getAArch64MultilibFlags (#97827)
statham-arm Jul 11, 2024
18e70a4
[llvm][TargetParser] Return StringMap from getHostCPUFeatures (#97824)
DavidSpickett Jul 11, 2024
74b933c
[LoongArch][clang] Modify `loongarch-msimd.c` to avoid `grep -o`. NFC…
ylzsx Jul 11, 2024
67f4968
[LV] Skip cost for ZExt/SExts that will be removed by truncating ops.
fhahn Jul 11, 2024
e980990
[SimplifyLibCalls] Simplify cabs libcall if real or imaginary part of…
HendrikHuebner Jul 11, 2024
0ff13f7
[X86] combineX86ShufflesConstants - replace Root argument with VT/DL …
RKSimon Jul 11, 2024
117cc4a
[MemCpyOpt] No need to create `memcpy(a <- a)` (#98321)
dianqk Jul 11, 2024
eeed589
[libc] Correctly Run Multiple Benchmarks in the Same File (#98467)
jameshu15869 Jul 11, 2024
eb97739
[compiler-rt][RISC-V] Save/Restore for E goes with ABI (#95390)
lenary Jul 11, 2024
e1bd337
[lldb] Fix ThreadList assignment race (#98293)
labath Jul 11, 2024
0248b59
[clang][Driver] Fix safestack -u ordering (#98468)
rorth Jul 11, 2024
5c205b6
[safestack] Various Solaris fixes (#98469)
rorth Jul 11, 2024
d69e949
[mlir] [linalg] Fix bufferize error in tensor.parallel_insert_slice o…
cxy-1993 Jul 11, 2024
e4163c0
[clang] Emit bad shift warnings (#70307)
budimirarandjelovichtec Jul 11, 2024
a3913a1
[llvm-dlltool] Respect the DATA flag when creating aliases (#98225)
mstorsjo Jul 11, 2024
81cdf94
[clang][OpenMP] Fix region nesting check for `scan` directive (#98386)
kparzysz Jul 11, 2024
3a14ffb
[AArch64] Implement GCS ACLE intrinsics (#96903)
john-brawn-arm Jul 11, 2024
b64c1de
[MC] set OpenBSD's ELFOSABI by default (#98158)
Ericson2314 Jul 11, 2024
2fb53f3
[mlir][tosa] Fix for incorrect cannonicalization of tosa.pad (#98356)
sabauma Jul 11, 2024
4a8f1d6
[flang] Lower 2-argument F2008 atan intrinsic
tarunprabhu Jul 11, 2024
ddbad86
[Patchpoint] Implement integer result type legalization for patchpoin…
Il-Capitano Jul 11, 2024
d9c26b9
[mlir][linalg] Add transform operator for Winograd Conv2D algorithm (…
Hsiangkai Jul 11, 2024
8b7263b
[clang] CTAD: use index and depth to retrieve template parameter for …
hokein Jul 11, 2024
2267191
[LV] Add missing check, drop 'then'.
fhahn Jul 11, 2024
2a79fd0
[bazel] Port for d9c26b9d560f4362503b8f0ec97a52a0a36a57ce
hokein Jul 11, 2024
1860fd0
[LV] Autovectorization for the all-in-one histogram intrinsic (#91458)
huntergr-arm Jul 11, 2024
4a9de11
[libc][math][c23] Enable roundeven{,f,l,f128} C23 math functions on A…
overmighty Jul 11, 2024
dffa28f
[libc] Fix BigInt's operator %= (#98484)
mikhailramalho Jul 11, 2024
c66e1d6
[llvm][AArch64] apple-m4 is armv9.2-a (#98267)
jroelofs Jul 11, 2024
4502ea8
[InstCombine] More precise nuw preservation in ptrtoint of gep fold
nikic Jul 11, 2024
9a5a873
[VPlan] Introduce ResumePhi VPInstruction, use to create phi for FOR.…
fhahn Jul 11, 2024
36d5281
[X86][test] Pre-commit test for an incorrect pattern for CCMP/CTEST w…
KanRobert Jul 11, 2024
e8e2cff
[X86][CodeGen] Fix an incorrect pattern for CCMP/CTEST with imm64
KanRobert Jul 11, 2024
c026135
Revert "[MC] set OpenBSD's ELFOSABI by default" (#98494)
joker-eph Jul 11, 2024
bbb90fe
[tsan] Fix ASLR edge case, and improve diagnostics (#97125)
thurstond Jul 11, 2024
fff8b32
[msan] Block signals during MsanThread::TSDDtor (#98405)
thurstond Jul 11, 2024
dab36b2
[mlir][debug] Allow global with local scope. (#98358)
abidh Jul 11, 2024
621bcfc
[libc][math] Optimize generic nearest integer functions (#98483)
overmighty Jul 11, 2024
22a7f6d
Revert "[LV] Autovectorization for the all-in-one histogram intrinsic…
huntergr-arm Jul 11, 2024
90ccf21
[LinkerWrapper] Extend with usual pass options (#96704)
jdenny-ornl Jul 11, 2024
0431c61
[Clang] Correctly recognize unexpanded packs in lambda template param…
cor3ntin Jul 11, 2024
fb5a38b
[llvm-objcopy] Add verification of added .note section format
serge-sans-paille Apr 29, 2024
1cbddce
[DebugInfo] Use DW_OP_deref_size for DW_OP_LLVM_extract_bits (#97609)
john-brawn-arm Jul 11, 2024
ae18b94
[PAC] Implement function pointer type discrimination (#96992)
ahatanak Jul 11, 2024
88cbc8c
[NVPTX][NFC] Use same logic to get alignment in param declarations an…
kalxr Jul 11, 2024
84682ad
[hwasan] Temporarily disable test broken on Ubuntu 24.04
vitalybuka Jul 11, 2024
55b1410
[lldb] Fix a bug for PT_TLS segments getting loaded when they shouldn…
clayborg Jul 11, 2024
9ddfe62
[LLVM][test][nfc] Updating test to work with internal shell (#98370)
connieyzhu Jul 11, 2024
e16882f
fix bug that undefined internal is a warning only for -pedantic-error…
ccrownhill Jul 11, 2024
e66ea43
[flang][cuda] Improve data transfer detection by filtering symbols (#…
clementval Jul 11, 2024
dd44003
[bazel] Port #96704 (#98507)
keith Jul 11, 2024
9f283bf
Revert "fix bug that undefined internal is a warning only for -pedant…
AaronBallman Jul 11, 2024
0171e23
Revert "Revert fix bug that undefined internal is a warning only for …
ccrownhill Jul 11, 2024
6c903f0
[TableGen] Add support for emitting new function definition to return…
quic-garvgupt Jul 11, 2024
3f1a767
[LLVM] Factor disabled Libcalls into the initializer (#98421)
jhuber6 Jul 11, 2024
05b7b22
[libc] integration test outputs header in build (#98385)
aaryanshukla Jul 11, 2024
5aed6d6
Reland: [libc] Move off_t and stdio macros to proxy hdrs (#98384)
michaelrj-google Jul 11, 2024
546c090
[MachineSink] Only add sink candidate if ToBB is a successor of fromBB
yozhu Jul 11, 2024
04c8c95
Revert "[MachineSink] Only add sink candidate if ToBB is a successor …
yozhu Jul 11, 2024
9340c9f
[libc] fix fileno includes (#98514)
michaelrj-google Jul 11, 2024
b187ecb
[libc] fix baremetal getchar (#98515)
michaelrj-google Jul 11, 2024
01a9888
[SLP][NFC]Add isGather() function and use it instead direct compariso…
alexey-bataev Jul 11, 2024
7f2a5df
[AArch64] Remove superfluous sxtw in peephole opt (#96293)
davemgreen Jul 11, 2024
2d7e136
[flang] Adjust semantics of the char length of an array constructor (…
klausler Jul 11, 2024
3f30eff
[libc] Migrate to using LIBC_NAMESPACE_DECL for namespace declaration…
petrhosek Jul 11, 2024
60c9033
[flang] Silence over-eager warning about interoperable character leng…
klausler Jul 11, 2024
5024a6e
[flang][preprocessor] Support __TIMESTAMP__ (#98057)
klausler Jul 11, 2024
43024a4
[lldb][man][nfc] Don't register a markdown parser when building man p…
alanzhao1 Jul 11, 2024
ea4ae25
[lldb] Fix section printing to always align. (#98521)
clayborg Jul 11, 2024
0b58f34
[X86][CodeGen] Add base trig intrinsic lowerings (#96222)
farzonl Jul 11, 2024
d5285fe
[flang] Downgrade error message to a portability warning (#98368)
klausler Jul 11, 2024
d6f314c
[flang] Accept IGNORE_TKR in separate module procedure interface (#98…
klausler Jul 11, 2024
a074f88
[libc] Update libc namespace clang-tidy checks (#98424)
ilovepi Jul 11, 2024
eb9a78b
[flang] Fix bad parse tree rewrite into a substring (#98407)
klausler Jul 11, 2024
6f04f46
[clang] [Headers] Don't use unreserved names in avx512fp16intrin.h (#…
mstorsjo Jul 11, 2024
657dbc3
[RISCV] Reorder shuffle operands if one side is an identity (#98534)
preames Jul 11, 2024
c9a4a27
Revert "[safestack] Various Solaris fixes" (#98541)
vitalybuka Jul 11, 2024
6598795
[flang] Add -fhermetic-module-files (#98083)
klausler Jul 11, 2024
7a49d80
[VPlan] Skip users outside loop in check for exit pre-compute candidates
fhahn Jul 11, 2024
8901c1c
[libc] Fix atexit not getting linked on linux (#98537)
michaelrj-google Jul 11, 2024
92fc1eb
[HLSL] add loop unroll (#93879)
farzonl Jul 11, 2024
cfeb8f2
[flang] Fix broken atan_real16 test (#98499)
tarunprabhu Jul 11, 2024
6cbea48
[libc] Define `HUGE_VALF` in math.h (#98522)
petrhosek Jul 11, 2024
53cc24d
[libc] Disable hidden visibility for LIBC_NAMESPACE with GCC (#98549)
petrhosek Jul 11, 2024
7d6a6e6
[libc] Add missing dependency on `src.__support.macros.config` (#98552)
petrhosek Jul 11, 2024
6bc6f6b
[MC] set OpenBSD's ELFOSABI by default (#98158) (#98553)
Ericson2314 Jul 11, 2024
280d82e
Small fix of `lld/test/ELF/basic-sparcv9.s` (#98555)
Ericson2314 Jul 11, 2024
9c1861b
[mlir][NFC] Remove unused includes (#98557)
pranavk Jul 11, 2024
d0d05ae
[Darwin] Fix availability of exp10 for watchOS, tvOS, xROS. (#98542)
fhahn Jul 11, 2024
ac304d5
[libc] newheadergen: quick fixes to tests (#98561)
aaryanshukla Jul 11, 2024
ce4aada
Reapply "[Clang] Implement resolution for CWG1835 (#92957)" (#98547)
sdkrystian Jul 11, 2024
1cafde2
[clang][X86] Add __cpuidex function to cpuid.h (#97785)
boomanaiden154 Jul 11, 2024
9f8205d
[MemProf] Track and report profiled sizes through cloning (#98382)
teresajohnson Jul 11, 2024
46307f1
[gn build] Manually port 90ccf21
aeubanks Jul 11, 2024
6c8ff4c
[ProfileData] Take ArrayRef<InstrProfValueData> in addValueData (NFC)…
kazutakahirata Jul 11, 2024
1988c27
[lldb] [NFC] Update TestEarlyProcessLaunch to work on macOS 15
jasonmolenda Jul 11, 2024
9b6504e
[flang][cuda] Make sure to issue freemem for the allocated temp (#98078)
clementval Jul 12, 2024
e57d7da
[SLP][NFC]Add a test with minnum/maxnum patterns, NFC.
alexey-bataev Jul 12, 2024
ce2b280
[BitcodeReader] Remove dead increment (#98412)
tstellar Jul 12, 2024
db3d337
[NFC][hwasan] Print after protecting gaps
vitalybuka Jul 12, 2024
cdd29f5
[ELF,RISCV] Fix TLSDESC=>IE when there is no TLS section
MaskRay Jul 12, 2024
941f794
[AArch64][PAC] Reduce the size of synchronous CFI (#96377)
igorkudrin Jul 12, 2024
1bafe77
[AArch64] Improve the codegen for sdiv 2 (#98324)
vfdff Jul 12, 2024
a853fe2
[nsan] Add nsan_preinit.cpp and make it static library only
MaskRay Jul 12, 2024
79bd628
[NFC][msan] Mention sanitizer in error messages
vitalybuka Jul 12, 2024
ff8a03a
[RISCV] Fix coalesced vsetvli's AVL LiveInterval not always being shr…
lukel97 Jul 12, 2024
6dd1f08
[NFC][msan] Use %p to print addresses
vitalybuka Jul 12, 2024
f52a467
[Clang] Ensure the method scope at the late parsing of noexcept speci…
zyn0217 Jul 12, 2024
90abdf8
[CUDA][HIP][NFC] add CodeGenModule::shouldEmitCUDAGlobalVar (#98543)
yxsamliu Jul 12, 2024
ba7ab88
[CUDA][HIP] Fix template static member
yxsamliu Jul 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ void CalleeNamespaceCheck::check(const MatchFinder::MatchResult &Result) {
// __llvm_libc, we're good.
const auto *NS = dyn_cast<NamespaceDecl>(getOutermostNamespace(FuncDecl));
if (NS && Result.SourceManager->isMacroBodyExpansion(NS->getLocation()) &&
NS->getName().starts_with(RequiredNamespaceStart))
NS->getName().starts_with(RequiredNamespaceRefStart))
return;

const DeclarationName &Name = FuncDecl->getDeclName();
Expand All @@ -62,7 +62,7 @@ void CalleeNamespaceCheck::check(const MatchFinder::MatchResult &Result) {
diag(UsageSiteExpr->getBeginLoc(),
"%0 must resolve to a function declared "
"within the namespace defined by the '%1' macro")
<< FuncDecl << RequiredNamespaceMacroName;
<< FuncDecl << RequiredNamespaceRefMacroName;

diag(FuncDecl->getLocation(), "resolves to this declaration",
clang::DiagnosticIDs::Note);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,35 @@ void ImplementationInNamespaceCheck::check(
const auto *MatchedDecl =
Result.Nodes.getNodeAs<Decl>("child_of_translation_unit");
const auto *NS = dyn_cast<NamespaceDecl>(MatchedDecl);

// LLVM libc declarations should be inside of a non-anonymous namespace.
if (NS == nullptr || NS->isAnonymousNamespace()) {
diag(MatchedDecl->getLocation(),
"declaration must be enclosed within the '%0' namespace")
<< RequiredNamespaceMacroName;
<< RequiredNamespaceDeclMacroName;
return;
}

// Enforce that the namespace is the result of macro expansion
if (Result.SourceManager->isMacroBodyExpansion(NS->getLocation()) == false) {
diag(NS->getLocation(), "the outermost namespace should be the '%0' macro")
<< RequiredNamespaceMacroName;
<< RequiredNamespaceDeclMacroName;
return;
}
if (NS->getName().starts_with(RequiredNamespaceStart) == false) {

// We want the macro to have [[gnu::visibility("hidden")]] as a prefix, but
// visibility is just an attribute in the AST construct, so we check that
// instead.
if (NS->getVisibility() != Visibility::HiddenVisibility) {
diag(NS->getLocation(), "the '%0' macro should start with '%1'")
<< RequiredNamespaceMacroName << RequiredNamespaceStart;
<< RequiredNamespaceDeclMacroName << RequiredNamespaceDeclStart;
return;
}

// Lastly, make sure the namespace name actually has the __llvm_libc prefix
if (NS->getName().starts_with(RequiredNamespaceRefStart) == false) {
diag(NS->getLocation(), "the '%0' macro expansion should start with '%1'")
<< RequiredNamespaceDeclMacroName << RequiredNamespaceRefStart;
return;
}
}
Expand Down
8 changes: 6 additions & 2 deletions clang-tools-extra/clang-tidy/llvmlibc/NamespaceConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@

namespace clang::tidy::llvm_libc {

const static llvm::StringRef RequiredNamespaceStart = "__llvm_libc";
const static llvm::StringRef RequiredNamespaceMacroName = "LIBC_NAMESPACE";
const static llvm::StringRef RequiredNamespaceRefStart = "__llvm_libc";
const static llvm::StringRef RequiredNamespaceRefMacroName = "LIBC_NAMESPACE";
const static llvm::StringRef RequiredNamespaceDeclStart =
"[[gnu::visibility(\"hidden\")]] __llvm_libc";
const static llvm::StringRef RequiredNamespaceDeclMacroName =
"LIBC_NAMESPACE_DECL";

} // namespace clang::tidy::llvm_libc
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,30 @@ correct namespace.

.. code-block:: c++

// Implementation inside the LIBC_NAMESPACE namespace.
// Implementation inside the LIBC_NAMESPACE_DECL namespace.
// Correct if:
// - LIBC_NAMESPACE is a macro
// - LIBC_NAMESPACE expansion starts with `__llvm_libc`
namespace LIBC_NAMESPACE {
// - LIBC_NAMESPACE_DECL is a macro
// - LIBC_NAMESPACE_DECL expansion starts with `[[gnu::visibility("hidden")]] __llvm_libc`
namespace LIBC_NAMESPACE_DECL {
void LLVM_LIBC_ENTRYPOINT(strcpy)(char *dest, const char *src) {}
// Namespaces within LIBC_NAMESPACE namespace are allowed.
// Namespaces within LIBC_NAMESPACE_DECL namespace are allowed.
namespace inner {
int localVar = 0;
}
// Functions with C linkage are allowed.
extern "C" void str_fuzz() {}
}

// Incorrect: implementation not in the LIBC_NAMESPACE namespace.
// Incorrect: implementation not in the LIBC_NAMESPACE_DECL namespace.
void LLVM_LIBC_ENTRYPOINT(strcpy)(char *dest, const char *src) {}

// Incorrect: outer most namespace is not the LIBC_NAMESPACE macro.
// Incorrect: outer most namespace is not the LIBC_NAMESPACE_DECL macro.
namespace something_else {
void LLVM_LIBC_ENTRYPOINT(strcpy)(char *dest, const char *src) {}
}

// Incorrect: outer most namespace expansion does not start with `__llvm_libc`.
#define LIBC_NAMESPACE custom_namespace
namespace LIBC_NAMESPACE {
// Incorrect: outer most namespace expansion does not start with `[[gnu::visibility("hidden")]] __llvm_libc`.
#define LIBC_NAMESPACE_DECL custom_namespace
namespace LIBC_NAMESPACE_DECL {
void LLVM_LIBC_ENTRYPOINT(strcpy)(char *dest, const char *src) {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,60 +3,61 @@
#define MACRO_A "defining macros outside namespace is valid"

class ClassB;
// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: declaration must be enclosed within the 'LIBC_NAMESPACE' namespace
// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: declaration must be enclosed within the 'LIBC_NAMESPACE_DECL' namespace
struct StructC {};
// CHECK-MESSAGES: :[[@LINE-1]]:8: warning: declaration must be enclosed within the 'LIBC_NAMESPACE' namespace
char *VarD = MACRO_A;
// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: declaration must be enclosed within the 'LIBC_NAMESPACE' namespace
// CHECK-MESSAGES: :[[@LINE-1]]:8: warning: declaration must be enclosed within the 'LIBC_NAMESPACE_DECL' namespace
const char *VarD = MACRO_A;
// CHECK-MESSAGES: :[[@LINE-1]]:13: warning: declaration must be enclosed within the 'LIBC_NAMESPACE_DECL' namespace
typedef int typeE;
// CHECK-MESSAGES: :[[@LINE-1]]:13: warning: declaration must be enclosed within the 'LIBC_NAMESPACE' namespace
// CHECK-MESSAGES: :[[@LINE-1]]:13: warning: declaration must be enclosed within the 'LIBC_NAMESPACE_DECL' namespace
void funcF() {}
// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: declaration must be enclosed within the 'LIBC_NAMESPACE' namespace
// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: declaration must be enclosed within the 'LIBC_NAMESPACE_DECL' namespace

namespace outer_most {
// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: the outermost namespace should be the 'LIBC_NAMESPACE' macro
// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: the outermost namespace should be the 'LIBC_NAMESPACE_DECL' macro
class A {};
}

// Wrapped in anonymous namespace.
namespace {
// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: declaration must be enclosed within the 'LIBC_NAMESPACE' namespace
// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: declaration must be enclosed within the 'LIBC_NAMESPACE_DECL' namespace
class A {};
}

namespace namespaceG {
// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: the outermost namespace should be the 'LIBC_NAMESPACE' macro
// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: the outermost namespace should be the 'LIBC_NAMESPACE_DECL' macro
namespace __llvm_libc {
namespace namespaceH {
class ClassB;
} // namespace namespaceH
struct StructC {};
} // namespace __llvm_libc
char *VarD = MACRO_A;
const char *VarD = MACRO_A;
typedef int typeE;
void funcF() {}
} // namespace namespaceG

// Wrapped in macro namespace but with an incorrect name
#define LIBC_NAMESPACE custom_namespace
namespace LIBC_NAMESPACE {
// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: the 'LIBC_NAMESPACE' macro should start with '__llvm_libc'
#define LIBC_NAMESPACE_DECL [[gnu::visibility("hidden")]] custom_namespace
namespace LIBC_NAMESPACE_DECL {
// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: the 'LIBC_NAMESPACE_DECL' macro expansion should start with '__llvm_libc'

namespace namespaceH {
class ClassB;
} // namespace namespaceH
} // namespace LIBC_NAMESPACE
} // namespace LIBC_NAMESPACE_DECL


// Wrapped in macro namespace with a valid name, LIBC_NAMESPACE starts with '__llvm_libc'
#undef LIBC_NAMESPACE
#define LIBC_NAMESPACE __llvm_libc_xyz
namespace LIBC_NAMESPACE {
// Wrapped in macro namespace with a valid name, LIBC_NAMESPACE_DECL starts with '__llvm_libc'
#undef LIBC_NAMESPACE_DECL
#define LIBC_NAMESPACE_DECL [[gnu::visibility("hidden")]] __llvm_libc_xyz
namespace LIBC_NAMESPACE_DECL {
namespace namespaceI {
class ClassB;
} // namespace namespaceI
struct StructC {};
char *VarD = MACRO_A;
const char *VarD = MACRO_A;
typedef int typeE;
void funcF() {}
extern "C" void extern_funcJ() {}
} // namespace LIBC_NAMESPACE
} // namespace LIBC_NAMESPACE_DECL
14 changes: 12 additions & 2 deletions clang/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ ABI Changes in This Version
ifuncs. Its purpose was to preserve backwards compatibility when the ".ifunc"
suffix got removed from the name mangling. The alias interacts badly with
GlobalOpt (see the issue #96197).

- Fixed Microsoft name mangling for auto non-type template arguments of pointer
type for MSVC 1920+. This change resolves incompatibilities with code compiled
by MSVC 1920+ but will introduce incompatibilities with code compiled by
Expand Down Expand Up @@ -310,6 +310,9 @@ Resolutions to C++ Defect Reports
- Clang now considers ``noexcept(typeid(expr))`` more carefully, instead of always assuming that ``std::bad_typeid`` can be thrown.
(`CWG2191: Incorrect result for noexcept(typeid(v)) <https://cplusplus.github.io/CWG/issues/2191.html>`_).

- Clang now correctly implements lookup for the terminal name of a member-qualified nested-name-specifier.
(`CWG1835: Dependent member lookup before < <https://cplusplus.github.io/CWG/issues/1835.html>`_).

C Language Changes
------------------

Expand Down Expand Up @@ -592,6 +595,9 @@ Attribute Changes in Clang

Improvements to Clang's diagnostics
-----------------------------------
- Clang now emits an error instead of a warning for ``-Wundefined-internal``
when compiling with `-pedantic-errors` to conform to the C standard

- Clang now applies syntax highlighting to the code snippets it
prints.

Expand Down Expand Up @@ -705,6 +711,8 @@ Improvements to Clang's diagnostics

- For the ARM target, calling an interrupt handler from another function is now an error. #GH95359.

- Clang now diagnoses integer constant expressions that are folded to a constant value as an extension in more circumstances. Fixes #GH59863

Improvements to Clang's time-trace
----------------------------------

Expand Down Expand Up @@ -1003,7 +1011,7 @@ Bug Fixes to C++ Support
- Fixed a type constraint substitution issue involving a generic lambda expression. (#GH93821)
- Fix a crash caused by improper use of ``__array_extent``. (#GH80474)
- Fixed several bugs in capturing variables within unevaluated contexts. (#GH63845), (#GH67260), (#GH69307),
(#GH88081), (#GH89496), (#GH90669) and (#GH91633).
(#GH88081), (#GH89496), (#GH90669), (#GH91633) and (#GH97453).
- Fixed a crash in constraint instantiation under nested lambdas with dependent parameters.
- Fixed handling of brace ellison when building deduction guides. (#GH64625), (#GH83368).
- Clang now instantiates local constexpr functions eagerly for constant evaluators. (#GH35052), (#GH94849)
Expand All @@ -1022,6 +1030,8 @@ Bug Fixes to C++ Support
- Fixed a bug where references to lambda capture inside a ``noexcept`` specifier were not correctly
instantiated. (#GH95735).
- Fixed a CTAD substitution bug involving type aliases that reference outer template parameters. (#GH94614).
- Clang now correctly handles unexpanded packs in the template parameter list of a generic lambda expression
(#GH48937)

Bug Fixes to AST Handling
^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
3 changes: 3 additions & 0 deletions clang/include/clang/AST/ASTContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -1283,6 +1283,9 @@ class ASTContext : public RefCountedBase<ASTContext> {
uint16_t
getPointerAuthVTablePointerDiscriminator(const CXXRecordDecl *RD);

/// Return the "other" type-specific discriminator for the given type.
uint16_t getPointerAuthTypeDiscriminator(QualType T) const;

/// Apply Objective-C protocol qualifiers to the given type.
/// \param allowOnPointerType specifies if we can apply protocol
/// qualifiers on ObjCObjectPointerType. It can be set to true when
Expand Down
Loading