Skip to content

Commit 1459e67

Browse files
committed
fixup! [BOLT][AArch64] Patch functions targeted by optional relocs
1 parent 1a6199d commit 1459e67

File tree

3 files changed

+2
-15
lines changed

3 files changed

+2
-15
lines changed

bolt/include/bolt/Core/BinaryFunction.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1383,11 +1383,6 @@ class BinaryFunction {
13831383
/// Return true if the function should not have associated symbol table entry.
13841384
bool isAnonymous() const { return IsAnonymous; }
13851385

1386-
/// Return true if we can allow the execution of the original body of the
1387-
/// function and its rewritten copy. This means, e.g., that metadata
1388-
/// associated with the function can be duplicated/cloned.
1389-
bool canClone() const;
1390-
13911386
/// If this function was folded, return the function it was folded into.
13921387
BinaryFunction *getFoldedIntoFunction() const { return FoldedIntoFunction; }
13931388

bolt/lib/Core/BinaryFunction.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3753,14 +3753,6 @@ void BinaryFunction::postProcessBranches() {
37533753
assert(validateCFG() && "invalid CFG");
37543754
}
37553755

3756-
bool BinaryFunction::canClone() const {
3757-
if (opts::Instrument)
3758-
return false;
3759-
3760-
// Check for the presence of metadata that cannot be duplicated.
3761-
return !hasEHRanges() && !hasSDTMarker() && !hasPseudoProbe() && !hasORC();
3762-
}
3763-
37643756
MCSymbol *BinaryFunction::addEntryPointAtOffset(uint64_t Offset) {
37653757
assert(Offset && "cannot add primary entry point");
37663758
assert(CurrentState == State::Empty || CurrentState == State::Disassembled);

bolt/lib/Passes/PatchEntries.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ Error PatchEntries::runOnFunctions(BinaryContext &BC) {
6666
continue;
6767

6868
// Check if we can skip patching the function.
69-
if (!opts::ForcePatch && !Function.needsPatch() && Function.canClone() &&
70-
Function.getSize() < PatchThreshold)
69+
if (!opts::ForcePatch && !Function.hasEHRanges() &&
70+
!Function.needsPatch() && Function.getSize() < PatchThreshold)
7171
continue;
7272

7373
// List of patches for function entries. We either successfully patch

0 commit comments

Comments
 (0)