Fix ODR violations: a virtual function must be defined, even if it's never
authorRichard Smith <richard-llvm@metafoo.co.uk>
Wed, 24 Oct 2012 00:30:41 +0000 (00:30 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Wed, 24 Oct 2012 00:30:41 +0000 (00:30 +0000)
commit30f57da439dc6313e8704dec09da0a3789060608
tree75a8feb8b90784ac98ad731d7fe1d615c3214033
parenta6cf7a62a7adc45680597ae2630a268d8d548517
Fix ODR violations: a virtual function must be defined, even if it's never
called. Provide an (asserting) definition of Operator's private destructor.
Remove destructors from all classes derived from Operator. We don't need them
for safety, because their implicit definitions would be ill-formed (they'd call
Operator's private destructor), and we don't need them to avoid emitting
vtables, because we don't do anything with Operator subclasses which would
trigger vtable instantiation.

The Operator hierarchy is still a complete disaster with regard to undefined
behavior, but this at least allows LLVM to link when using Clang's
-fcatch-undefined-behavior with a new vptr-based type checking mechanism.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166530 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Operator.h
lib/VMCore/User.cpp