summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineFunction.cpp
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2018-07-26 00:27:47 +0000
committerMatthias Braun <matze@braunis.de>2018-07-26 00:27:47 +0000
commit57dd5b3dead6338d3a0647c835deebf6dbd86910 (patch)
tree3d776aab1d3f62f12ba0fcd3f79f85a408cf6ed6 /llvm/lib/CodeGen/MachineFunction.cpp
parentbcbb032d557db28b221ac0b1992413de2b653454 (diff)
downloadbcm5719-llvm-57dd5b3dead6338d3a0647c835deebf6dbd86910.tar.gz
bcm5719-llvm-57dd5b3dead6338d3a0647c835deebf6dbd86910.zip
CodeGen: Cleanup regmask construction; NFC
- Avoid duplication of regmask size calculation. - Simplify allocateRegisterMask() call. - Rename allocateRegisterMask() to allocateRegMask() to be consistent with naming in MachineOperand. llvm-svn: 337986
Diffstat (limited to 'llvm/lib/CodeGen/MachineFunction.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineFunction.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp
index a376614ade9..dd668bcf619 100644
--- a/llvm/lib/CodeGen/MachineFunction.cpp
+++ b/llvm/lib/CodeGen/MachineFunction.cpp
@@ -486,6 +486,14 @@ const char *MachineFunction::createExternalSymbolName(StringRef Name) {
return Dest;
}
+uint32_t *MachineFunction::allocateRegMask() {
+ unsigned NumRegs = getSubtarget().getRegisterInfo()->getNumRegs();
+ unsigned Size = MachineOperand::getRegMaskSize(NumRegs);
+ uint32_t *Mask = Allocator.Allocate<uint32_t>(Size);
+ memset(Mask, 0, Size * sizeof(Mask[0]));
+ return Mask;
+}
+
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
LLVM_DUMP_METHOD void MachineFunction::dump() const {
print(dbgs());
OpenPOWER on IntegriCloud