Skip to content

Commit 4613265

Browse files
authored
Merge branch 'main' into loop-vectorize/evl-VPWidenPointerInductionRecipe
2 parents 4b31963 + dace67e commit 4613265

File tree

92 files changed

+3399
-1019
lines changed

Some content is hidden

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

92 files changed

+3399
-1019
lines changed

.github/workflows/libcxx-build-and-test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,11 +260,11 @@ jobs:
260260
- name: Install a current LLVM
261261
if: ${{ matrix.mingw != true }}
262262
run: |
263-
choco install -y llvm --version=19.1.7 --allow-downgrade
263+
choco install -y llvm --version=20.1.8 --allow-downgrade
264264
- name: Install llvm-mingw
265265
if: ${{ matrix.mingw == true }}
266266
run: |
267-
curl -LO https://github.com/mstorsjo/llvm-mingw/releases/download/20250114/llvm-mingw-20250114-ucrt-x86_64.zip
267+
curl -LO https://github.com/mstorsjo/llvm-mingw/releases/download/20250709/llvm-mingw-20250709-ucrt-x86_64.zip
268268
powershell Expand-Archive llvm-mingw*.zip -DestinationPath .
269269
del llvm-mingw*.zip
270270
mv llvm-mingw* c:\llvm-mingw

clang/lib/AST/ByteCode/Compiler.cpp

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5997,6 +5997,23 @@ bool Compiler<Emitter>::checkLiteralType(const Expr *E) {
59975997
return this->emitCheckLiteralType(E->getType().getTypePtr(), E);
59985998
}
59995999

6000+
static bool initNeedsOverridenLoc(const CXXCtorInitializer *Init) {
6001+
const Expr *InitExpr = Init->getInit();
6002+
6003+
if (!Init->isWritten() && !Init->isInClassMemberInitializer() &&
6004+
!isa<CXXConstructExpr>(InitExpr))
6005+
return true;
6006+
6007+
if (const auto *CE = dyn_cast<CXXConstructExpr>(InitExpr)) {
6008+
const CXXConstructorDecl *Ctor = CE->getConstructor();
6009+
if (Ctor->isDefaulted() && Ctor->isCopyOrMoveConstructor() &&
6010+
Ctor->isTrivial())
6011+
return true;
6012+
}
6013+
6014+
return false;
6015+
}
6016+
60006017
template <class Emitter>
60016018
bool Compiler<Emitter>::compileConstructor(const CXXConstructorDecl *Ctor) {
60026019
assert(!ReturnType);
@@ -6071,10 +6088,7 @@ bool Compiler<Emitter>::compileConstructor(const CXXConstructorDecl *Ctor) {
60716088
const Record::Field *F = R->getField(Member);
60726089

60736090
LocOverrideScope<Emitter> LOS(this, SourceInfo{},
6074-
!Init->isWritten() &&
6075-
!Init->isInClassMemberInitializer() &&
6076-
(!isa<CXXConstructExpr>(InitExpr) ||
6077-
Member->isAnonymousStructOrUnion()));
6091+
initNeedsOverridenLoc(Init));
60786092
if (!emitFieldInitializer(F, F->Offset, InitExpr, IsUnion))
60796093
return false;
60806094
} else if (const Type *Base = Init->getBaseClass()) {
@@ -6104,10 +6118,7 @@ bool Compiler<Emitter>::compileConstructor(const CXXConstructorDecl *Ctor) {
61046118
return false;
61056119
} else if (const IndirectFieldDecl *IFD = Init->getIndirectMember()) {
61066120
LocOverrideScope<Emitter> LOS(this, SourceInfo{},
6107-
!Init->isWritten() &&
6108-
!Init->isInClassMemberInitializer() &&
6109-
!isa<CXXConstructExpr>(InitExpr));
6110-
6121+
initNeedsOverridenLoc(Init));
61116122
assert(IFD->getChainingSize() >= 2);
61126123

61136124
unsigned NestedFieldOffset = 0;

clang/lib/AST/ByteCode/InterpFrame.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,11 @@ static bool shouldSkipInBacktrace(const Function *F) {
133133
MD && MD->getParent()->isAnonymousStructOrUnion())
134134
return true;
135135

136+
if (const auto *Ctor = dyn_cast<CXXConstructorDecl>(FD);
137+
Ctor && Ctor->isDefaulted() && Ctor->isTrivial() &&
138+
Ctor->isCopyOrMoveConstructor() && Ctor->inits().empty())
139+
return true;
140+
136141
return false;
137142
}
138143

clang/test/AST/ByteCode/cxx11.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,3 +318,15 @@ namespace PR19010 {
318318
};
319319
void test() { constexpr Test t; }
320320
}
321+
322+
namespace ReadMutableInCopyCtor {
323+
struct G {
324+
struct X {};
325+
union U { X a; };
326+
mutable U u; // both-note {{declared here}}
327+
};
328+
constexpr G g1 = {};
329+
constexpr G g2 = g1; // both-error {{must be initialized by a constant expression}} \
330+
// both-note {{read of mutable member 'u'}} \
331+
// both-note {{in call to 'G(g1)'}}
332+
}

