aboutsummaryrefslogtreecommitdiff
path: root/lib/VMCore/User.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-10-24 00:30:41 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-10-24 00:30:41 +0000
commit30f57da439dc6313e8704dec09da0a3789060608 (patch)
tree75a8feb8b90784ac98ad731d7fe1d615c3214033 /lib/VMCore/User.cpp
parenta6cf7a62a7adc45680597ae2630a268d8d548517 (diff)
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
Diffstat (limited to 'lib/VMCore/User.cpp')
-rw-r--r--lib/VMCore/User.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/VMCore/User.cpp b/lib/VMCore/User.cpp
index 5f35ce4b9a..e847ce6ee5 100644
--- a/lib/VMCore/User.cpp
+++ b/lib/VMCore/User.cpp
@@ -10,6 +10,7 @@
#include "llvm/Constant.h"
#include "llvm/GlobalValue.h"
#include "llvm/User.h"
+#include "llvm/Operator.h"
namespace llvm {
@@ -78,4 +79,12 @@ void User::operator delete(void *Usr) {
::operator delete(Storage);
}
+//===----------------------------------------------------------------------===//
+// Operator Class
+//===----------------------------------------------------------------------===//
+
+Operator::~Operator() {
+ llvm_unreachable("should never destroy an Operator");
+}
+
} // End llvm namespace