Skip to content

Commit 83b1825

Browse files

File tree

14 files changed

+294
-315
lines changed

14 files changed

+294
-315
lines changed

bolt/lib/Passes/BinaryPasses.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,13 +346,16 @@ void EliminateUnreachableBlocks::runOnFunction(BinaryFunction &Function) {
346346
uint64_t Bytes;
347347
Function.markUnreachableBlocks();
348348
LLVM_DEBUG({
349+
bool HasInvalidBB = false;
349350
for (BinaryBasicBlock &BB : Function) {
350351
if (!BB.isValid()) {
352+
HasInvalidBB = true;
351353
dbgs() << "BOLT-INFO: UCE found unreachable block " << BB.getName()
352354
<< " in function " << Function << "\n";
353-
Function.dump();
354355
}
355356
}
357+
if (HasInvalidBB)
358+
Function.dump();
356359
});
357360
BinaryContext::IndependentCodeEmitter Emitter =
358361
BC.createIndependentMCCodeEmitter();

clang/docs/LanguageExtensions.rst

Lines changed: 38 additions & 38 deletions
Large diffs are not rendered by default.

llvm/docs/CIBestPractices.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,3 +136,20 @@ branches as follows:
136136
branches:
137137
- main
138138
- releases/*
139+
140+
Container Best Practices
141+
========================
142+
143+
This section contains best practices/guidelines when working with containers
144+
for LLVM infrastructure.
145+
146+
Using Fully Qualified Container Names
147+
-------------------------------------
148+
149+
When referencing container images from a registry, such as in Github Actions
150+
workflows, or in ``Dockerfile`` files used for building images, prefer fully
151+
qualified names (i.e., including the registry domain) over just the image.
152+
For example, prefer ``docker.io/ubuntu:24.04`` over ``ubuntu:24.04``. This
153+
ensures portability across systems where a different default registry might
154+
be specified and also prevents attackers from changing the default registry
155+
to pull in a malicious image instead of the intended one.

llvm/include/llvm/ADT/Bitfields.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ template <typename Bitfield, typename StorageType> struct Impl {
100100
using IntegerType = typename Bitfield::IntegerType;
101101

102102
static constexpr size_t StorageBits = sizeof(StorageType) * CHAR_BIT;
103-
static_assert(Bitfield::FirstBit <= StorageBits, "Data must fit in mask");
104-
static_assert(Bitfield::LastBit <= StorageBits, "Data must fit in mask");
103+
static_assert(Bitfield::FirstBit < StorageBits, "Data must fit in mask");
104+
static_assert(Bitfield::LastBit < StorageBits, "Data must fit in mask");
105105
static constexpr StorageType LowMask =
106106
maskTrailingOnes<StorageType>(Bitfield::Bits);
107107
static constexpr StorageType Mask = LowMask << Bitfield::Shift;

llvm/include/llvm/ADT/ConcurrentHashtable.h

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ class ConcurrentHashTableByPtr {
177177

178178
#if LLVM_ENABLE_THREADS
179179
// Lock bucket.
180-
CurBucket.Guard.lock();
180+
std::scoped_lock<std::mutex> Lock(CurBucket.Guard);
181181
#endif
182182

183183
HashesPtr BucketHashes = CurBucket.Hashes;
@@ -195,11 +195,6 @@ class ConcurrentHashTableByPtr {
195195

196196
CurBucket.NumberOfEntries++;
197197
RehashBucket(CurBucket);
198-
199-
#if LLVM_ENABLE_THREADS
200-
CurBucket.Guard.unlock();
201-
#endif
202-
203198
return {NewData, true};
204199
}
205200

@@ -208,10 +203,6 @@ class ConcurrentHashTableByPtr {
208203
KeyDataTy *EntryData = BucketEntries[CurEntryIdx];
209204
if (Info::isEqual(Info::getKey(*EntryData), NewValue)) {
210205
// Already existed entry matched with inserted data is found.
211-
#if LLVM_ENABLE_THREADS
212-
CurBucket.Guard.unlock();
213-
#endif
214-
215206
return {EntryData, false};
216207
}
217208
}

0 commit comments

Comments
 (0)