Skip to content

Commit e86d6cf

Browse files
committed
merge main into amd-staging
2 parents 86ac3f0 + ff48353 commit e86d6cf

File tree

21 files changed

+567
-82
lines changed

21 files changed

+567
-82
lines changed

bolt/include/bolt/Core/BinaryFunction.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -620,13 +620,11 @@ class BinaryFunction {
620620
}
621621

622622
/// Return a label at a given \p Address in the function. If the label does
623-
/// not exist - create it. Assert if the \p Address does not belong to
624-
/// the function. If \p CreatePastEnd is true, then return the function
625-
/// end label when the \p Address points immediately past the last byte
626-
/// of the function.
623+
/// not exist - create it.
624+
///
627625
/// NOTE: the function always returns a local (temp) symbol, even if there's
628626
/// a global symbol that corresponds to an entry at this address.
629-
MCSymbol *getOrCreateLocalLabel(uint64_t Address, bool CreatePastEnd = false);
627+
MCSymbol *getOrCreateLocalLabel(uint64_t Address);
630628

631629
/// Register an data entry at a given \p Offset into the function.
632630
void markDataAtOffset(uint64_t Offset) {

bolt/lib/Core/BinaryFunction.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,13 +1035,9 @@ BinaryFunction::processIndirectBranch(MCInst &Instruction, unsigned Size,
10351035
return BranchType;
10361036
}
10371037

1038-
MCSymbol *BinaryFunction::getOrCreateLocalLabel(uint64_t Address,
1039-
bool CreatePastEnd) {
1038+
MCSymbol *BinaryFunction::getOrCreateLocalLabel(uint64_t Address) {
10401039
const uint64_t Offset = Address - getAddress();
10411040

1042-
if ((Offset == getSize()) && CreatePastEnd)
1043-
return getFunctionEndLabel();
1044-
10451041
auto LI = Labels.find(Offset);
10461042
if (LI != Labels.end())
10471043
return LI->second;
@@ -1052,6 +1048,9 @@ MCSymbol *BinaryFunction::getOrCreateLocalLabel(uint64_t Address,
10521048
return IslandSym;
10531049
}
10541050

1051+
if (Offset == getSize())
1052+
return getFunctionEndLabel();
1053+
10551054
MCSymbol *Label = BC.Ctx->createNamedTempSymbol();
10561055
Labels[Offset] = Label;
10571056

@@ -1994,7 +1993,7 @@ void BinaryFunction::postProcessJumpTables() {
19941993
if (IsBuiltinUnreachable) {
19951994
BinaryFunction *TargetBF = BC.getBinaryFunctionAtAddress(EntryAddress);
19961995
MCSymbol *Label = TargetBF ? TargetBF->getSymbol()
1997-
: getOrCreateLocalLabel(EntryAddress, true);
1996+
: getOrCreateLocalLabel(EntryAddress);
19981997
JT.Entries.push_back(Label);
19991998
continue;
20001999
}
@@ -2005,7 +2004,7 @@ void BinaryFunction::postProcessJumpTables() {
20052004
BC.getBinaryFunctionContainingAddress(EntryAddress);
20062005
MCSymbol *Label;
20072006
if (HasOneParent && TargetBF == this) {
2008-
Label = getOrCreateLocalLabel(EntryAddress, true);
2007+
Label = getOrCreateLocalLabel(EntryAddress);
20092008
} else {
20102009
const uint64_t Offset = EntryAddress - TargetBF->getAddress();
20112010
Label = Offset ? TargetBF->addEntryPointAtOffset(Offset)

bolt/lib/Rewrite/RewriteInstance.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2949,9 +2949,7 @@ void RewriteInstance::handleRelocation(const SectionRef &RelocatedSection,
29492949
ReferencedSymbol =
29502950
ReferencedBF->addEntryPointAtOffset(RefFunctionOffset);
29512951
} else {
2952-
ReferencedSymbol =
2953-
ReferencedBF->getOrCreateLocalLabel(Address,
2954-
/*CreatePastEnd =*/true);
2952+
ReferencedSymbol = ReferencedBF->getOrCreateLocalLabel(Address);
29552953

29562954
// If ContainingBF != nullptr, it equals ReferencedBF (see
29572955
// if-condition above) so we're handling a relocation from a function

clang/lib/Interpreter/Interpreter.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -581,12 +581,7 @@ Interpreter::Parse(llvm::StringRef Code) {
581581
if (!TuOrErr)
582582
return TuOrErr.takeError();
583583

584-
PTUs.emplace_back(PartialTranslationUnit());
585-
PartialTranslationUnit &LastPTU = PTUs.back();
586-
LastPTU.TUPart = *TuOrErr;
587-
588-
if (std::unique_ptr<llvm::Module> M = Act->GenModule())
589-
LastPTU.TheModule = std::move(M);
584+
PartialTranslationUnit &LastPTU = IncrParser->RegisterPTU(*TuOrErr);
590585

591586
return LastPTU;
592587
}

clang/test/Driver/config-file3.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
// Needs symlinks
22
// UNSUPPORTED: system-windows
3-
// env -u is not supported on AIX.
4-
// TODO(boomanaiden154): Remove this once we have switched over to lit's
5-
// internal shell which does support env -u.
6-
// UNSUPPORTED: target={{.*}}-zos{{.*}}, target={{.*}}-aix{{.*}}
73
// REQUIRES: x86-registered-target
84

95
// RUN: rm -rf %t && mkdir %t

clang/test/Driver/config-zos.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
// Needs symlinks
22
// UNSUPPORTED: system-windows
3-
// env -u is not supported on AIX.
4-
// TODO(boomanaiden154): Remove this once we have switched over to lit's
5-
// internal shell which does support env -u.
6-
// UNSUPPORTED: target={{.*}}-zos{{.*}}, target={{.*}}-aix{{.*}}
73
// REQUIRES: systemz-registered-target
84

95
// RUN: rm -rf %t && mkdir %t

clang/test/Driver/config-zos1.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
// UNSUPPORTED: system-windows
2-
// env -u is not supported on AIX.
3-
// TODO(boomanaiden154): Remove this once we have switched over to lit's
4-
// internal shell which does support env -u.
5-
// UNSUPPORTED: target={{.*}}-zos{{.*}}, target={{.*}}-aix{{.*}}
62
// REQUIRES: systemz-registered-target
73

84
// RUN: export CLANG_CONFIG_PATH=%S/Inputs/config-zos

clang/test/Modules/crash-vfs-path-symlink-component.m

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
// Needs symlinks
22
// UNSUPPORTED: system-windows
3-
// env -u is not supported on AIX.
4-
// TODO(boomanaiden154): Remove this once we have switched over to lit's
5-
// internal shell which does support env -u.
6-
// UNSUPPORTED: target={{.*}}-zos{{.*}}, target={{.*}}-aix{{.*}}
73
// REQUIRES: crash-recovery
84

95
// FIXME: This XFAIL is cargo-culted from crash-report.c. Do we need it?

clang/test/Modules/crash-vfs-path-traversal.m

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
// UNSUPPORTED: ms-sdk, target={{.*-(ps4|ps5)}}
33
// Some assertions in this test use Linux style (/) file paths.
44
// UNSUPPORTED: system-windows
5-
// env -u is not supported on AIX.
6-
// TODO(boomanaiden154): Remove this once we have switched over to lit's
7-
// internal shell which does support env -u.
8-
// UNSUPPORTED: target={{.*}}-zos{{.*}}, target={{.*}}-aix{{.*}}
95

106
// FIXME: Canonicalizing paths to remove relative traversal components
117
// currenty fails a unittest on windows and is disable by default.

clang/test/Modules/crash-vfs-relative-overlay.m

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
// UNSUPPORTED: system-windows
22
// REQUIRES: crash-recovery
3-
// env -u is not supported on AIX.
4-
// TODO(boomanaiden154): Remove this once we have switched over to lit's
5-
// internal shell which does support env -u.
6-
// UNSUPPORTED: target={{.*}}-zos{{.*}}, target={{.*}}-aix{{.*}}
73

84
// FIXME: This XFAIL is cargo-culted from crash-report.c. Do we need it?
95
// XFAIL: target={{.*-windows-gnu}}

0 commit comments

Comments
 (0)