[llvm-branch-commits] [llvm] [NFC][BOLT] Rename createDummyReturnFunction to createReturnBody (PR #98448)

Paschalis Mpeis via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Jul 12 02:09:01 PDT 2024


https://github.com/paschalis-mpeis updated https://github.com/llvm/llvm-project/pull/98448

>From 2e9d663a9a164735fbe1a2408994acc1abaa8c21 Mon Sep 17 00:00:00 2001
From: Paschalis Mpeis <Paschalis.Mpeis at arm.com>
Date: Thu, 11 Jul 2024 09:32:12 +0100
Subject: [PATCH] [NFC][BOLT] Rename createDummyReturnFunction to
 createReturnInstructionList

createDummyReturnFunction is not creating a function but instead only
a function body that is simply a return statement.
This patch renames it to:
createReturnInstructionList
---
 bolt/include/bolt/Core/MCPlusBuilder.h | 3 ++-
 bolt/lib/Passes/Instrumentation.cpp    | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/bolt/include/bolt/Core/MCPlusBuilder.h b/bolt/include/bolt/Core/MCPlusBuilder.h
index 885d627f7b64f..c916c6f95751f 100644
--- a/bolt/include/bolt/Core/MCPlusBuilder.h
+++ b/bolt/include/bolt/Core/MCPlusBuilder.h
@@ -2044,7 +2044,8 @@ class MCPlusBuilder {
   /// Returns a function body that contains only a return instruction. An
   /// example usage is a workaround for the '__bolt_fini_trampoline' of
   // Instrumentation.
-  virtual InstructionListType createDummyReturnFunction(MCContext *Ctx) const {
+  virtual InstructionListType
+  createReturnInstructionList(MCContext *Ctx) const {
     InstructionListType Insts(1);
     createReturn(Insts[0]);
     return Insts;
diff --git a/bolt/lib/Passes/Instrumentation.cpp b/bolt/lib/Passes/Instrumentation.cpp
index e824a42d82696..ebb3925749b4d 100644
--- a/bolt/lib/Passes/Instrumentation.cpp
+++ b/bolt/lib/Passes/Instrumentation.cpp
@@ -754,7 +754,7 @@ void Instrumentation::createAuxiliaryFunctions(BinaryContext &BC) {
       // with unknown symbol in runtime library. E.g. for static PIE
       // executable
       createSimpleFunction("__bolt_fini_trampoline",
-                           BC.MIB->createDummyReturnFunction(BC.Ctx.get()));
+                           BC.MIB->createReturnInstructionList(BC.Ctx.get()));
     }
   }
 }



More information about the llvm-branch-commits mailing list