summaryrefslogtreecommitdiff
path: root/bolt/lib/Passes/PatchEntries.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'bolt/lib/Passes/PatchEntries.cpp')
-rw-r--r--bolt/lib/Passes/PatchEntries.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/bolt/lib/Passes/PatchEntries.cpp b/bolt/lib/Passes/PatchEntries.cpp
index 1530d1076bb0..981d1b70af90 100644
--- a/bolt/lib/Passes/PatchEntries.cpp
+++ b/bolt/lib/Passes/PatchEntries.cpp
@@ -12,7 +12,6 @@
//===----------------------------------------------------------------------===//
#include "bolt/Passes/PatchEntries.h"
-#include "bolt/Utils/CommandLineOpts.h"
#include "bolt/Utils/NameResolver.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/CommandLine.h"
@@ -36,20 +35,16 @@ Error PatchEntries::runOnFunctions(BinaryContext &BC) {
if (!opts::ForcePatch) {
// Mark the binary for patching if we did not create external references
// for original code in any of functions we are not going to emit.
- bool NeedsPatching =
- llvm::any_of(llvm::make_second_range(BC.getBinaryFunctions()),
- [&](BinaryFunction &BF) {
- return !BF.isPseudo() && !BC.shouldEmit(BF) &&
- !BF.hasExternalRefRelocations();
- });
+ bool NeedsPatching = llvm::any_of(
+ llvm::make_second_range(BC.getBinaryFunctions()),
+ [&](BinaryFunction &BF) {
+ return !BC.shouldEmit(BF) && !BF.hasExternalRefRelocations();
+ });
if (!NeedsPatching)
return Error::success();
}
- assert(!opts::UseOldText &&
- "Cannot patch entries while overwriting original .text");
-
if (opts::Verbosity >= 1)
BC.outs() << "BOLT-INFO: patching entries in original code\n";