[llvm-commits] CVS: llvm/lib/Target/X86/InstSelectSimple.cpp

Chris Lattner lattner at cs.uiuc.edu
Wed Dec 4 17:51:01 PST 2002


Changes in directory llvm/lib/Target/X86:

InstSelectSimple.cpp updated: 1.51 -> 1.52

---
Log message:

Fix handling of function calls that return void


---
Diffs of the changes:

Index: llvm/lib/Target/X86/InstSelectSimple.cpp
diff -u llvm/lib/Target/X86/InstSelectSimple.cpp:1.51 llvm/lib/Target/X86/InstSelectSimple.cpp:1.52
--- llvm/lib/Target/X86/InstSelectSimple.cpp:1.51	Wed Dec  4 17:45:28 2002
+++ llvm/lib/Target/X86/InstSelectSimple.cpp	Wed Dec  4 17:50:28 2002
@@ -434,15 +434,17 @@
   // If there is a return value, scavenge the result from the location the call
   // leaves it in...
   //
-  switch (getClass(CI.getType())) {
-  case cInt:
-    BuildMI(BB, X86::MOVrr32, 1, getReg(CI)).addReg(X86::EAX);
-    break;
-
-  default:
-    std::cerr << "Cannot get return value for call of type '"
-              << *CI.getType() << "'\n";
-    visitInstruction(CI);
+  if (CI.getType() != Type::VoidTy) {
+    switch (getClass(CI.getType())) {
+    case cInt:
+      BuildMI(BB, X86::MOVrr32, 1, getReg(CI)).addReg(X86::EAX);
+      break;
+      
+    default:
+      std::cerr << "Cannot get return value for call of type '"
+                << *CI.getType() << "'\n";
+      visitInstruction(CI);
+    }
   }
 }
 





More information about the llvm-commits mailing list