Argyrios Kyrtzidis 8b6d86df06 Modifications to dyn_cast/cast to make them work for objects too, instead of only pointers.
The use case is if you have a wrapper class:

class Base {
  void *Ptr;
public:
  Base() : Ptr(0) { }
  operator bool() const { return Ptr; }
.....
}

and sub-wrappers that have exactly the same size:

class Sub : public Base {
public:
....
static bool classof(const Base*);
}

and in the code you would do:

void f(Base b) {
  Sub sub = dyn_cast<Sub>(b);
  if (sub) {
    ....
  }
}



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78424 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-07 22:49:24 +00:00
..
2009-02-20 22:51:36 +00:00
2009-07-07 17:32:34 +00:00
2009-07-29 18:55:55 +00:00
2009-07-20 16:50:16 +00:00
2009-05-30 21:05:47 +00:00
2009-02-20 22:51:36 +00:00
2009-03-10 15:56:48 +00:00
2009-07-15 22:43:51 +00:00
2009-02-20 22:51:36 +00:00
2009-07-27 19:45:28 +00:00
2009-07-29 18:55:55 +00:00
2009-07-29 18:55:55 +00:00
2009-07-30 18:21:23 +00:00
2009-02-20 22:51:36 +00:00
2009-07-29 22:17:13 +00:00