[llvm-commits] [llvm] r166089 - /llvm/trunk/include/llvm/Operator.h
Craig Topper
craig.topper at gmail.com
Tue Oct 16 22:15:58 PDT 2012
Author: ctopper
Date: Wed Oct 17 00:15:58 2012
New Revision: 166089
URL: http://llvm.org/viewvc/llvm-project?rev=166089&view=rev
Log:
Remove LLVM_DELETED_FUNCTION from destructors that override non-deleted base class destructors. This isn't legal by the C++11 standard and clang now checks for it. Curiously gcc didn't catch this, possibly because of the template usage.
Modified:
llvm/trunk/include/llvm/Operator.h
Modified: llvm/trunk/include/llvm/Operator.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Operator.h?rev=166089&r1=166088&r2=166089&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Operator.h (original)
+++ llvm/trunk/include/llvm/Operator.h Wed Oct 17 00:15:58 2012
@@ -36,8 +36,8 @@
void *operator new(size_t, unsigned) LLVM_DELETED_FUNCTION;
void *operator new(size_t s) LLVM_DELETED_FUNCTION;
Operator() LLVM_DELETED_FUNCTION;
- // NOTE: cannot use LLVM_DELETED_FUNCTION because gcc errors when deleting
- // an override of a non-deleted function.
+ // NOTE: cannot use LLVM_DELETED_FUNCTION because it's not legal to delete
+ // an overridden method that's not deleted in the base class.
~Operator();
public:
@@ -191,7 +191,7 @@
/// opcodes.
template<typename SuperClass, unsigned Opc>
class ConcreteOperator : public SuperClass {
- ~ConcreteOperator() LLVM_DELETED_FUNCTION;
+ ~ConcreteOperator(); // DO NOT IMPLEMENT
public:
static inline bool classof(const Instruction *I) {
return I->getOpcode() == Opc;
@@ -207,44 +207,44 @@
class AddOperator
: public ConcreteOperator<OverflowingBinaryOperator, Instruction::Add> {
- ~AddOperator() LLVM_DELETED_FUNCTION;
+ ~AddOperator(); // DO NOT IMPLEMENT
};
class SubOperator
: public ConcreteOperator<OverflowingBinaryOperator, Instruction::Sub> {
- ~SubOperator() LLVM_DELETED_FUNCTION;
+ ~SubOperator(); // DO NOT IMPLEMENT
};
class MulOperator
: public ConcreteOperator<OverflowingBinaryOperator, Instruction::Mul> {
- ~MulOperator() LLVM_DELETED_FUNCTION;
+ ~MulOperator(); // DO NOT IMPLEMENT
};
class ShlOperator
: public ConcreteOperator<OverflowingBinaryOperator, Instruction::Shl> {
- ~ShlOperator() LLVM_DELETED_FUNCTION;
+ ~ShlOperator(); // DO NOT IMPLEMENT
};
-
+
class SDivOperator
: public ConcreteOperator<PossiblyExactOperator, Instruction::SDiv> {
- ~SDivOperator() LLVM_DELETED_FUNCTION;
+ ~SDivOperator(); // DO NOT IMPLEMENT
};
class UDivOperator
: public ConcreteOperator<PossiblyExactOperator, Instruction::UDiv> {
- ~UDivOperator() LLVM_DELETED_FUNCTION;
+ ~UDivOperator(); // DO NOT IMPLEMENT
};
class AShrOperator
: public ConcreteOperator<PossiblyExactOperator, Instruction::AShr> {
- ~AShrOperator() LLVM_DELETED_FUNCTION;
+ ~AShrOperator(); // DO NOT IMPLEMENT
};
class LShrOperator
: public ConcreteOperator<PossiblyExactOperator, Instruction::LShr> {
- ~LShrOperator() LLVM_DELETED_FUNCTION;
+ ~LShrOperator(); // DO NOT IMPLEMENT
};
-
-
-
+
+
+
class GEPOperator
: public ConcreteOperator<Operator, Instruction::GetElementPtr> {
- ~GEPOperator() LLVM_DELETED_FUNCTION;
+ ~GEPOperator(); // DO NOT IMPLEMENT
enum {
IsInBounds = (1 << 0)
More information about the llvm-commits
mailing list