From 364d1785a6e3f9b149cef29849e653abe5548cc2 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Wed, 13 Nov 2019 15:33:12 -0800 Subject: [PATCH] Sink MachineFunction private method out of line This method is private and only called from this file and doesn't need to be inline. Saves a TargetMachine.h include in MachineFunction.h, a popular header. The include was introduced in 98603a8153086 despite the forward decl of LLVMTargetMachine. --- llvm/include/llvm/CodeGen/MachineFunction.h | 10 +--------- llvm/lib/CodeGen/MachineFunction.cpp | 9 +++++++++ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/llvm/include/llvm/CodeGen/MachineFunction.h b/llvm/include/llvm/CodeGen/MachineFunction.h index c5a6a6eacf0c..57038d239fa2 100644 --- a/llvm/include/llvm/CodeGen/MachineFunction.h +++ b/llvm/include/llvm/CodeGen/MachineFunction.h @@ -36,7 +36,6 @@ #include "llvm/Support/Compiler.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/Recycler.h" -#include "llvm/Target/TargetMachine.h" #include #include #include @@ -403,14 +402,7 @@ private: /// A helper function that returns call site info for a give call /// instruction if debug entry value support is enabled. - CallSiteInfoMap::iterator getCallSiteInfo(const MachineInstr *MI) { - assert(MI->isCall() && - "Call site info refers only to call instructions!"); - - if (!Target.Options.EnableDebugEntryValues) - return CallSitesInfo.end(); - return CallSitesInfo.find(MI); - } + CallSiteInfoMap::iterator getCallSiteInfo(const MachineInstr *MI); // Callbacks for insertion and removal. void handleInsertion(MachineInstr &MI); diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp index 115aad3880f7..b40f0b46bc12 100644 --- a/llvm/lib/CodeGen/MachineFunction.cpp +++ b/llvm/lib/CodeGen/MachineFunction.cpp @@ -830,6 +830,15 @@ try_next:; return FilterID; } +MachineFunction::CallSiteInfoMap::iterator +MachineFunction::getCallSiteInfo(const MachineInstr *MI) { + assert(MI->isCall() && "Call site info refers only to call instructions!"); + + if (!Target.Options.EnableDebugEntryValues) + return CallSitesInfo.end(); + return CallSitesInfo.find(MI); +} + void MachineFunction::moveCallSiteInfo(const MachineInstr *Old, const MachineInstr *New) { assert(New->isCall() && "Call site info refers only to call instructions!");