From: Chris Lattner Date: Wed, 24 Jul 2002 20:22:09 +0000 (+0000) Subject: Add missing typename's that GCC3.1 is whining about. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=5a6d63ae29512d654c8c697f42f32f97b9dc010b;p=oota-llvm.git Add missing typename's that GCC3.1 is whining about. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3051 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/Support/Casting.h b/include/Support/Casting.h index 2c072d1bb44..e0d50fe5d55 100644 --- a/include/Support/Casting.h +++ b/include/Support/Casting.h @@ -71,7 +71,7 @@ struct isa_impl_cl { template static bool isa(const FromCl &Val) { return isa_impl_wrap::SimpleType>::doit(Val); + typename simplify_type::SimpleType>::doit(Val); } }; @@ -153,7 +153,7 @@ struct cast_retty_wrap { template struct cast_retty { typedef typename cast_retty_wrap::SimpleType>::ret_type ret_type; + typename simplify_type::SimpleType>::ret_type ret_type; }; // Ensure the non-simple values are converted using the simplify_type template @@ -161,17 +161,17 @@ struct cast_retty { // template struct cast_convert_val { // This is not a simple type, use the template to simplify it... - static cast_retty::ret_type doit(const From &Val) { + static typename cast_retty::ret_type doit(const From &Val) { return cast_convert_val::SimpleType>::doit( + typename simplify_type::SimpleType>::doit( simplify_type::getSimplifiedValue(Val)); } }; template struct cast_convert_val { // This _is_ a simple type, just cast it. - static cast_retty::ret_type doit(const FromTy &Val) { - return (cast_retty::ret_type)Val; + static typename cast_retty::ret_type doit(const FromTy &Val) { + return (typename cast_retty::ret_type)Val; } }; @@ -185,16 +185,17 @@ template struct cast_convert_val { // cast(myVal)->getParent() // template -inline cast_retty::ret_type cast(const Y &Val) { +inline typename cast_retty::ret_type cast(const Y &Val) { assert(isa(Val) && "cast() argument of uncompatible type!"); - return cast_convert_val::SimpleType>::doit(Val); + return cast_convert_val::SimpleType>::doit(Val); } // cast_or_null - Functionally identical to cast, except that a null value is // accepted. // template -inline cast_retty::ret_type cast_or_null(Y *Val) { +inline typename cast_retty::ret_type cast_or_null(Y *Val) { if (Val == 0) return 0; assert(isa(Val) && "cast_or_null() argument of uncompatible type!"); return cast(Val); @@ -210,7 +211,7 @@ inline cast_retty::ret_type cast_or_null(Y *Val) { // template -inline cast_retty::ret_type dyn_cast(Y *Val) { +inline typename cast_retty::ret_type dyn_cast(Y *Val) { return isa(Val) ? cast(Val) : 0; } @@ -218,7 +219,7 @@ inline cast_retty::ret_type dyn_cast(Y *Val) { // value is accepted. // template -inline cast_retty::ret_type dyn_cast_or_null(Y *Val) { +inline typename cast_retty::ret_type dyn_cast_or_null(Y *Val) { return (Val && isa(Val)) ? cast(Val) : 0; } diff --git a/include/llvm/Support/Casting.h b/include/llvm/Support/Casting.h index 2c072d1bb44..e0d50fe5d55 100644 --- a/include/llvm/Support/Casting.h +++ b/include/llvm/Support/Casting.h @@ -71,7 +71,7 @@ struct isa_impl_cl { template static bool isa(const FromCl &Val) { return isa_impl_wrap::SimpleType>::doit(Val); + typename simplify_type::SimpleType>::doit(Val); } }; @@ -153,7 +153,7 @@ struct cast_retty_wrap { template struct cast_retty { typedef typename cast_retty_wrap::SimpleType>::ret_type ret_type; + typename simplify_type::SimpleType>::ret_type ret_type; }; // Ensure the non-simple values are converted using the simplify_type template @@ -161,17 +161,17 @@ struct cast_retty { // template struct cast_convert_val { // This is not a simple type, use the template to simplify it... - static cast_retty::ret_type doit(const From &Val) { + static typename cast_retty::ret_type doit(const From &Val) { return cast_convert_val::SimpleType>::doit( + typename simplify_type::SimpleType>::doit( simplify_type::getSimplifiedValue(Val)); } }; template struct cast_convert_val { // This _is_ a simple type, just cast it. - static cast_retty::ret_type doit(const FromTy &Val) { - return (cast_retty::ret_type)Val; + static typename cast_retty::ret_type doit(const FromTy &Val) { + return (typename cast_retty::ret_type)Val; } }; @@ -185,16 +185,17 @@ template struct cast_convert_val { // cast(myVal)->getParent() // template -inline cast_retty::ret_type cast(const Y &Val) { +inline typename cast_retty::ret_type cast(const Y &Val) { assert(isa(Val) && "cast() argument of uncompatible type!"); - return cast_convert_val::SimpleType>::doit(Val); + return cast_convert_val::SimpleType>::doit(Val); } // cast_or_null - Functionally identical to cast, except that a null value is // accepted. // template -inline cast_retty::ret_type cast_or_null(Y *Val) { +inline typename cast_retty::ret_type cast_or_null(Y *Val) { if (Val == 0) return 0; assert(isa(Val) && "cast_or_null() argument of uncompatible type!"); return cast(Val); @@ -210,7 +211,7 @@ inline cast_retty::ret_type cast_or_null(Y *Val) { // template -inline cast_retty::ret_type dyn_cast(Y *Val) { +inline typename cast_retty::ret_type dyn_cast(Y *Val) { return isa(Val) ? cast(Val) : 0; } @@ -218,7 +219,7 @@ inline cast_retty::ret_type dyn_cast(Y *Val) { // value is accepted. // template -inline cast_retty::ret_type dyn_cast_or_null(Y *Val) { +inline typename cast_retty::ret_type dyn_cast_or_null(Y *Val) { return (Val && isa(Val)) ? cast(Val) : 0; }