summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-04-20 23:59:00 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-04-20 23:59:00 +0000
commite9907ba16e6ba25305a3226afb667d28fca1a4a0 (patch)
tree18496821fa4a4594cbaed508827cad376b6fe5cc
parentc5d5340eeb6ffeb2e476235100d439811357b8b7 (diff)
downloadbcm5719-llvm-e9907ba16e6ba25305a3226afb667d28fca1a4a0.tar.gz
bcm5719-llvm-e9907ba16e6ba25305a3226afb667d28fca1a4a0.zip
Protect the ArgList dtor
It could even be made non-virtual if it weren't for bad compiler warnings. This demonstrates that ArgList objects aren't destroyed polymorphically and possibly that they aren't even used polymorphically. If that's the case, it might be possible to refactor the two ArgList types more separately and simplify the Arg ownership model. *continues experimenting* llvm-svn: 206727
-rw-r--r--llvm/include/llvm/Option/ArgList.h8
-rw-r--r--llvm/lib/Option/ArgList.cpp5
2 files changed, 6 insertions, 7 deletions
diff --git a/llvm/include/llvm/Option/ArgList.h b/llvm/include/llvm/Option/ArgList.h
index 25248f444dd..ab40a1a0d40 100644
--- a/llvm/include/llvm/Option/ArgList.h
+++ b/llvm/include/llvm/Option/ArgList.h
@@ -106,10 +106,14 @@ private:
arglist_type Args;
protected:
- ArgList();
+ // Default ctor provided explicitly as it is not provided implicitly due to
+ // the presence of the (deleted) copy ctor above.
+ ArgList() { }
+ // Virtual to provide a vtable anchor and because -Wnon-virtua-dtor warns, not
+ // because this type is ever actually destroyed polymorphically.
+ virtual ~ArgList();
public:
- virtual ~ArgList();
/// @name Arg Access
/// @{
diff --git a/llvm/lib/Option/ArgList.cpp b/llvm/lib/Option/ArgList.cpp
index 2d65c5ac870..1f16331e079 100644
--- a/llvm/lib/Option/ArgList.cpp
+++ b/llvm/lib/Option/ArgList.cpp
@@ -33,11 +33,6 @@ void arg_iterator::SkipToNextArg() {
}
}
-//
-
-ArgList::ArgList() {
-}
-
ArgList::~ArgList() {
}
OpenPOWER on IntegriCloud