From 7e7105bd0345ae4e11fd8ac1487e901c2a0f47a3 Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Fri, 12 Apr 2019 06:31:59 +0000 Subject: [PATCH] Move addFrameInst out of line and remove the MCDwarf.h include. This removes 500 transitive dependencies for a modification of MCDwarf.h in a build of llc for a single out of line function and reduces the build overhead by more than half without impacting test time of check-llvm. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358255 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/CodeGen/MachineFunction.h | 6 +----- lib/CodeGen/MachineFunction.cpp | 6 ++++++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/include/llvm/CodeGen/MachineFunction.h b/include/llvm/CodeGen/MachineFunction.h index 34ceb15aebd..39504c1cee2 100644 --- a/include/llvm/CodeGen/MachineFunction.h +++ b/include/llvm/CodeGen/MachineFunction.h @@ -33,7 +33,6 @@ #include "llvm/IR/DebugLoc.h" #include "llvm/IR/Instructions.h" #include "llvm/IR/Metadata.h" -#include "llvm/MC/MCDwarf.h" #include "llvm/MC/MCSymbol.h" #include "llvm/Support/Allocator.h" #include "llvm/Support/ArrayRecycler.h" @@ -790,10 +789,7 @@ public: return FrameInstructions; } - LLVM_NODISCARD unsigned addFrameInst(const MCCFIInstruction &Inst) { - FrameInstructions.push_back(Inst); - return FrameInstructions.size() - 1; - } + LLVM_NODISCARD unsigned addFrameInst(const MCCFIInstruction &Inst); /// \name Exception Handling /// \{ diff --git a/lib/CodeGen/MachineFunction.cpp b/lib/CodeGen/MachineFunction.cpp index f58ade81f22..88a7d15c299 100644 --- a/lib/CodeGen/MachineFunction.cpp +++ b/lib/CodeGen/MachineFunction.cpp @@ -273,6 +273,12 @@ bool MachineFunction::shouldSplitStack() const { return getFunction().hasFnAttribute("split-stack"); } +LLVM_NODISCARD unsigned +MachineFunction::addFrameInst(const MCCFIInstruction &Inst) { + FrameInstructions.push_back(Inst); + return FrameInstructions.size() - 1; +} + /// This discards all of the MachineBasicBlock numbers and recomputes them. /// This guarantees that the MBB numbers are sequential, dense, and match the /// ordering of the blocks within the function. If a specific MachineBasicBlock -- 2.50.1