aboutsummaryrefslogtreecommitdiff
path: root/bolt/lib/Passes/ReorderFunctions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'bolt/lib/Passes/ReorderFunctions.cpp')
-rw-r--r--bolt/lib/Passes/ReorderFunctions.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/bolt/lib/Passes/ReorderFunctions.cpp b/bolt/lib/Passes/ReorderFunctions.cpp
index 1256d71..35c5acf 100644
--- a/bolt/lib/Passes/ReorderFunctions.cpp
+++ b/bolt/lib/Passes/ReorderFunctions.cpp
@@ -28,7 +28,8 @@ extern cl::OptionCategory BoltOptCategory;
extern cl::opt<unsigned> Verbosity;
extern cl::opt<uint32_t> RandomSeed;
-extern size_t padFunction(const bolt::BinaryFunction &Function);
+extern size_t padFunctionBefore(const bolt::BinaryFunction &Function);
+extern size_t padFunctionAfter(const bolt::BinaryFunction &Function);
extern cl::opt<bolt::ReorderFunctions::ReorderType> ReorderFunctions;
cl::opt<bolt::ReorderFunctions::ReorderType> ReorderFunctions(
@@ -304,8 +305,10 @@ Error ReorderFunctions::runOnFunctions(BinaryContext &BC) {
return false;
if (B->isIgnored())
return true;
- const size_t PadA = opts::padFunction(*A);
- const size_t PadB = opts::padFunction(*B);
+ const size_t PadA = opts::padFunctionBefore(*A) +
+ opts::padFunctionAfter(*A);
+ const size_t PadB = opts::padFunctionBefore(*B) +
+ opts::padFunctionAfter(*B);
if (!PadA || !PadB) {
if (PadA)
return true;