Remove empty non-virtual destructors or mark them =default when non-public

These add no value but can make a class non-trivially copyable. NFC.

llvm-svn: 234689
This commit is contained in:
Benjamin Kramer 2015-04-11 15:58:30 +00:00
parent dd0ff85701
commit 8017237277
15 changed files with 8 additions and 33 deletions

View File

@ -159,7 +159,7 @@ private:
const BaseOffsetsMapTy& BaseOffsets,
const VBaseOffsetsMapTy& VBaseOffsets);
~ASTRecordLayout() {}
~ASTRecordLayout() = default;
void Destroy(ASTContext &Ctx);

View File

@ -111,7 +111,7 @@ class VariantMatcher {
ArrayRef<VariantMatcher> InnerMatchers) const;
protected:
~MatcherOps() {}
~MatcherOps() = default;
private:
ast_type_traits::ASTNodeKind NodeKind;

View File

@ -44,8 +44,6 @@ public:
llvm::ImmutableSet<const VarDecl *> LiveDecls)
: liveStmts(LiveStmts), liveDecls(LiveDecls) {}
~LivenessValues() {}
bool isLive(const Stmt *S) const;
bool isLive(const VarDecl *D) const;

View File

@ -493,7 +493,6 @@ public:
: Elements(C), Label(nullptr), Terminator(nullptr), LoopTarget(nullptr),
BlockID(blockid), Preds(C, 1), Succs(C, 1), HasNoReturnElement(false),
Parent(parent) {}
~CFGBlock() {}
// Statement iterators
typedef ElementList::iterator iterator;

View File

@ -88,17 +88,12 @@ class LineTableInfo {
/// at which they occur in the file).
std::map<FileID, std::vector<LineEntry> > LineEntries;
public:
LineTableInfo() {
}
void clear() {
FilenameIDs.clear();
FilenamesByID.clear();
LineEntries.clear();
}
~LineTableInfo() {}
unsigned getLineTableFilenameID(StringRef Str);
const char *getFilename(unsigned ID) const {
assert(ID < FilenamesByID.size() && "Invalid FilenameID");

View File

@ -56,7 +56,8 @@ class MacroArgs {
MacroArgs(unsigned NumToks, bool varargsElided)
: NumUnexpArgTokens(NumToks), VarargsElided(varargsElided),
ArgCache(nullptr) {}
~MacroArgs() {}
~MacroArgs() = default;
public:
/// MacroArgs ctor function - Create a new MacroArgs object with the specified
/// macro and argument info.

View File

@ -109,7 +109,7 @@ class MacroInfo {
// Only the Preprocessor gets to create and destroy these.
MacroInfo(SourceLocation DefLoc);
~MacroInfo() {}
~MacroInfo() = default;
public:
/// \brief Return the location that the macro was defined at.

View File

@ -449,7 +449,7 @@ private:
const char **Annotations, unsigned NumAnnotations,
StringRef ParentName,
const char *BriefComment);
~CodeCompletionString() { }
~CodeCompletionString() = default;
friend class CodeCompletionBuilder;
friend class CodeCompletionResult;

View File

@ -106,7 +106,6 @@ private:
public:
EnvironmentManager(llvm::BumpPtrAllocator& Allocator) : F(Allocator) {}
~EnvironmentManager() {}
Environment getInitialEnvironment() {
return Environment(F.getEmptyMap());

View File

@ -127,8 +127,6 @@ public:
: Location(loc), State(state), Succs(IsSink) {
assert(isSink() == IsSink);
}
~ExplodedNode() {}
/// getLocation - Returns the edge associated with the given node.
ProgramPoint getLocation() const { return Location; }

View File

@ -589,8 +589,6 @@ public:
: LCtx(Ctx), Loc(s), SymMgr(symmgr),
reapedStore(nullptr, storeMgr) {}
~SymbolReaper() {}
const LocationContext *getLocationContext() const { return LCtx; }
bool isLive(SymbolRef sym);

View File

@ -486,7 +486,6 @@ public:
}
ObjCCommonTypesHelper(CodeGen::CodeGenModule &cgm);
~ObjCCommonTypesHelper(){}
};
/// ObjCTypesHelper - Helper class that encapsulates lazy
@ -595,7 +594,6 @@ public:
public:
ObjCTypesHelper(CodeGen::CodeGenModule &cgm);
~ObjCTypesHelper() {}
};
/// ObjCNonFragileABITypesHelper - will have all types needed by objective-c's
@ -733,7 +731,6 @@ public:
llvm::Type *EHTypePtrTy;
ObjCNonFragileABITypesHelper(CodeGen::CodeGenModule &cgm);
~ObjCNonFragileABITypesHelper(){}
};
class CGObjCCommonMac : public CodeGen::CGObjCRuntime {

View File

@ -44,8 +44,6 @@ public:
Diagnostics->setClient(new IgnoringDiagConsumer, true);
}
~SimpleFormatContext() { }
FileID createInMemoryFile(StringRef Name, StringRef Content) {
std::unique_ptr<llvm::MemoryBuffer> Source =
llvm::MemoryBuffer::getMemBuffer(Content);

View File

@ -89,9 +89,9 @@ namespace {
bool IsLeaf;
RopePieceBTreeNode(bool isLeaf) : Size(0), IsLeaf(isLeaf) {}
~RopePieceBTreeNode() {}
public:
~RopePieceBTreeNode() = default;
public:
bool isLeaf() const { return IsLeaf; }
unsigned size() const { return Size; }

View File

@ -1563,8 +1563,6 @@ std::pair<Type, std::string> Intrinsic::DagEmitter::emitDagShuffle(DagInit *DI){
// See the documentation in arm_neon.td for a description of these operators.
class LowHalf : public SetTheory::Operator {
public:
void anchor() override {}
~LowHalf() override {}
void apply(SetTheory &ST, DagInit *Expr, SetTheory::RecSet &Elts,
ArrayRef<SMLoc> Loc) override {
SetTheory::RecSet Elts2;
@ -1574,8 +1572,6 @@ std::pair<Type, std::string> Intrinsic::DagEmitter::emitDagShuffle(DagInit *DI){
};
class HighHalf : public SetTheory::Operator {
public:
void anchor() override {}
~HighHalf() override {}
void apply(SetTheory &ST, DagInit *Expr, SetTheory::RecSet &Elts,
ArrayRef<SMLoc> Loc) override {
SetTheory::RecSet Elts2;
@ -1588,8 +1584,6 @@ std::pair<Type, std::string> Intrinsic::DagEmitter::emitDagShuffle(DagInit *DI){
public:
Rev(unsigned ElementSize) : ElementSize(ElementSize) {}
void anchor() override {}
~Rev() override {}
void apply(SetTheory &ST, DagInit *Expr, SetTheory::RecSet &Elts,
ArrayRef<SMLoc> Loc) override {
SetTheory::RecSet Elts2;
@ -1613,8 +1607,6 @@ std::pair<Type, std::string> Intrinsic::DagEmitter::emitDagShuffle(DagInit *DI){
public:
MaskExpander(unsigned N) : N(N) {}
void anchor() override {}
~MaskExpander() override {}
void expand(SetTheory &ST, Record *R, SetTheory::RecSet &Elts) override {
unsigned Addend = 0;
if (R->getName() == "mask0")