Skip to content

Commit 68ba962

Browse files
author
iclsrc
committed
Merge from 'master' to 'sycl-web'
2 parents ad6db56 + dd3ba72 commit 68ba962

File tree

842 files changed

+19298
-10673
lines changed

Some content is hidden

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

842 files changed

+19298
-10673
lines changed

clang-tools-extra/test/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,7 @@ add_lit_testsuite(check-clang-tools "Running the Clang extra tools' regression t
9090
)
9191

9292
set_target_properties(check-clang-tools PROPERTIES FOLDER "Clang extra tools' tests")
93+
94+
add_lit_testsuites(CLANG-EXTRA ${CMAKE_CURRENT_SOURCE_DIR}
95+
DEPENDS ${CLANG_TOOLS_TEST_DEPS}
96+
)

clang/docs/SourceBasedCodeCoverage.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ directory structure will be created. Additionally, the following special
7979

8080
* "%h" expands out to the hostname of the machine running the program.
8181

82+
* "%t" expands out to the value of the ``TMPDIR`` environment variable. On
83+
Darwin, this is typically set to a temporary scratch directory.
84+
8285
* "%Nm" expands out to the instrumented binary's signature. When this pattern
8386
is specified, the runtime creates a pool of N raw profiles which are used for
8487
on-line profile merging. The runtime takes care of selecting a raw profile

clang/docs/ThreadSafetyAnalysis.rst

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,9 @@ and data members. Users are *strongly advised* to define macros for the various
144144
attributes; example definitions can be found in :ref:`mutexheader`, below.
145145
The following documentation assumes the use of macros.
146146

147+
The attributes only control assumptions made by thread safety analysis and the
148+
warnings it issues. They don't affect generated code or behavior at run-time.
149+
147150
For historical reasons, prior versions of thread safety used macro names that
148151
were very lock-centric. These macros have since been renamed to fit a more
149152
general capability model. The prior names are still in use, and will be
@@ -447,10 +450,11 @@ ASSERT_CAPABILITY(...) and ASSERT_SHARED_CAPABILITY(...)
447450

448451
*Previously:* ``ASSERT_EXCLUSIVE_LOCK``, ``ASSERT_SHARED_LOCK``
449452

450-
These are attributes on a function or method that does a run-time test to see
451-
whether the calling thread holds the given capability. The function is assumed
452-
to fail (no return) if the capability is not held. See :ref:`mutexheader`,
453-
below, for example uses.
453+
These are attributes on a function or method which asserts the calling thread
454+
already holds the given capability, for example by performing a run-time test
455+
and terminating if the capability is not held. Presence of this annotation
456+
causes the analysis to assume the capability is held after calls to the
457+
annotated function. See :ref:`mutexheader`, below, for example uses.
454458

455459

456460
GUARDED_VAR and PT_GUARDED_VAR

clang/include/clang/AST/APValue.h

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "llvm/ADT/APSInt.h"
2020
#include "llvm/ADT/PointerIntPair.h"
2121
#include "llvm/ADT/PointerUnion.h"
22+
#include "llvm/ADT/FoldingSet.h"
2223

