summaryrefslogtreecommitdiff
path: root/include/llvm/Support/Casting.h
diff options
context:
space:
mode:
authorGabor Greif <ggreif@gmail.com>2010-07-20 17:20:25 +0000
committerGabor Greif <ggreif@gmail.com>2010-07-20 17:20:25 +0000
commitc4fd9afaf959309f9e522aae8facf936aaaf9ee4 (patch)
tree3129d0f79a8c5ceb639268906211297f1ad1d0fd /include/llvm/Support/Casting.h
parent43ef3fbae12c7924a25df4563d86084973db9c67 (diff)
downloadllvm-c4fd9afaf959309f9e522aae8facf936aaaf9ee4.tar.gz
llvm-c4fd9afaf959309f9e522aae8facf936aaaf9ee4.tar.bz2
llvm-c4fd9afaf959309f9e522aae8facf936aaaf9ee4.tar.xz
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
Diffstat (limited to 'include/llvm/Support/Casting.h')
-rw-r--r--include/llvm/Support/Casting.h67
1 files changed, 0 insertions, 67 deletions
diff --git a/include/llvm/Support/Casting.h b/include/llvm/Support/Casting.h
index dccbfadfa3..c589171bba 100644
--- a/include/llvm/Support/Casting.h
+++ b/include/llvm/Support/Casting.h
@@ -236,73 +236,6 @@ 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/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<foo,bar> {
- 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<foo>(B1)) return;
- if (!isa<foo>(B2)) return;
- if (!isa<foo>(B3)) return;
- if (!isa<foo>(B4)) return;
-
- // test cast
- foo &F1 = cast<foo>(B1);
- const foo *F3 = cast<foo>(B2);
- const foo *F4 = cast<foo>(B2);
- const foo &F8 = cast<foo>(B3);
- const foo *F9 = cast<foo>(B4);
- foo *F10 = cast<foo>(fub());
-
- // test cast_or_null
- const foo *F11 = cast_or_null<foo>(B2);
- const foo *F12 = cast_or_null<foo>(B2);
- const foo *F13 = cast_or_null<foo>(B4);
- const foo *F14 = cast_or_null<foo>(fub()); // Shouldn't print.
-
- // These lines are errors...
- //foo *F20 = cast<foo>(B2); // Yields const foo*
- //foo &F21 = cast<foo>(B3); // Yields const foo&
- //foo *F22 = cast<foo>(B4); // Yields const foo*
- //foo &F23 = cast_or_null<foo>(B1);
- //const foo &F24 = cast_or_null<foo>(B3);
-}
-
-bar *fub() { return 0; }
-void main() {
- bar B;
- test(B, &B);
-}
-
-#endif
-
} // End llvm namespace
#endif