[llvm] r254592 - Fix class SCEVPredicate has virtual functions and accessible non-virtual destructor.
David Blaikie via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 3 08:29:26 PST 2015
On Thu, Dec 3, 2015 at 12:20 AM, Andy Gibbs via llvm-commits <
llvm-commits at lists.llvm.org> wrote:
> Author: andyg
> Date: Thu Dec 3 02:20:20 2015
> New Revision: 254592
>
> URL: http://llvm.org/viewvc/llvm-project?rev=254592&view=rev
> Log:
> Fix class SCEVPredicate has virtual functions and accessible non-virtual
> destructor.
>
Wait - why did the dtor need to be made virtual at all? These objects are
never destroyed polymorphically, so far as I can tell.
Could we just disable the GCC warning that was firing here instead? (if I
understand correctly and this was a GCC warning)
>
> It is not enough to simply make the destructor virtual since there is a
> g++ 4.7
> issue (see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53613) that
> throws the
> error "looser throw specifier for ... overridding ~SCEVPredicate()
> noexcept".
>
> Modified:
> llvm/trunk/include/llvm/Analysis/ScalarEvolution.h
> llvm/trunk/lib/Analysis/ScalarEvolution.cpp
>
> Modified: llvm/trunk/include/llvm/Analysis/ScalarEvolution.h
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ScalarEvolution.h?rev=254592&r1=254591&r2=254592&view=diff
>
> ==============================================================================
> --- llvm/trunk/include/llvm/Analysis/ScalarEvolution.h (original)
> +++ llvm/trunk/include/llvm/Analysis/ScalarEvolution.h Thu Dec 3 02:20:20
> 2015
> @@ -183,7 +183,7 @@ namespace llvm {
>
> protected:
> SCEVPredicateKind Kind;
> - ~SCEVPredicate() = default;
> + virtual ~SCEVPredicate();
> SCEVPredicate(const SCEVPredicate&) = default;
> SCEVPredicate &operator=(const SCEVPredicate&) = default;
>
>
> Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=254592&r1=254591&r2=254592&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
> +++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Thu Dec 3 02:20:20 2015
> @@ -9643,6 +9643,8 @@ SCEVPredicate::SCEVPredicate(const Foldi
> SCEVPredicateKind Kind)
> : FastID(ID), Kind(Kind) {}
>
> +SCEVPredicate::~SCEVPredicate() {}
> +
> SCEVEqualPredicate::SCEVEqualPredicate(const FoldingSetNodeIDRef ID,
> const SCEVUnknown *LHS,
> const SCEVConstant *RHS)
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151203/36634de2/attachment.html>
More information about the llvm-commits
mailing list