aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/RegAllocSimple.cpp
diff options
context:
space:
mode:
authorAlkis Evlogimenos <alkis@evlogimenos.com>2003-10-08 05:20:08 +0000
committerAlkis Evlogimenos <alkis@evlogimenos.com>2003-10-08 05:20:08 +0000
commit73ff5120eb8b8c0ccbfed8a17f1024c67a75f319 (patch)
treeea737ea5c41b893d3584c3c2d2f0ba5e118d929d /lib/CodeGen/RegAllocSimple.cpp
parent6b8b22585c8ee1ee9bed9c218c604dfb3d88a851 (diff)
downloadexternal_llvm-73ff5120eb8b8c0ccbfed8a17f1024c67a75f319.zip
external_llvm-73ff5120eb8b8c0ccbfed8a17f1024c67a75f319.tar.gz
external_llvm-73ff5120eb8b8c0ccbfed8a17f1024c67a75f319.tar.bz2
Change MRegisterDesc::AliasSet, TargetInstrDescriptor::ImplicitDefs
and TargetInstrDescriptor::ImplicitUses to always point to a null terminated array and never be null. So there is no need to check for pointer validity when iterating over those sets. Code that looked like: if (const unsigned* AS = TID.ImplicitDefs) { for (int i = 0; AS[i]; ++i) { // use AS[i] } } was changed to: for (const unsigned* AS = TID.ImplicitDefs; *AS; ++AS) { // use *AS } git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8960 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/RegAllocSimple.cpp')
-rw-r--r--lib/CodeGen/RegAllocSimple.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/CodeGen/RegAllocSimple.cpp b/lib/CodeGen/RegAllocSimple.cpp
index 57d678b..dbf731e 100644
--- a/lib/CodeGen/RegAllocSimple.cpp
+++ b/lib/CodeGen/RegAllocSimple.cpp
@@ -153,13 +153,13 @@ void RegAllocSimple::AllocateBasicBlock(MachineBasicBlock &MBB) {
// are used by the instruction (including implicit uses)
unsigned Opcode = MI->getOpcode();
const TargetInstrDescriptor &Desc = TM->getInstrInfo().get(Opcode);
- if (const unsigned *Regs = Desc.ImplicitUses)
- while (*Regs)
- RegsUsed[*Regs++] = true;
+ const unsigned *Regs = Desc.ImplicitUses;
+ while (*Regs)
+ RegsUsed[*Regs++] = true;
- if (const unsigned *Regs = Desc.ImplicitDefs)
- while (*Regs)
- RegsUsed[*Regs++] = true;
+ Regs = Desc.ImplicitDefs;
+ while (*Regs)
+ RegsUsed[*Regs++] = true;
// Loop over uses, move from memory into registers
for (int i = MI->getNumOperands() - 1; i >= 0; --i) {