diff options
author | Craig Topper <craig.topper@gmail.com> | 2012-08-22 06:07:19 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2012-08-22 06:07:19 +0000 |
commit | 96601ca332ab388754ca4673be8973396fea2ddd (patch) | |
tree | cbcd5cd376fac9adff0f9683e79512d652c0159d /lib/CodeGen/MachineFunction.cpp | |
parent | df8de92083e9cc97999e9f2f7bc7ef1df9ac6258 (diff) |
Add a getName function to MachineFunction. Use it in places that previously did getFunction()->getName(). Remove includes of Function.h that are no longer needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162347 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineFunction.cpp')
-rw-r--r-- | lib/CodeGen/MachineFunction.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/CodeGen/MachineFunction.cpp b/lib/CodeGen/MachineFunction.cpp index d4aede8a7e..68a8e877bb 100644 --- a/lib/CodeGen/MachineFunction.cpp +++ b/lib/CodeGen/MachineFunction.cpp @@ -288,6 +288,11 @@ void MachineFunction::dump() const { print(dbgs()); } +StringRef MachineFunction::getName() const { + assert(getFunction() && "No function!"); + return getFunction()->getName(); +} + void MachineFunction::print(raw_ostream &OS, SlotIndexes *Indexes) const { OS << "# Machine code for function " << Fn->getName() << ": "; if (RegInfo) { @@ -344,7 +349,7 @@ namespace llvm { DOTGraphTraits (bool isSimple=false) : DefaultDOTGraphTraits(isSimple) {} static std::string getGraphName(const MachineFunction *F) { - return "CFG for '" + F->getFunction()->getName().str() + "' function"; + return "CFG for '" + F->getName().str() + "' function"; } std::string getNodeLabel(const MachineBasicBlock *Node, |