[PATCH] D48807: Add llvm::Any

Zachary Turner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 3 10:39:01 PDT 2018


zturner added a comment.

In https://reviews.llvm.org/D48807#1151011, @timshen wrote:

> Aren't virtual functions exactly for homogeneous operations over sub-classes?
>
>   unique_ptr<EventBase> Event = waitForEvent();
>   const EXCEPTION_RECORD *E;
>   switch (Event->Type) {
>   case EventBase::Breakpoint:
>   case EventBase::ArithmeticError:
>   case EventBase::IllegalInstruction:
>   case EventBase::InvalidMemoryReference:
>     E = Event->getPlatformPiece();  // getPlatformPiece() is a virtual function in EventBase.
>     break;
>   }
>


And what type does it return?


https://reviews.llvm.org/D48807





More information about the llvm-commits mailing list