]> granicus.if.org Git - llvm/commitdiff
Move addFrameInst out of line and remove the MCDwarf.h include.
authorEric Christopher <echristo@gmail.com>
Fri, 12 Apr 2019 06:31:59 +0000 (06:31 +0000)
committerEric Christopher <echristo@gmail.com>
Fri, 12 Apr 2019 06:31:59 +0000 (06:31 +0000)
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
lib/CodeGen/MachineFunction.cpp

index 34ceb15aebde134847ca213f69c0aafdd854c062..39504c1cee2157eccfd18d4d2dd8ec4105d2cfd4 100644 (file)
@@ -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
   /// \{
index f58ade81f22f108fc0b0f2be9107fc68a45c9ef8..88a7d15c29985e794e56f596600693a82e029c49 100644 (file)
@@ -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