[llvm-commits] [llvm] r108868 - /llvm/trunk/include/llvm/Support/Casting.h
Gabor Greif
ggreif at gmail.com
Tue Jul 20 10:20:25 PDT 2010
Author: ggreif
Date: Tue Jul 20 12:20:25 2010
New Revision: 108868
URL: http://llvm.org/viewvc/llvm-project?rev=108868&view=rev
Log:
remove testing cruft, this can be found in unittests/Support/Casting.cpp now
Modified:
llvm/trunk/include/llvm/Support/Casting.h
Modified: llvm/trunk/include/llvm/Support/Casting.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Casting.h?rev=108868&r1=108867&r2=108868&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/Casting.h (original)
+++ llvm/trunk/include/llvm/Support/Casting.h Tue Jul 20 12:20:25 2010
@@ -236,73 +236,6 @@
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
More information about the llvm-commits
mailing list