Skip to content

Commit e0f0a5b

Browse files
authored
Merge branch 'main' into cindex-language
2 parents 2ede2bf + 8b44945 commit e0f0a5b

File tree

7 files changed

+14
-66
lines changed

7 files changed

+14
-66
lines changed

compiler-rt/lib/asan/asan_flags.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,6 @@ void InitializeFlags() {
241241
InitializeDefaultFlags();
242242
ProcessFlags();
243243
ApplyFlags();
244-
if (!common_flags()->symbolize)
245-
Symbolizer::ClearTools();
246244
});
247245

248246
# if CAN_SANITIZE_UB

compiler-rt/lib/sanitizer_common/sanitizer_symbolizer.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,6 @@ class Symbolizer final {
136136
/// (if it wasn't already initialized).
137137
static Symbolizer *GetOrInit();
138138
static void LateInitialize();
139-
static void ClearTools();
140-
141139
// Returns a list of symbolized frames for a given address (containing
142140
// all inlined functions, if necessary).
143141
SymbolizedStack *SymbolizePC(uptr address);

compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_libcdep.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,6 @@ Symbolizer *Symbolizer::GetOrInit() {
2626
return symbolizer_;
2727
}
2828

29-
// If the 'symbolize' flag is set to 0, it clears the tools
30-
// associated with the symbolizer to prevent unnecessary symbolization and
31-
// resource usage. This is necessary because of the late binding of the
32-
// overridden method, __asan_default_options().
33-
void Symbolizer::ClearTools() {
34-
SpinMutexLock l(&init_mu_);
35-
if (symbolizer_)
36-
symbolizer_->tools_.clear();
37-
}
38-
3929
// See sanitizer_symbolizer_markup.cpp.
4030
#if !SANITIZER_SYMBOLIZER_MARKUP
4131

compiler-rt/test/asan/TestCases/Windows/symbolize.cpp

Lines changed: 0 additions & 38 deletions
This file was deleted.

llvm/include/llvm/ADT/SmallPtrSet.h

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,10 @@ class SmallPtrSetImplBase : public DebugEpochBase {
156156
return {CurArray, CurArray + NumNonEmpty};
157157
}
158158

159+
iterator_range<const void **> buckets() {
160+
return make_range(CurArray, EndPointer());
161+
}
162+
159163
/// insert_imp - This returns true if the pointer was new to the set, false if
160164
/// it was already in the set. This is hidden from the client so that the
161165
/// derived class can check that the right type of pointer is passed in.
@@ -441,13 +445,12 @@ class SmallPtrSetImpl : public SmallPtrSetImplBase {
441445
return Removed;
442446
}
443447

444-
for (const void **APtr = CurArray, **E = EndPointer(); APtr != E; ++APtr) {
445-
const void *Value = *APtr;
446-
if (Value == getTombstoneMarker() || Value == getEmptyMarker())
448+
for (const void *&Bucket : buckets()) {
449+
if (Bucket == getTombstoneMarker() || Bucket == getEmptyMarker())
447450
continue;
448-
PtrType Ptr = PtrTraits::getFromVoidPointer(const_cast<void *>(Value));
451+
PtrType Ptr = PtrTraits::getFromVoidPointer(const_cast<void *>(Bucket));
449452
if (P(Ptr)) {
450-
*APtr = getTombstoneMarker();
453+
Bucket = getTombstoneMarker();
451454
++NumTombstones;
452455
incrementEpoch();
453456
Removed = true;

llvm/lib/Analysis/Loads.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,7 @@ static bool AreEquivalentAddressValues(const Value *A, const Value *B) {
276276
// this function is only used when one address use dominates the
277277
// other, which means that they'll always either have the same
278278
// value or one of them will have an undefined value.
279-
if (isa<BinaryOperator>(A) || isa<CastInst>(A) || isa<PHINode>(A) ||
280-
isa<GetElementPtrInst>(A))
279+
if (isa<CastInst>(A) || isa<PHINode>(A) || isa<GetElementPtrInst>(A))
281280
if (const Instruction *BI = dyn_cast<Instruction>(B))
282281
if (cast<Instruction>(A)->isIdenticalToWhenDefined(BI))
283282
return true;

llvm/lib/Support/SmallPtrSet.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,7 @@ const void *const *SmallPtrSetImplBase::FindBucketFor(const void *Ptr) const {
110110
/// Grow - Allocate a larger backing store for the buckets and move it over.
111111
///
112112
void SmallPtrSetImplBase::Grow(unsigned NewSize) {
113-
const void **OldBuckets = CurArray;
114-
const void **OldEnd = EndPointer();
113+
auto OldBuckets = buckets();
115114
bool WasSmall = isSmall();
116115

117116
// Install the new array. Clear all the buckets to empty.
@@ -123,15 +122,14 @@ void SmallPtrSetImplBase::Grow(unsigned NewSize) {
123122
memset(CurArray, -1, NewSize*sizeof(void*));
124123

125124
// Copy over all valid entries.
126-
for (const void **BucketPtr = OldBuckets; BucketPtr != OldEnd; ++BucketPtr) {
125+
for (const void *&Bucket : OldBuckets) {
127126
// Copy over the element if it is valid.
128-
const void *Elt = *BucketPtr;
129-
if (Elt != getTombstoneMarker() && Elt != getEmptyMarker())
130-
*const_cast<void**>(FindBucketFor(Elt)) = const_cast<void*>(Elt);
127+
if (Bucket != getTombstoneMarker() && Bucket != getEmptyMarker())
128+
*const_cast<void **>(FindBucketFor(Bucket)) = const_cast<void *>(Bucket);
131129
}
132130

133131
if (!WasSmall)
134-
free(OldBuckets);
132+
free(OldBuckets.begin());
135133
NumNonEmpty -= NumTombstones;
136134
NumTombstones = 0;
137135
IsSmall = false;

0 commit comments

Comments
 (0)