From c4fd9afaf959309f9e522aae8facf936aaaf9ee4 Mon Sep 17 00:00:00 2001 From: Gabor Greif Date: Tue, 20 Jul 2010 17:20:25 +0000 Subject: [PATCH] remove testing cruft, this can be found in unittests/Support/Casting.cpp now git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108868 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Support/Casting.h | 67 ---------------------------------- 1 file changed, 67 deletions(-) diff --git a/include/llvm/Support/Casting.h b/include/llvm/Support/Casting.h index dccbfadfa30..c589171bbaf 100644 --- a/include/llvm/Support/Casting.h +++ b/include/llvm/Support/Casting.h @@ -236,73 +236,6 @@ 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/raw_ostream.h" - -struct bar { - bar() {} -private: - bar(const bar &); -}; -struct foo { - void ext() const; - /* static bool classof(const bar *X) { - cerr << "Classof: " << X << "\n"; - return true; - }*/ -}; - -template <> struct isa_impl { - static inline bool doit(const bar &Val) { - dbgs() << "Classof: " << &Val << "\n"; - return true; - } -}; - - -bar *fub(); -void test(bar &B1, const bar *B2) { - // test various configurations of const - const bar &B3 = B1; - const bar *const B4 = B2; - - // test isa - if (!isa(B1)) return; - if (!isa(B2)) return; - if (!isa(B3)) return; - if (!isa(B4)) return; - - // test cast - foo &F1 = cast(B1); - const foo *F3 = cast(B2); - const foo *F4 = cast(B2); - const foo &F8 = cast(B3); - const foo *F9 = cast(B4); - foo *F10 = cast(fub()); - - // test cast_or_null - const foo *F11 = cast_or_null(B2); - const foo *F12 = cast_or_null(B2); - const foo *F13 = cast_or_null(B4); - const foo *F14 = cast_or_null(fub()); // Shouldn't print. - - // These lines are errors... - //foo *F20 = cast(B2); // Yields const foo* - //foo &F21 = cast(B3); // Yields const foo& - //foo *F22 = cast(B4); // Yields const foo* - //foo &F23 = cast_or_null(B1); - //const foo &F24 = cast_or_null(B3); -} - -bar *fub() { return 0; } -void main() { - bar B; - test(B, &B); -} - -#endif - } // End llvm namespace #endif -- 2.34.1