Commit 064c3833 authored by Florian Sattler's avatar Florian Sattler Committed by Commit Bot

[cleanup] Refactor torque compiler to use default members.

Fixing clang-tidy warning.

Bug: v8:8015
Change-Id: I9f76c7d530b22a030c9969dfee821e0896c358fb
Reviewed-on: https://chromium-review.googlesource.com/1224171
Commit-Queue: Florian Sattler <sattlerf@google.com>
Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55989}
parent 5e16d3ba
...@@ -90,7 +90,7 @@ struct AstNode { ...@@ -90,7 +90,7 @@ struct AstNode {
}; };
AstNode(Kind kind, SourcePosition pos) : kind(kind), pos(pos) {} AstNode(Kind kind, SourcePosition pos) : kind(kind), pos(pos) {}
virtual ~AstNode() {} virtual ~AstNode() = default;
const Kind kind; const Kind kind;
SourcePosition pos; SourcePosition pos;
......
...@@ -24,7 +24,7 @@ class Generic; ...@@ -24,7 +24,7 @@ class Generic;
class Declarable { class Declarable {
public: public:
virtual ~Declarable() {} virtual ~Declarable() = default;
enum Kind { enum Kind {
kVariable, kVariable,
kParameter, kParameter,
......
...@@ -219,7 +219,7 @@ class Declarations::ScopedGenericScopeChainSnapshot { ...@@ -219,7 +219,7 @@ class Declarations::ScopedGenericScopeChainSnapshot {
ScopedGenericScopeChainSnapshot(Declarations* declarations, ScopedGenericScopeChainSnapshot(Declarations* declarations,
const SpecializationKey& key) const SpecializationKey& key)
: restorer_(declarations->generic_declaration_scopes_[key.first]) {} : restorer_(declarations->generic_declaration_scopes_[key.first]) {}
~ScopedGenericScopeChainSnapshot() {} ~ScopedGenericScopeChainSnapshot() = default;
private: private:
ScopeChain::ScopedSnapshotRestorer restorer_; ScopeChain::ScopedSnapshotRestorer restorer_;
......
...@@ -29,7 +29,7 @@ DECLARE_CONTEXTUAL_VARIABLE(CurrentSourcePosition, SourcePosition) ...@@ -29,7 +29,7 @@ DECLARE_CONTEXTUAL_VARIABLE(CurrentSourcePosition, SourcePosition)
class SourceFileMap : public ContextualClass<SourceFileMap> { class SourceFileMap : public ContextualClass<SourceFileMap> {
public: public:
SourceFileMap() {} SourceFileMap() = default;
static const std::string& GetSource(SourceId source) { static const std::string& GetSource(SourceId source) {
return Get().sources_[source.id_]; return Get().sources_[source.id_];
} }
......
...@@ -44,7 +44,7 @@ class TypeBase { ...@@ -44,7 +44,7 @@ class TypeBase {
kUnionType, kUnionType,
kStructType kStructType
}; };
virtual ~TypeBase() {} virtual ~TypeBase() = default;
bool IsAbstractType() const { return kind() == Kind::kAbstractType; } bool IsAbstractType() const { return kind() == Kind::kAbstractType; }
bool IsFunctionPointerType() const { bool IsFunctionPointerType() const {
return kind() == Kind::kFunctionPointerType; return kind() == Kind::kFunctionPointerType;
...@@ -344,7 +344,7 @@ inline std::ostream& operator<<(std::ostream& os, const Type& t) { ...@@ -344,7 +344,7 @@ inline std::ostream& operator<<(std::ostream& os, const Type& t) {
class VisitResult { class VisitResult {
public: public:
VisitResult() {} VisitResult() = default;
VisitResult(const Type* type, const std::string& value) VisitResult(const Type* type, const std::string& value)
: type_(type), value_(value), declarable_{} {} : type_(type), value_(value), declarable_{} {}
VisitResult(const Type* type, const Value* declarable); VisitResult(const Type* type, const Value* declarable);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment