From 3a15e14520adfdddbf6657f878fe4c49fba41956 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Thu, 1 Dec 2011 08:00:17 +0000 Subject: [PATCH] Add some missing anchors. llvm-svn: 145578 --- llvm/include/llvm/InstrTypes.h | 1 + llvm/include/llvm/Support/CommandLine.h | 6 ++++++ llvm/include/llvm/User.h | 1 + llvm/lib/Support/CommandLine.cpp | 3 +++ llvm/lib/VMCore/Instructions.cpp | 2 ++ llvm/lib/VMCore/User.cpp | 2 ++ 6 files changed, 15 insertions(+) diff --git a/llvm/include/llvm/InstrTypes.h b/llvm/include/llvm/InstrTypes.h index a1492f3c141a..2529f24fe991 100644 --- a/llvm/include/llvm/InstrTypes.h +++ b/llvm/include/llvm/InstrTypes.h @@ -388,6 +388,7 @@ DEFINE_TRANSPARENT_OPERAND_ACCESSORS(BinaryOperator, Value) /// if (isa(Instr)) { ... } /// @brief Base class of casting instructions. class CastInst : public UnaryInstruction { + virtual void anchor(); protected: /// @brief Constructor with insert-before-instruction semantics for subclasses CastInst(Type *Ty, unsigned iType, Value *S, diff --git a/llvm/include/llvm/Support/CommandLine.h b/llvm/include/llvm/Support/CommandLine.h index c6b62a8df9a4..a2990e4eb31b 100644 --- a/llvm/include/llvm/Support/CommandLine.h +++ b/llvm/include/llvm/Support/CommandLine.h @@ -326,6 +326,8 @@ LocationClass location(Ty &L) { return LocationClass(L); } struct GenericOptionValue { virtual ~GenericOptionValue() {} virtual bool compare(const GenericOptionValue &V) const = 0; +private: + virtual void anchor(); }; template struct OptionValue; @@ -416,6 +418,8 @@ struct OptionValue : OptionValueCopy { setValue(V); return *this; } +private: + virtual void anchor(); }; template<> @@ -431,6 +435,8 @@ struct OptionValue : OptionValueCopy { setValue(V); return *this; } +private: + virtual void anchor(); }; //===----------------------------------------------------------------------===// diff --git a/llvm/include/llvm/User.h b/llvm/include/llvm/User.h index 62bc9f034618..d3f4f217b928 100644 --- a/llvm/include/llvm/User.h +++ b/llvm/include/llvm/User.h @@ -34,6 +34,7 @@ class User : public Value { void *operator new(size_t); // Do not implement template friend struct HungoffOperandTraits; + virtual void anchor(); protected: /// OperandList - This is a pointer to the array of Uses for this User. /// For nodes of fixed arity (e.g. a binary operator) this array will live diff --git a/llvm/lib/Support/CommandLine.cpp b/llvm/lib/Support/CommandLine.cpp index 4b43ae9cf24a..ce9344954bcc 100644 --- a/llvm/lib/Support/CommandLine.cpp +++ b/llvm/lib/Support/CommandLine.cpp @@ -57,6 +57,9 @@ TEMPLATE_INSTANTIATION(class opt); TEMPLATE_INSTANTIATION(class opt); } } // end namespace llvm::cl +void GenericOptionValue::anchor() {} +void OptionValue::anchor() {} +void OptionValue::anchor() {} void Option::anchor() {} void basic_parser_impl::anchor() {} void parser::anchor() {} diff --git a/llvm/lib/VMCore/Instructions.cpp b/llvm/lib/VMCore/Instructions.cpp index c8dcdc8ac39e..6fa904e4e44c 100644 --- a/llvm/lib/VMCore/Instructions.cpp +++ b/llvm/lib/VMCore/Instructions.cpp @@ -2005,6 +2005,8 @@ bool BinaryOperator::isExact() const { // CastInst Class //===----------------------------------------------------------------------===// +void CastInst::anchor() {} + // Just determine if this cast only deals with integral->integral conversion. bool CastInst::isIntegerCast() const { switch (getOpcode()) { diff --git a/llvm/lib/VMCore/User.cpp b/llvm/lib/VMCore/User.cpp index f01fa349adfd..5f35ce4b9a4f 100644 --- a/llvm/lib/VMCore/User.cpp +++ b/llvm/lib/VMCore/User.cpp @@ -17,6 +17,8 @@ namespace llvm { // User Class //===----------------------------------------------------------------------===// +void User::anchor() {} + // replaceUsesOfWith - Replaces all references to the "From" definition with // references to the "To" definition. //