Skip to content

Commit

Permalink
[BOLT] Remove --allow-stripped option
Browse files Browse the repository at this point in the history
AllowStripped has not been used in BOLT.
This option is replaced by actively detecting stripped binary.

Test Plan:

Reviewed By: Amir

Differential Revision: https://reviews.llvm.org/D130036
  • Loading branch information
nhuhuan authored and aaupov committed Jul 29, 2022
1 parent 986362d commit ccabbff
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions bolt/lib/Rewrite/RewriteInstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,6 @@ cl::opt<std::string>
"output binary via bolt info section"),
cl::cat(BoltCategory));

cl::opt<bool>
AllowStripped("allow-stripped",
cl::desc("allow processing of stripped binaries"),
cl::Hidden,
cl::cat(BoltCategory));

cl::opt<bool> DumpDotAll(
"dump-dot-all",
cl::desc("dump function CFGs to graphviz format after each stage;"
Expand Down Expand Up @@ -2813,13 +2807,11 @@ void RewriteInstance::preprocessProfileData() {
if (Error E = ProfileReader->preprocessProfile(*BC.get()))
report_error("cannot pre-process profile", std::move(E));

if (!BC->hasSymbolsWithFileName() && ProfileReader->hasLocalsWithFileName() &&
!opts::AllowStripped) {
if (!BC->hasSymbolsWithFileName() && ProfileReader->hasLocalsWithFileName()) {
errs() << "BOLT-ERROR: input binary does not have local file symbols "
"but profile data includes function names with embedded file "
"names. It appears that the input binary was stripped while a "
"profiled binary was not. If you know what you are doing and "
"wish to proceed, use -allow-stripped option.\n";
"profiled binary was not\n";
exit(1);
}
}
Expand Down

0 comments on commit ccabbff

Please sign in to comment.