X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FSupport%2FCasting.h;h=48988f8a6bb8354c71326e634364acbb2895b4b2;hb=6d53f55291c8541a508a8c26d847b942196f6f1c;hp=fff44f6e642f00de2b4a6c5712252a9debc01acf;hpb=52883e7a9a637c0d6dea091917090a8ac63e7736;p=oota-llvm.git diff --git a/include/llvm/Support/Casting.h b/include/llvm/Support/Casting.h index fff44f6e642..48988f8a6bb 100644 --- a/include/llvm/Support/Casting.h +++ b/include/llvm/Support/Casting.h @@ -2,8 +2,8 @@ // // 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. // //===----------------------------------------------------------------------===// // @@ -221,7 +221,7 @@ inline typename cast_retty::ret_type cast_or_null(Y *Val) { // template -inline typename cast_retty::ret_type dyn_cast(Y Val) { +inline typename cast_retty::ret_type dyn_cast(const Y &Val) { return isa(Val) ? cast(Val) : 0; } @@ -229,13 +229,13 @@ inline typename cast_retty::ret_type dyn_cast(Y Val) { // value is accepted. // template -inline typename cast_retty::ret_type dyn_cast_or_null(Y Val) { +inline typename cast_retty::ret_type dyn_cast_or_null(const Y &Val) { return (Val && isa(Val)) ? cast(Val) : 0; } #ifdef DEBUG_CAST_OPERATORS -#include "llvm/Support/Debug.h" +#include "llvm/Support/Streams.h" struct bar { bar() {} @@ -245,13 +245,13 @@ private: 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(const bar &Val) { - llvm_cerr << "Classof: " << &Val << "\n"; + cerr << "Classof: " << &Val << "\n"; return true; }