Fixed method getReturnValue(): it should return NULL if the
authorVikram S. Adve <vadve@cs.uiuc.edu>
Sat, 28 Sep 2002 17:03:54 +0000 (17:03 +0000)
committerVikram S. Adve <vadve@cs.uiuc.edu>
Sat, 28 Sep 2002 17:03:54 +0000 (17:03 +0000)
callee does not return a value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3968 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/MachineInstrAnnot.h
lib/CodeGen/MachineInstrAnnot.cpp
lib/Target/SparcV9/MachineInstrAnnot.h

index bd3f7333e321e6636ffa682161fce3c844c951e8..be3aaac299d8a67e5964e53f12a6fe5a4d2866c7 100644 (file)
@@ -68,12 +68,12 @@ public:
   unsigned int    getNumArgs() const          { return argInfoVec.size(); }
   CallArgInfo&    getArgInfo(unsigned int op) { assert(op < argInfoVec.size());
                                                 return argInfoVec[op]; }
-  const CallInst* getReturnValue() const      { return callInstr; }
+  const CallInst* getReturnValue() const;
   const Value*    getIndirectFuncPtr() const  { return funcPtr; }
   TmpInstruction* getReturnAddrReg() const    { return retAddrReg; }
   bool            isVarArgsFunc() const       { return isVarArgs; }
   bool            hasNoPrototype() const      { return noPrototype; }
-  
+
   // Annotation mechanism to annotate a MachineInstr with the descriptor.
   // This is not demand-driven because annotations can only be created
   // at restricted points during code generation.
index 960c49283e59aea64b6221f3d9d30cf93f2b751a..ef064450ed060925986c5c20224db433e5fcb55a 100644 (file)
@@ -30,3 +30,10 @@ CallArgsDescriptor::CallArgsDescriptor(const CallInst* _callInstr,
   for (unsigned int i=1; i < numArgs; ++i)
     argInfoVec.push_back(CallArgInfo(callInstr->getOperand(i)));
 }
+
+
+const CallInst*
+CallArgsDescriptor::getReturnValue() const
+{
+  return (callInstr->getType() == Type::VoidTy? NULL : callInstr);
+}
index bd3f7333e321e6636ffa682161fce3c844c951e8..be3aaac299d8a67e5964e53f12a6fe5a4d2866c7 100644 (file)
@@ -68,12 +68,12 @@ public:
   unsigned int    getNumArgs() const          { return argInfoVec.size(); }
   CallArgInfo&    getArgInfo(unsigned int op) { assert(op < argInfoVec.size());
                                                 return argInfoVec[op]; }
-  const CallInst* getReturnValue() const      { return callInstr; }
+  const CallInst* getReturnValue() const;
   const Value*    getIndirectFuncPtr() const  { return funcPtr; }
   TmpInstruction* getReturnAddrReg() const    { return retAddrReg; }
   bool            isVarArgsFunc() const       { return isVarArgs; }
   bool            hasNoPrototype() const      { return noPrototype; }
-  
+
   // Annotation mechanism to annotate a MachineInstr with the descriptor.
   // This is not demand-driven because annotations can only be created
   // at restricted points during code generation.