Skip to content

Commit 021dde8

Browse files
Merge branch 'main' into main
2 parents 3e5d282 + 1a32613 commit 021dde8

File tree

305 files changed

+6782
-3328
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

305 files changed

+6782
-3328
lines changed

bolt/lib/Rewrite/PseudoProbeRewriter.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ void PseudoProbeRewriter::parsePseudoProbe(bool ProfiledOnly) {
147147
if (!Name)
148148
continue;
149149
SymName = *Name;
150-
uint64_t GUID = Function::getGUID(SymName);
150+
uint64_t GUID = Function::getGUIDAssumingExternalLinkage(SymName);
151151
FuncStartAddrs[GUID] = F->getAddress();
152152
if (ProfiledOnly && HasProfile)
153153
GuidFilter.insert(GUID);
@@ -173,7 +173,7 @@ void PseudoProbeRewriter::parsePseudoProbe(bool ProfiledOnly) {
173173
const GUIDProbeFunctionMap &GUID2Func = ProbeDecoder.getGUID2FuncDescMap();
174174
// Checks GUID in GUID2Func and returns it if it's present or null otherwise.
175175
auto checkGUID = [&](StringRef SymName) -> uint64_t {
176-
uint64_t GUID = Function::getGUID(SymName);
176+
uint64_t GUID = Function::getGUIDAssumingExternalLinkage(SymName);
177177
if (GUID2Func.find(GUID) == GUID2Func.end())
178178
return 0;
179179
return GUID;
@@ -435,7 +435,7 @@ void PseudoProbeRewriter::encodePseudoProbes() {
435435
for (const BinaryFunction *F : BC.getAllBinaryFunctions()) {
436436
const uint64_t Addr =
437437
F->isEmitted() ? F->getOutputAddress() : F->getAddress();
438-
FuncStartAddrs[Function::getGUID(
438+
FuncStartAddrs[Function::getGUIDAssumingExternalLinkage(
439439
NameResolver::restore(F->getOneName()))] = Addr;
440440
}
441441
DummyDecoder.buildAddress2ProbeMap(

clang/docs/ReleaseNotes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,7 @@ Bug Fixes in This Version
470470
- Fixed a crash when ``#embed`` appears as a part of a failed constant
471471
evaluation. The crashes were happening during diagnostics emission due to
472472
unimplemented statement printer. (#GH132641)
473+
- Fixed visibility calculation for template functions. (#GH103477)
473474

474475
Bug Fixes to Compiler Builtins
475476
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

clang/include/clang/AST/OperationKinds.def

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ CAST_OPERATION(ArrayToPointerDecay)
119119
CAST_OPERATION(FunctionToPointerDecay)
120120

121121
/// CK_NullToPointer - Null pointer constant to pointer, ObjC
122-
/// pointer, or block pointer.
122+
/// pointer, or block pointer. The result of this conversion can
123+
/// still be a null pointer constant if it has type std::nullptr_t.
123124
/// (void*) 0
124125
/// void (^block)() = 0;
125126
CAST_OPERATION(NullToPointer)

clang/include/clang/ASTMatchers/ASTMatchersInternal.h

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -871,30 +871,19 @@ IteratorT matchesFirstInPointerRange(const MatcherT &Matcher, IteratorT Start,
871871
return End;
872872
}
873873

874-
template <typename T, std::enable_if_t<!std::is_base_of<FunctionDecl, T>::value>
875-
* = nullptr>
876-
inline bool isDefaultedHelper(const T *) {
874+
template <typename T> inline bool isDefaultedHelper(const T *FD) {
875+
if constexpr (std::is_base_of_v<FunctionDecl, T>)
876+
return FD->isDefaulted();
877877
return false;
878878
}
879-
inline bool isDefaultedHelper(const FunctionDecl *FD) {
880-
return FD->isDefaulted();
881-
}
882879

883880
// Metafunction to determine if type T has a member called getDecl.
884-
template <typename Ty>
885-
class has_getDecl {
886-
using yes = char[1];
887-
using no = char[2];
888-
889-
template <typename Inner>
890-
static yes& test(Inner *I, decltype(I->getDecl()) * = nullptr);
891-
892-
template <typename>
893-
static no& test(...);
881+
template <typename T>
882+
using check_has_getDecl = decltype(std::declval<T &>().getDecl());
894883

895-
public:
896-
static const bool value = sizeof(test<Ty>(nullptr)) == sizeof(yes);
897-
};
884+
template <typename T>
885+
static constexpr bool has_getDecl =
886+
llvm::is_detected<check_has_getDecl, T>::value;
898887

899888
/// Matches overloaded operators with a specific name.
900889
///

0 commit comments

Comments
 (0)