Skip to content

Commit 243aca7

Browse files
committed
merge main into amd-staging
2 parents 18e4417 + 9e6fc8d commit 243aca7

File tree

35 files changed

+298
-399
lines changed

35 files changed

+298
-399
lines changed

clang/lib/Sema/SemaInit.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6410,9 +6410,9 @@ static bool TryOCLSamplerInitialization(Sema &S,
64106410
return true;
64116411
}
64126412

6413-
static bool IsZeroInitializer(Expr *Initializer, Sema &S) {
6414-
return Initializer->isIntegerConstantExpr(S.getASTContext()) &&
6415-
(Initializer->EvaluateKnownConstInt(S.getASTContext()) == 0);
6413+
static bool IsZeroInitializer(const Expr *Init, ASTContext &Ctx) {
6414+
std::optional<llvm::APSInt> Value = Init->getIntegerConstantExpr(Ctx);
6415+
return Value && Value->isZero();
64166416
}
64176417

64186418
static bool TryOCLZeroOpaqueTypeInitialization(Sema &S,
@@ -6431,7 +6431,7 @@ static bool TryOCLZeroOpaqueTypeInitialization(Sema &S,
64316431
// event should be zero.
64326432
//
64336433
if (DestType->isEventT() || DestType->isQueueT()) {
6434-
if (!IsZeroInitializer(Initializer, S))
6434+
if (!IsZeroInitializer(Initializer, S.getASTContext()))
64356435
return false;
64366436

64376437
Sequence.AddOCLZeroOpaqueTypeStep(DestType);
@@ -6447,7 +6447,7 @@ static bool TryOCLZeroOpaqueTypeInitialization(Sema &S,
64476447
if (DestType->isOCLIntelSubgroupAVCMcePayloadType() ||
64486448
DestType->isOCLIntelSubgroupAVCMceResultType())
64496449
return false;
6450-
if (!IsZeroInitializer(Initializer, S))
6450+
if (!IsZeroInitializer(Initializer, S.getASTContext()))
64516451
return false;
64526452

64536453
Sequence.AddOCLZeroOpaqueTypeStep(DestType);

clang/test/Driver/cl-x86-flags.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -138,14 +138,14 @@ void f(void) {
138138
}
139139

140140

141-
// RUN: not %clang_cl -### --target=i386 -mapx-features=ndd %s 2>&1 | FileCheck --check-prefix=NON-APX %s
142-
// RUN: not %clang_cl -### --target=i386 -mapxf %s 2>&1 | FileCheck --check-prefix=NON-APX %s
143-
// RUN: %clang_cl -### --target=i386 -mno-apxf %s 2>&1 > /dev/null
144-
// NON-APX: error: unsupported option '-mapx-features=|-mapxf' for target 'i386'
141+
// RUN: not %clang_cl -### --target=i386-pc-windows -mapx-features=ndd -- 2>&1 %s | FileCheck --check-prefix=NON-APX %s
142+
// RUN: not %clang_cl -### --target=i386-pc-windows -mapxf -- 2>&1 %s | FileCheck --check-prefix=NON-APX %s
143+
// RUN: %clang_cl -### --target=i386-pc-windows -mno-apxf -- 2>&1 %s > /dev/null
144+
// NON-APX: error: unsupported option '-mapx-features=|-mapxf' for target 'i386-pc-windows{{.*}}'
145145
// NON-APX-NOT: error: {{.*}} -mapx-features=
146146

147-
// RUN: %clang_cl --target=x86_64-pc-windows -mapxf %s -### 2>&1 | FileCheck -check-prefix=APXF %s
148-
// RUN: %clang_cl --target=x86_64-pc-windows -mapxf -mno-apxf %s -### 2>&1 | FileCheck -check-prefix=NO-APXF %s
149-
// RUN: %clang_cl --target=x86_64-pc-windows -mapx-features=egpr,push2pop2,ppx,ndd,ccmp,nf,cf,zu %s -### 2>&1 | FileCheck -check-prefix=APXF %s
147+
// RUN: %clang_cl --target=x86_64-pc-windows -mapxf -### -- 2>&1 %s | FileCheck -check-prefix=APXF %s
148+
// RUN: %clang_cl --target=x86_64-pc-windows -mapxf -mno-apxf -### -- 2>&1 %s | FileCheck -check-prefix=NO-APXF %s
149+
// RUN: %clang_cl --target=x86_64-pc-windows -mapx-features=egpr,push2pop2,ppx,ndd,ccmp,nf,cf,zu -### -- 2>&1 %s | FileCheck -check-prefix=APXF %s
150150
// APXF: "-target-feature" "+egpr" "-target-feature" "+push2pop2" "-target-feature" "+ppx" "-target-feature" "+ndd" "-target-feature" "+ccmp" "-target-feature" "+nf" "-target-feature" "+cf" "-target-feature" "+zu"
151151
// NO-APXF: "-target-feature" "-egpr" "-target-feature" "-push2pop2" "-target-feature" "-ppx" "-target-feature" "-ndd" "-target-feature" "-ccmp" "-target-feature" "-nf" "-target-feature" "-cf" "-target-feature" "-zu"

lldb/tools/lldb-dap/Protocol/ProtocolTypes.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -677,6 +677,8 @@ struct DisassembledInstruction {
677677
/// addresses may be presented is 'invalid.'
678678
/// Values: 'normal', 'invalid'
679679
std::optional<PresentationHint> presentationHint;
680+
681+
DisassembledInstruction() : address(0) {}
680682
};
681683
bool fromJSON(const llvm::json::Value &,
682684
DisassembledInstruction::PresentationHint &, llvm::json::Path);

llvm/include/llvm/ExecutionEngine/Orc/COFFPlatform.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,6 @@ class COFFPlatform : public Platform {
202202

203203
DenseMap<JITDylib *, SymbolLookupSet> RegisteredInitSymbols;
204204

205-
std::set<std::string> DylibsToPreload;
206-
207205
std::mutex PlatformMutex;
208206
};
209207

llvm/include/llvm/ExecutionEngine/Orc/LoadLinkableFile.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ namespace orc {
2727

2828
enum class LinkableFileKind { Archive, RelocatableObject };
2929

30-
enum LoadArchives {
30+
enum class LoadArchives {
3131
Never, // Linkable file must not be an archive.
3232
Allowed, // Linkable file is allowed to be an archive.
3333
Required // Linkable file is required to be an archive.

llvm/include/llvm/MC/MCContext.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,11 @@ class MCContext {
495495
/// Get the symbol for \p Name, or null.
496496
MCSymbol *lookupSymbol(const Twine &Name) const;
497497

498+
/// Clone a symbol for the .set directive, replacing it in the symbol table.
499+
/// Existing references to the original symbol remain unchanged, and the
500+
/// original symbol is not emitted to the symbol table.
501+
MCSymbol *cloneSymbol(MCSymbol &Sym);
502+
498503
/// Set value for a symbol.
499504
void setSymbolValue(MCStreamer &Streamer, const Twine &Sym, uint64_t Val);
500505

llvm/include/llvm/MC/MCSymbol.h

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,6 @@ class MCSymbol {
9090
/// True if this symbol can be redefined.
9191
unsigned IsRedefinable : 1;
9292

93-
/// IsUsed - True if this symbol has been used.
94-
mutable unsigned IsUsed : 1;
95-
9693
mutable unsigned IsRegistered : 1;
9794

9895
/// True if this symbol is visible outside this translation unit. Note: ELF
@@ -165,16 +162,19 @@ class MCSymbol {
165162
};
166163

167164
MCSymbol(SymbolKind Kind, const MCSymbolTableEntry *Name, bool isTemporary)
168-
: IsTemporary(isTemporary), IsRedefinable(false), IsUsed(false),
169-
IsRegistered(false), IsExternal(false), IsPrivateExtern(false),
170-
IsWeakExternal(false), Kind(Kind), IsUsedInReloc(false), IsResolving(0),
165+
: IsTemporary(isTemporary), IsRedefinable(false), IsRegistered(false),
166+
IsExternal(false), IsPrivateExtern(false), IsWeakExternal(false),
167+
Kind(Kind), IsUsedInReloc(false), IsResolving(0),
171168
SymbolContents(SymContentsUnset), CommonAlignLog2(0), Flags(0) {
172169
Offset = 0;
173170
HasName = !!Name;
174171
if (Name)
175172
getNameEntryPtr() = Name;
176173
}
177174

175+
MCSymbol(const MCSymbol &) = default;
176+
MCSymbol &operator=(const MCSymbol &) = delete;
177+
178178
// Provide custom new/delete as we will only allocate space for a name
179179
// if we need one.
180180
void *operator new(size_t s, const MCSymbolTableEntry *Name, MCContext &Ctx);
@@ -201,9 +201,6 @@ class MCSymbol {
201201
}
202202

203203
public:
204-
MCSymbol(const MCSymbol &) = delete;
205-
MCSymbol &operator=(const MCSymbol &) = delete;
206-
207204
/// getName - Get the symbol name.
208205
StringRef getName() const {
209206
if (!HasName)
@@ -224,9 +221,6 @@ class MCSymbol {
224221
/// isTemporary - Check if this is an assembler temporary symbol.
225222
bool isTemporary() const { return IsTemporary; }
226223

227-
/// isUsed - Check if this is used.
228-
bool isUsed() const { return IsUsed; }
229-
230224
/// Check if this symbol is redefinable.
231225
bool isRedefinable() const { return IsRedefinable; }
232226
/// Mark this symbol as redefinable.
@@ -258,7 +252,7 @@ class MCSymbol {
258252
/// isInSection - Check if this symbol is defined in some section (i.e., it
259253
/// is defined but not absolute).
260254
bool isInSection() const {
261-
auto *F = getFragment(0);
255+
auto *F = getFragment();
262256
return F && F != AbsolutePseudoFragment;
263257
}
264258

@@ -306,10 +300,9 @@ class MCSymbol {
306300
return SymbolContents == SymContentsVariable;
307301
}
308302

309-
/// getVariableValue - Get the value for variable symbols.
303+
/// Get the expression of the variable symbol.
310304
const MCExpr *getVariableValue(bool SetUsed = true) const {
311305
assert(isVariable() && "Invalid accessor!");
312-
IsUsed |= SetUsed;
313306
return Value;
314307
}
315308

@@ -399,12 +392,12 @@ class MCSymbol {
399392
return SymbolContents == SymContentsTargetCommon;
400393
}
401394

402-
MCFragment *getFragment(bool SetUsed = false) const {
395+
MCFragment *getFragment() const {
403396
if (Fragment || !isVariable() || isWeakExternal())
404397
return Fragment;
405398
// If the symbol is a non-weak alias, get information about
406399
// the aliasee. (Don't try to resolve weak aliases.)
407-
Fragment = getVariableValue(SetUsed)->findAssociatedFragment();
400+
Fragment = getVariableValue()->findAssociatedFragment();
408401
return Fragment;
409402
}
410403

llvm/lib/ExecutionEngine/Orc/COFFPlatform.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,7 @@ COFFPlatform::COFFPlatform(
401401
}
402402
VCRuntimeBootstrap = std::move(*VCRT);
403403

404+
std::set<std::string> DylibsToPreload;
404405
for (auto &Lib : OrcRuntimeGenerator->getImportedDynamicLibraries())
405406
DylibsToPreload.insert(Lib);
406407

llvm/lib/MC/ELFObjectWriter.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,8 +446,7 @@ void ELFWriter::writeSymbol(SymbolTableWriter &Writer, uint32_t StringIndex,
446446
// needs. MCBinaryExpr is not handled.
447447
const MCSymbolELF *Sym = &Symbol;
448448
while (Sym->isVariable()) {
449-
if (auto *Expr =
450-
dyn_cast<MCSymbolRefExpr>(Sym->getVariableValue(false))) {
449+
if (auto *Expr = dyn_cast<MCSymbolRefExpr>(Sym->getVariableValue())) {
451450
Sym = cast<MCSymbolELF>(&Expr->getSymbol());
452451
if (!Sym->getSize())
453452
continue;

llvm/lib/MC/MCAsmStreamer.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,11 @@ void MCAsmStreamer::emitELFSymverDirective(const MCSymbol *OriginalSym,
581581

582582
void MCAsmStreamer::emitLabel(MCSymbol *Symbol, SMLoc Loc) {
583583
MCStreamer::emitLabel(Symbol, Loc);
584+
// FIXME: Fix CodeGen/AArch64/arm64ec-varargs.ll. emitLabel is followed by
585+
// setVariableValue, leading to an assertion failure if setOffset(0) is
586+
// called.
587+
if (getContext().getObjectFileType() != MCContext::IsCOFF)
588+
Symbol->setOffset(0);
584589

585590
Symbol->print(OS, MAI);
586591
OS << MAI->getLabelSuffix();

0 commit comments

Comments
 (0)