2324
namespace clang {
2425
class AddrLabelExpr;
@@ -149,6 +150,8 @@ class APValue {
149150
static LValueBase getDynamicAlloc(DynamicAllocLValue LV, QualType Type);
150151
static LValueBase getTypeInfo(TypeInfoLValue LV, QualType TypeInfo);
151152

153+
void profile(llvm::FoldingSetNodeID &ID) const;
154+
152155
template <class T>
153156
bool is() const { return Ptr.is<T>(); }
154157

@@ -174,6 +177,7 @@ class APValue {
174177
return !(LHS == RHS);
175178
}
176179
friend llvm::hash_code hash_value(const LValueBase &Base);
180+
friend struct llvm::DenseMapInfo<LValueBase>;
177181

178182
private:
179183
PtrTy Ptr;
@@ -201,8 +205,7 @@ class APValue {
201205

202206
public:
203207
LValuePathEntry() : Value() {}
204-
LValuePathEntry(BaseOrMemberType BaseOrMember)
205-
: Value{reinterpret_cast<uintptr_t>(BaseOrMember.getOpaqueValue())} {}
208+
LValuePathEntry(BaseOrMemberType BaseOrMember);
206209
static LValuePathEntry ArrayIndex(uint64_t Index) {
207210
LValuePathEntry Result;
208211
Result.Value = Index;
@@ -215,6 +218,8 @@ class APValue {
215218
}
216219
uint64_t getAsArrayIndex() const { return Value; }
217220

221+
void profile(llvm::FoldingSetNodeID &ID) const;
222+
218223
friend bool operator==(LValuePathEntry A, LValuePathEntry B) {
219224
return A.Value == B.Value;
220225
}
@@ -357,6 +362,11 @@ class APValue {
357362
/// Swaps the contents of this and the given APValue.
358363
void swap(APValue &RHS);
359364

365+
/// Profile this value. There is no guarantee that values of different
366+
/// types will not produce the same profiled value, so the type should
367+
/// typically also be profiled if it's not implied by the context.
368+
void profile(llvm::FoldingSetNodeID &ID) const;
369+
360370
ValueKind getKind() const { return Kind; }
361371

362372
bool isAbsent() const { return Kind == None; }

clang/include/clang/AST/ASTContext.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3069,9 +3069,8 @@ OPT_LIST(V)
30693069
};
30703070

30713071
/// Insertion operator for diagnostics.
3072-
const StreamableDiagnosticBase &
3073-
operator<<(const StreamableDiagnosticBase &DB,
3074-
const ASTContext::SectionInfo &Section);
3072+
const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB,
3073+
const ASTContext::SectionInfo &Section);
30753074

30763075
/// Utility function for constructing a nullary selector.
30773076
inline Selector GetNullarySelector(StringRef name, ASTContext &Ctx) {

clang/include/clang/AST/Attr.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,12 +351,19 @@ struct ParsedTargetAttr {
351351

352352
#include "clang/AST/Attrs.inc"
353353

354-
inline const StreamableDiagnosticBase &
355-
operator<<(const StreamableDiagnosticBase &DB, const Attr *At) {
354+
inline const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB,
355+
const Attr *At) {
356356
DB.AddTaggedVal(reinterpret_cast<intptr_t>(At),
357357
DiagnosticsEngine::ak_attr);
358358
return DB;
359359
}
360+
361+
inline const PartialDiagnostic &operator<<(const PartialDiagnostic &PD,
362+
const Attr *At) {
363+
PD.AddTaggedVal(reinterpret_cast<intptr_t>(At),
364+
DiagnosticsEngine::ak_attr);
365+
return PD;
366+
}
360367
} // end namespace clang
361368

362369
#endif

clang/include/clang/AST/CanonicalType.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,8 @@ inline CanQualType Type::getCanonicalTypeUnqualified() const {
215215
return CanQualType::CreateUnsafe(getCanonicalTypeInternal());
216216
}
217217

218-
inline const StreamableDiagnosticBase &
219-
operator<<(const StreamableDiagnosticBase &DB, CanQualType T) {
218+
inline const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB,
219+
CanQualType T) {
220220
DB << static_cast<QualType>(T);
221221
return DB;
222222
}

clang/include/clang/AST/Decl.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4514,8 +4514,14 @@ class EmptyDecl : public Decl {
45144514

45154515
/// Insertion operator for diagnostics. This allows sending NamedDecl's
45164516
/// into a diagnostic with <<.
4517-
inline const StreamableDiagnosticBase &
4518-
operator<<(const StreamableDiagnosticBase &PD, const NamedDecl *ND) {
4517+
inline const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB,
4518+
const NamedDecl* ND) {
4519+
DB.AddTaggedVal(reinterpret_cast<intptr_t>(ND),
4520+
DiagnosticsEngine::ak_nameddecl);
4521+
return DB;
4522+
}
4523+
inline const PartialDiagnostic &operator<<(const PartialDiagnostic &PD,
4524+
const NamedDecl* ND) {
45194525
PD.AddTaggedVal(reinterpret_cast<intptr_t>(ND),
45204526
DiagnosticsEngine::ak_nameddecl);
45214527
return PD;

clang/include/clang/AST/DeclCXX.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4075,8 +4075,11 @@ class MSGuidDecl : public ValueDecl,
40754075

40764076
/// Insertion operator for diagnostics. This allows sending an AccessSpecifier
40774077
/// into a diagnostic with <<.
4078-
const StreamableDiagnosticBase &operator<<(const StreamableDiagnosticBase &DB,
4079-
AccessSpecifier AS);
4078+
const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB,
4079+
AccessSpecifier AS);
4080+
4081+
const PartialDiagnostic &operator<<(const PartialDiagnostic &DB,
4082+
AccessSpecifier AS);
40804083

40814084
} // namespace clang
40824085

clang/include/clang/AST/DeclarationName.h

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -811,10 +811,19 @@ struct DeclarationNameInfo {
811811
SourceLocation getEndLocPrivate() const;
812812
};
813813

814+
/// Insertion operator for diagnostics. This allows sending DeclarationName's
815+
/// into a diagnostic with <<.
816+
inline const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB,
817+
DeclarationName N) {
818+
DB.AddTaggedVal(N.getAsOpaqueInteger(),
819+
DiagnosticsEngine::ak_declarationname);
820+
return DB;
821+
}
822+
814823
/// Insertion operator for partial diagnostics. This allows binding
815824
/// DeclarationName's into a partial diagnostic with <<.
816-
inline const StreamableDiagnosticBase &
817-
operator<<(const StreamableDiagnosticBase &PD, DeclarationName N) {
825+
inline const PartialDiagnostic &operator<<(const PartialDiagnostic &PD,
826+
DeclarationName N) {
818827
PD.AddTaggedVal(N.getAsOpaqueInteger(),
819828
DiagnosticsEngine::ak_declarationname);
820829
return PD;

0 commit comments

Comments
 (0)