diff options
author | Matthias Braun <matze@braunis.de> | 2017-12-15 22:22:58 +0000 |
---|---|---|
committer | Matthias Braun <matze@braunis.de> | 2017-12-15 22:22:58 +0000 |
commit | f1caa2833f5052c419faa0007a38e0b242d5b034 (patch) | |
tree | 7cc0d98626eab1a09fdde0d18893ae1bdb92450a /llvm/lib/CodeGen/MachineFunction.cpp | |
parent | 8539edb0f37613ba4e9a5c5e9bd059221a9336d8 (diff) | |
download | llvm-f1caa2833f5052c419faa0007a38e0b242d5b034.zip llvm-f1caa2833f5052c419faa0007a38e0b242d5b034.tar.gz llvm-f1caa2833f5052c419faa0007a38e0b242d5b034.tar.bz2 |
MachineFunction: Return reference from getFunction(); NFC
The Function can never be nullptr so we can return a reference.
llvm-svn: 320884
Diffstat (limited to 'llvm/lib/CodeGen/MachineFunction.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineFunction.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp index 5ffc891..bc8eb142 100644 --- a/llvm/lib/CodeGen/MachineFunction.cpp +++ b/llvm/lib/CodeGen/MachineFunction.cpp @@ -244,7 +244,7 @@ getOrCreateJumpTableInfo(unsigned EntryKind) { /// Should we be emitting segmented stack stuff for the function bool MachineFunction::shouldSplitStack() const { - return getFunction()->hasFnAttribute("split-stack"); + return getFunction().hasFnAttribute("split-stack"); } /// This discards all of the MachineBasicBlock numbers and recomputes them. @@ -485,8 +485,7 @@ LLVM_DUMP_METHOD void MachineFunction::dump() const { #endif StringRef MachineFunction::getName() const { - assert(getFunction() && "No function!"); - return getFunction()->getName(); + return getFunction().getName(); } void MachineFunction::print(raw_ostream &OS, const SlotIndexes *Indexes) const { @@ -519,8 +518,8 @@ void MachineFunction::print(raw_ostream &OS, const SlotIndexes *Indexes) const { OS << '\n'; } - ModuleSlotTracker MST(getFunction()->getParent()); - MST.incorporateFunction(*getFunction()); + ModuleSlotTracker MST(getFunction().getParent()); + MST.incorporateFunction(getFunction()); for (const auto &BB : *this) { OS << '\n'; BB.print(OS, MST, Indexes); |