[llvm-commits] CVS: llvm/include/Support/Casting.h

Chris Lattner lattner at cs.uiuc.edu
Thu May 29 10:08:04 PDT 2003


Changes in directory llvm/include/Support:

Casting.h updated: 1.4 -> 1.5

---
Log message:

dyn_cast_or_null should work just the same as dyn_cast does



---
Diffs of the changes:

Index: llvm/include/Support/Casting.h
diff -u llvm/include/Support/Casting.h:1.4 llvm/include/Support/Casting.h:1.5
--- llvm/include/Support/Casting.h:1.4	Wed Apr 23 11:17:28 2003
+++ llvm/include/Support/Casting.h	Thu May 29 10:07:48 2003
@@ -207,7 +207,7 @@
 // be used to test for a type as well as cast if successful.  This should be
 // used in the context of an if statement like this:
 //
-//  if (const Instruction *I = dyn_cast<const Instruction>(myVal)) { ... }
+//  if (const Instruction *I = dyn_cast<Instruction>(myVal)) { ... }
 //
 
 template <class X, class Y>
@@ -219,8 +219,8 @@
 // value is accepted.
 //
 template <class X, class Y>
-inline typename cast_retty<X, Y*>::ret_type dyn_cast_or_null(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, Y>(Val) : 0;
 }
 
 





More information about the llvm-commits mailing list