//
// The LLVM Compiler Infrastructure
//
-// This file was developed by the LLVM research group and is distributed under
-// the University of Illinois Open Source License. See LICENSE.TXT for details.
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
//
template <class X, class Y>
-inline typename cast_retty<X, Y>::ret_type dyn_cast(Y Val) {
+inline typename cast_retty<X, Y>::ret_type dyn_cast(const Y &Val) {
return isa<X>(Val) ? cast<X, Y>(Val) : 0;
}
// value is accepted.
//
template <class X, class Y>
-inline typename cast_retty<X, Y>::ret_type dyn_cast_or_null(Y Val) {
+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;
}
#ifdef DEBUG_CAST_OPERATORS
-#include "llvm/Support/Debug.h"
+#include "llvm/Support/Streams.h"
struct bar {
bar() {}
struct foo {
void ext() const;
/* static bool classof(const bar *X) {
- llvm_cerr << "Classof: " << X << "\n";
+ cerr << "Classof: " << X << "\n";
return true;
}*/
};
template <> inline bool isa_impl<foo,bar>(const bar &Val) {
- llvm_cerr << "Classof: " << &Val << "\n";
+ cerr << "Classof: " << &Val << "\n";
return true;
}