clang/test/SemaCXX/constexpr-value-init.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// RUN: %clang_cc1 %s -Wno-uninitialized -std=c++17 -fsyntax-only -verify
2+
// RUN: %clang_cc1 %s -Wno-uninitialized -std=c++17 -fsyntax-only -verify -fexperimental-new-constant-interpreter
23

34
struct A {
45
constexpr A() : a(b + 1), b(a + 1) {} // expected-note 5{{outside its lifetime}}

compiler-rt/test/sanitizer_common/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,10 @@ foreach(tool ${SUPPORTED_TOOLS})
8989
${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg.py)
9090
# FIXME(dliew): LSan i386 on Darwin is completely broken right now.
9191
# so don't run the tests by default.
92+
# Tests fail on arm64, see https://github.com/llvm/llvm-project/issues/131678
9293
if (NOT (CMAKE_SYSTEM_NAME MATCHES "Darwin" AND
9394
${tool} STREQUAL "lsan" AND
94-
${arch} STREQUAL "i386"))
95+
(${arch} STREQUAL "i386" OR ${arch} MATCHES "arm64")))
9596
list(APPEND SANITIZER_COMMON_TESTSUITES
9697
${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME})
9798
endif()

lldb/include/lldb/Utility/Scalar.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,15 @@ class Scalar {
8484
/// Store the binary representation of this value into the given storage.
8585
/// Exactly GetByteSize() bytes will be stored, and the buffer must be large
8686
/// enough to hold this data.
87+
void GetBytes(uint8_t *storage, size_t length) const;
8788
void GetBytes(llvm::MutableArrayRef<uint8_t> storage) const;
8889

8990
size_t GetByteSize() const;
9091

91-
bool GetData(DataExtractor &data, size_t limit_byte_size = UINT32_MAX) const;
92+
/// Get data with a byte size of GetByteSize().
93+
bool GetData(DataExtractor &data) const;
94+
/// Get data with a byte size forced to \p result_byte_size.
95+
bool GetData(DataExtractor &data, size_t result_byte_size) const;
9296

9397
size_t GetAsMemoryData(void *dst, size_t dst_len,
9498
lldb::ByteOrder dst_byte_order, Status &error) const;

lldb/include/lldb/ValueObject/ValueObject.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,12 @@ class ValueObject {
737737
CreateValueObjectFromAPFloat(lldb::TargetSP target, const llvm::APFloat &v,
738738
CompilerType type, llvm::StringRef name);
739739

740+
/// Create a value object containing the given Scalar value.
741+
static lldb::ValueObjectSP CreateValueObjectFromScalar(lldb::TargetSP target,
742+
Scalar &s,
743+
CompilerType type,
744+
llvm::StringRef name);
745+
740746
/// Create a value object containing the given boolean value.
741747
static lldb::ValueObjectSP CreateValueObjectFromBool(lldb::TargetSP target,
742748
bool value,

lldb/include/lldb/ValueObject/ValueObjectConstResult.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ class ValueObjectConstResult : public ValueObject {
6060
Value &value, ConstString name,
6161
Module *module = nullptr);
6262

63+
static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope,
64+
const CompilerType &compiler_type,
65+
Scalar &scalar, ConstString name,
66+
Module *module = nullptr);
67+
6368
// When an expression fails to evaluate, we return an error
6469
static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope,
6570
Status &&error);
@@ -145,6 +150,12 @@ class ValueObjectConstResult : public ValueObject {
145150
ValueObjectManager &manager, const Value &value,
146151
ConstString name, Module *module = nullptr);
147152

153+
ValueObjectConstResult(ExecutionContextScope *exe_scope,
154+
ValueObjectManager &manager,
155+
const CompilerType &compiler_type,
156+
const Scalar &scalar, ConstString name,
157+
Module *module = nullptr);
158+
148159
ValueObjectConstResult(ExecutionContextScope *exe_scope,
149160
ValueObjectManager &manager, Status &&error);
150161

lldb/source/Core/Value.cpp

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -347,15 +347,9 @@ Status Value::GetValueAsData(ExecutionContext *exe_ctx, DataExtractor &data,
347347
else
348348
data.SetAddressByteSize(sizeof(void *));
349349

350-
uint32_t limit_byte_size = UINT32_MAX;
351-
352-
if (type_size)
353-
limit_byte_size = *type_size;
354-
355-
if (limit_byte_size <= m_value.GetByteSize()) {
356-
if (m_value.GetData(data, limit_byte_size))
357-
return error; // Success;
358-
}
350+
uint32_t result_byte_size = *type_size;
351+
if (m_value.GetData(data, result_byte_size))
352+
return error; // Success;
359353

360354
error = Status::FromErrorString("extracting data from value failed");
361355
break;

0 commit comments

Comments
 (0)