Eliminate data relocations by using NULL instead of global empty list.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29250 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/VirtRegMap.cpp b/lib/CodeGen/VirtRegMap.cpp
index 86fef3e..bc56945 100644
--- a/lib/CodeGen/VirtRegMap.cpp
+++ b/lib/CodeGen/VirtRegMap.cpp
@@ -671,10 +671,12 @@
// Loop over all of the implicit defs, clearing them from our available
// sets.
- for (const unsigned *ImpDef = TII->getImplicitDefs(MI.getOpcode());
- *ImpDef; ++ImpDef) {
- PhysRegsUsed[*ImpDef] = true;
- Spills.ClobberPhysReg(*ImpDef);
+ const unsigned *ImpDef = TII->getImplicitDefs(MI.getOpcode());
+ if (ImpDef) {
+ for ( ; *ImpDef; ++ImpDef) {
+ PhysRegsUsed[*ImpDef] = true;
+ Spills.ClobberPhysReg(*ImpDef);
+ }
}
DEBUG(std::cerr << '\t' << MI);