Fix bug generating code for void call instructions: don't call
getReg() on void value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14178 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/Sparc/InstSelectSimple.cpp b/lib/Target/Sparc/InstSelectSimple.cpp
index 9127682..398198f 100644
--- a/lib/Target/Sparc/InstSelectSimple.cpp
+++ b/lib/Target/Sparc/InstSelectSimple.cpp
@@ -452,10 +452,10 @@
         .addReg (ArgReg);
     }
 
-  unsigned DestReg = getReg (I);
   BuildMI (BB, V8::CALL, 1).addPCDisp (I.getOperand (0));
-  if (I.getType ()->getPrimitiveID () == Type::VoidTyID)
+  if (I.getType () == Type::VoidTy)
     return;
+  unsigned DestReg = getReg (I);
   // Deal w/ return value
   switch (getClass (I.getType ())) {
     case cByte: