git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240238
91177308-0d34-0410-b5e6-
96231b3b80d8
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Twine.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Twine.h"
+#include "llvm/Option/Arg.h"
#include "llvm/Option/OptSpecifier.h"
#include "llvm/Option/Option.h"
#include <list>
#include "llvm/Option/OptSpecifier.h"
#include "llvm/Option/Option.h"
#include <list>
namespace llvm {
namespace opt {
namespace llvm {
namespace opt {
class ArgList;
class Option;
class ArgList;
class Option;
protected:
// Default ctor provided explicitly as it is not provided implicitly due to
// the presence of the (deleted) copy ctor above.
protected:
// 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();
+ ArgList() = default;
+ // Protect the dtor to ensure this type is never destroyed polymorphically.
+ ~ArgList() = default;
-class InputArgList : public ArgList {
+class InputArgList final : public ArgList {
private:
/// List of argument strings used by the contained Args.
///
private:
/// List of argument strings used by the contained Args.
///
public:
InputArgList(const char* const *ArgBegin, const char* const *ArgEnd);
public:
InputArgList(const char* const *ArgBegin, const char* const *ArgEnd);
- ~InputArgList() override;
const char *getArgString(unsigned Index) const override {
return ArgStrings[Index];
const char *getArgString(unsigned Index) const override {
return ArgStrings[Index];
/// DerivedArgList - An ordered collection of driver arguments,
/// whose storage may be in another argument list.
/// DerivedArgList - An ordered collection of driver arguments,
/// whose storage may be in another argument list.
-class DerivedArgList : public ArgList {
+class DerivedArgList final : public ArgList {
const InputArgList &BaseArgs;
/// The list of arguments we synthesized.
const InputArgList &BaseArgs;
/// The list of arguments we synthesized.
public:
/// Construct a new derived arg list from \p BaseArgs.
DerivedArgList(const InputArgList &BaseArgs);
public:
/// Construct a new derived arg list from \p BaseArgs.
DerivedArgList(const InputArgList &BaseArgs);
- ~DerivedArgList() override;
const char *getArgString(unsigned Index) const override {
return BaseArgs.getArgString(Index);
const char *getArgString(unsigned Index) const override {
return BaseArgs.getArgString(Index);
-ArgList::~ArgList() {
-}
-
void ArgList::append(Arg *A) {
Args.push_back(A);
}
void ArgList::append(Arg *A) {
Args.push_back(A);
}
DerivedArgList::DerivedArgList(const InputArgList &BaseArgs)
: BaseArgs(BaseArgs) {}
DerivedArgList::DerivedArgList(const InputArgList &BaseArgs)
: BaseArgs(BaseArgs) {}
-DerivedArgList::~DerivedArgList() {}
-
const char *DerivedArgList::MakeArgStringRef(StringRef Str) const {
return BaseArgs.MakeArgString(Str);
}
const char *DerivedArgList::MakeArgStringRef(StringRef Str) const {
return BaseArgs.MakeArgString(Str);
}