Skip to content

Commit 49a706d

Browse files
committed
MCSpecifierExpr: Make dtor defaulted
1 parent 8eac7f5 commit 49a706d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

llvm/include/llvm/MC/MCExpr.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,9 @@ class LLVM_ABI MCTargetExpr : public MCExpr {
506506
/// Extension point for target-specific MCExpr subclasses with a relocation
507507
/// specifier, serving as a replacement for MCSymbolRefExpr::VariantKind.
508508
/// Limit this to top-level use, avoiding its inclusion as a subexpression.
509+
///
510+
/// NOTE: All subclasses are required to have trivial destructors because
511+
/// MCExprs are bump pointer allocated and not destructed.
509512
class LLVM_ABI MCSpecifierExpr : public MCExpr {
510513
protected:
511514
using Spec = uint16_t;
@@ -516,7 +519,7 @@ class LLVM_ABI MCSpecifierExpr : public MCExpr {
516519
protected:
517520
explicit MCSpecifierExpr(const MCExpr *Expr, Spec S)
518521
: MCExpr(Specifier, SMLoc()), Expr(Expr), specifier(S) {}
519-
virtual ~MCSpecifierExpr();
522+
virtual ~MCSpecifierExpr() = default;
520523

521524
public:
522525
Spec getSpecifier() const { return specifier; }

llvm/lib/MC/MCExpr.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -767,8 +767,6 @@ MCFragment *MCExpr::findAssociatedFragment() const {
767767
llvm_unreachable("Invalid assembly expression kind!");
768768
}
769769

770-
MCSpecifierExpr::~MCSpecifierExpr() {}
771-
772770
bool MCSpecifierExpr::evaluateAsRelocatableImpl(MCValue &Res,
773771
const MCAssembler *Asm) const {
774772
if (!getSubExpr()->evaluateAsRelocatable(Res, Asm))

0 commit comments

Comments
 (0)