From cc6ae9bfc8a8b50c7d039505572817b1913f8cea Mon Sep 17 00:00:00 2001 From: Amir Ayupov Date: Mon, 29 Jul 2024 15:24:25 -0700 Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20change?= =?UTF-8?q?s=20to=20main=20this=20commit=20is=20based=20on?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Created using spr 1.3.4 [skip ci] --- bolt/include/bolt/Core/BinaryFunction.h | 6 ++++++ bolt/lib/Core/BinaryFunction.cpp | 2 ++ 2 files changed, 8 insertions(+) diff --git a/bolt/include/bolt/Core/BinaryFunction.h b/bolt/include/bolt/Core/BinaryFunction.h index 24c7db2f5d69c..2c8e23999b60c 100644 --- a/bolt/include/bolt/Core/BinaryFunction.h +++ b/bolt/include/bolt/Core/BinaryFunction.h @@ -242,6 +242,9 @@ class BinaryFunction { /// Original size of the function. uint64_t Size; + /// Original instruction count of the function, if disassembly succeeded. + uint64_t InputInstructionCount{0}; + /// Address of the function in output. uint64_t OutputAddress{0}; @@ -2173,6 +2176,9 @@ class BinaryFunction { /// Get the number of instructions within this function. uint64_t getInstructionCount() const; + /// Get the original number of instructions. + uint64_t getInputInstructionCount() const { return InputInstructionCount; } + const CFIInstrMapType &getFDEProgram() const { return FrameInstructions; } void moveRememberRestorePair(BinaryBasicBlock *BB); diff --git a/bolt/lib/Core/BinaryFunction.cpp b/bolt/lib/Core/BinaryFunction.cpp index ea09371b57e8a..1f5869cd0ab73 100644 --- a/bolt/lib/Core/BinaryFunction.cpp +++ b/bolt/lib/Core/BinaryFunction.cpp @@ -1499,6 +1499,8 @@ Error BinaryFunction::disassemble() { clearList(Relocations); + InputInstructionCount = Instructions.size(); + if (!IsSimple) { clearList(Instructions); return createNonFatalBOLTError("");