[llvm-commits] [llvm] r49641 - /llvm/branches/ggreif/use-diet/include/llvm/Instructions.h
Gabor Greif
ggreif at gmail.com
Mon Apr 14 04:51:54 PDT 2008
Author: ggreif
Date: Mon Apr 14 06:51:53 2008
New Revision: 49641
URL: http://llvm.org/viewvc/llvm-project?rev=49641&view=rev
Log:
do not assert when a nonexisting return value is asked for, just return NULL
Modified:
llvm/branches/ggreif/use-diet/include/llvm/Instructions.h
Modified: llvm/branches/ggreif/use-diet/include/llvm/Instructions.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/include/llvm/Instructions.h?rev=49641&r1=49640&r2=49641&view=diff
==============================================================================
--- llvm/branches/ggreif/use-diet/include/llvm/Instructions.h (original)
+++ llvm/branches/ggreif/use-diet/include/llvm/Instructions.h Mon Apr 14 06:51:53 2008
@@ -1598,7 +1598,9 @@
/// Convenience accessor
Value *getReturnValue(unsigned n = 0) const {
- return getOperand(n);
+ return n < getNumOperands()
+ ? getOperand(n)
+ : 0;
}
unsigned getNumSuccessors() const { return 0; }
More information about the llvm-commits
mailing list