[llvm-commits] [llvm] r114282 - /llvm/trunk/include/llvm/Support/Casting.h
Gabor Greif
ggreif at gmail.com
Sat Sep 18 06:03:32 PDT 2010
Author: ggreif
Date: Sat Sep 18 08:03:32 2010
New Revision: 114282
URL: http://llvm.org/viewvc/llvm-project?rev=114282&view=rev
Log:
restrict dyn_cast_or_null to pointer types, just like cast_or_null; re-commit of r114279, backed out in r114280
Modified:
llvm/trunk/include/llvm/Support/Casting.h
Modified: llvm/trunk/include/llvm/Support/Casting.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Casting.h?rev=114282&r1=114281&r2=114282&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/Casting.h (original)
+++ llvm/trunk/include/llvm/Support/Casting.h Sat Sep 18 08:03:32 2010
@@ -232,8 +232,8 @@
// value is accepted.
//
template <class X, class Y>
-inline typename cast_retty<X, Y>::ret_type dyn_cast_or_null(const Y &Val) {
- return (Val && isa<X>(Val)) ? cast<X, Y>(Val) : 0;
+inline typename cast_retty<X, Y*>::ret_type dyn_cast_or_null(Y *Val) {
+ return (Val && isa<X>(Val)) ? cast<X>(Val) : 0;
}
} // End llvm namespace
More information about the llvm-commits
mailing list