[clang] d677a7c - [clang] Remove redundant member initialization (NFC)
Kazu Hirata via cfe-commits
cfe-commits at lists.llvm.org
Sun Jan 2 10:20:57 PST 2022
Author: Kazu Hirata
Date: 2022-01-02T10:20:23-08:00
New Revision: d677a7cb056b17145a50ec8ca2ab6d5f4c494749
URL: https://github.com/llvm/llvm-project/commit/d677a7cb056b17145a50ec8ca2ab6d5f4c494749
DIFF: https://github.com/llvm/llvm-project/commit/d677a7cb056b17145a50ec8ca2ab6d5f4c494749.diff
LOG: [clang] Remove redundant member initialization (NFC)
Identified with readability-redundant-member-init.
Added:
Modified:
clang/include/clang/APINotes/Types.h
clang/include/clang/AST/ASTConcept.h
clang/include/clang/AST/Comment.h
clang/include/clang/AST/DeclObjC.h
clang/include/clang/AST/Expr.h
clang/include/clang/ASTMatchers/Dynamic/Diagnostics.h
clang/include/clang/Analysis/Analyses/Consumed.h
clang/include/clang/Basic/Diagnostic.h
clang/include/clang/Basic/PartialDiagnostic.h
clang/include/clang/Sema/DeclSpec.h
clang/include/clang/Sema/Overload.h
clang/include/clang/Sema/Sema.h
clang/include/clang/StaticAnalyzer/Core/PathSensitive/DynamicTypeInfo.h
clang/lib/ARCMigrate/Internals.h
clang/lib/ARCMigrate/TransAutoreleasePool.cpp
clang/lib/AST/DeclCXX.cpp
clang/lib/AST/ExprConcepts.cpp
clang/lib/AST/ExprConstant.cpp
clang/lib/Analysis/CFG.cpp
clang/lib/Basic/TargetInfo.cpp
clang/lib/CodeGen/BackendUtil.cpp
clang/lib/CodeGen/CGCall.h
clang/lib/CodeGen/CGRecordLayout.h
clang/lib/CodeGen/CGStmtOpenMP.cpp
clang/lib/CodeGen/CodeGenFunction.h
clang/lib/CodeGen/CodeGenPGO.cpp
clang/lib/Driver/Driver.cpp
clang/lib/Frontend/MultiplexConsumer.cpp
clang/lib/Frontend/SerializedDiagnosticPrinter.cpp
clang/lib/Sema/AnalysisBasedWarnings.cpp
clang/lib/Sema/SemaChecking.cpp
clang/lib/Sema/SemaCodeComplete.cpp
clang/lib/Sema/SemaTemplateDeduction.cpp
clang/lib/StaticAnalyzer/Core/ProgramState.cpp
clang/tools/clang-offload-bundler/ClangOffloadBundler.cpp
clang/tools/libclang/CXIndexDataConsumer.h
clang/tools/libclang/CXLoadedDiagnostic.cpp
Removed:
################################################################################
diff --git a/clang/include/clang/APINotes/Types.h b/clang/include/clang/APINotes/Types.h
index 0d97e9ad86231..f741d9b91d764 100644
--- a/clang/include/clang/APINotes/Types.h
+++ b/clang/include/clang/APINotes/Types.h
@@ -133,7 +133,7 @@ class CommonTypeInfo : public CommonEntityInfo {
llvm::Optional<std::string> NSErrorDomain;
public:
- CommonTypeInfo() : CommonEntityInfo() {}
+ CommonTypeInfo() {}
const llvm::Optional<std::string> &getSwiftBridge() const {
return SwiftBridge;
@@ -208,10 +208,9 @@ class ObjCContextInfo : public CommonTypeInfo {
public:
ObjCContextInfo()
- : CommonTypeInfo(), HasDefaultNullability(0), DefaultNullability(0),
- HasDesignatedInits(0), SwiftImportAsNonGenericSpecified(false),
- SwiftImportAsNonGeneric(false), SwiftObjCMembersSpecified(false),
- SwiftObjCMembers(false) {}
+ : HasDefaultNullability(0), DefaultNullability(0), HasDesignatedInits(0),
+ SwiftImportAsNonGenericSpecified(false), SwiftImportAsNonGeneric(false),
+ SwiftObjCMembersSpecified(false), SwiftObjCMembers(false) {}
/// Determine the default nullability for properties and methods of this
/// class.
@@ -309,7 +308,7 @@ class VariableInfo : public CommonEntityInfo {
std::string Type;
public:
- VariableInfo() : CommonEntityInfo(), NullabilityAudited(false), Nullable(0) {}
+ VariableInfo() : NullabilityAudited(false), Nullable(0) {}
llvm::Optional<NullabilityKind> getNullability() const {
return NullabilityAudited ? llvm::Optional<NullabilityKind>(
@@ -358,8 +357,7 @@ class ObjCPropertyInfo : public VariableInfo {
public:
ObjCPropertyInfo()
- : VariableInfo(), SwiftImportAsAccessorsSpecified(false),
- SwiftImportAsAccessors(false) {}
+ : SwiftImportAsAccessorsSpecified(false), SwiftImportAsAccessors(false) {}
llvm::Optional<bool> getSwiftImportAsAccessors() const {
return SwiftImportAsAccessorsSpecified
@@ -423,8 +421,7 @@ class ParamInfo : public VariableInfo {
public:
ParamInfo()
- : VariableInfo(), NoEscapeSpecified(false), NoEscape(false),
- RawRetainCountConvention() {}
+ : NoEscapeSpecified(false), NoEscape(false), RawRetainCountConvention() {}
llvm::Optional<bool> isNoEscape() const {
if (!NoEscapeSpecified)
@@ -514,7 +511,7 @@ class FunctionInfo : public CommonEntityInfo {
std::vector<ParamInfo> Params;
FunctionInfo()
- : CommonEntityInfo(), NullabilityAudited(false), NumAdjustedNullable(0),
+ : NullabilityAudited(false), NumAdjustedNullable(0),
RawRetainCountConvention() {}
static unsigned getMaxNullabilityIndex() {
@@ -607,8 +604,7 @@ class ObjCMethodInfo : public FunctionInfo {
/// Whether this is a required initializer.
unsigned RequiredInit : 1;
- ObjCMethodInfo()
- : FunctionInfo(), DesignatedInit(false), RequiredInit(false) {}
+ ObjCMethodInfo() : DesignatedInit(false), RequiredInit(false) {}
friend bool operator==(const ObjCMethodInfo &, const ObjCMethodInfo &);
@@ -639,19 +635,19 @@ inline bool operator!=(const ObjCMethodInfo &LHS, const ObjCMethodInfo &RHS) {
/// Describes API notes data for a global variable.
class GlobalVariableInfo : public VariableInfo {
public:
- GlobalVariableInfo() : VariableInfo() {}
+ GlobalVariableInfo() {}
};
/// Describes API notes data for a global function.
class GlobalFunctionInfo : public FunctionInfo {
public:
- GlobalFunctionInfo() : FunctionInfo() {}
+ GlobalFunctionInfo() {}
};
/// Describes API notes data for an enumerator.
class EnumConstantInfo : public CommonEntityInfo {
public:
- EnumConstantInfo() : CommonEntityInfo() {}
+ EnumConstantInfo() {}
};
/// Describes API notes data for a tag.
@@ -662,7 +658,7 @@ class TagInfo : public CommonTypeInfo {
public:
llvm::Optional<EnumExtensibilityKind> EnumExtensibility;
- TagInfo() : CommonTypeInfo(), HasFlagEnum(0), IsFlagEnum(0) {}
+ TagInfo() : HasFlagEnum(0), IsFlagEnum(0) {}
llvm::Optional<bool> isFlagEnum() const {
if (HasFlagEnum)
@@ -706,7 +702,7 @@ class TypedefInfo : public CommonTypeInfo {
public:
llvm::Optional<SwiftNewTypeKind> SwiftWrapper;
- TypedefInfo() : CommonTypeInfo() {}
+ TypedefInfo() {}
TypedefInfo &operator|=(const TypedefInfo &RHS) {
static_cast<CommonTypeInfo &>(*this) |= RHS;
diff --git a/clang/include/clang/AST/ASTConcept.h b/clang/include/clang/AST/ASTConcept.h
index aba18b060b020..c9930844add80 100644
--- a/clang/include/clang/AST/ASTConcept.h
+++ b/clang/include/clang/AST/ASTConcept.h
@@ -123,17 +123,17 @@ class ConceptReference {
const ASTTemplateArgumentListInfo *ArgsAsWritten;
public:
-
ConceptReference(NestedNameSpecifierLoc NNS, SourceLocation TemplateKWLoc,
DeclarationNameInfo ConceptNameInfo, NamedDecl *FoundDecl,
ConceptDecl *NamedConcept,
- const ASTTemplateArgumentListInfo *ArgsAsWritten) :
- NestedNameSpec(NNS), TemplateKWLoc(TemplateKWLoc),
- ConceptName(ConceptNameInfo), FoundDecl(FoundDecl),
- NamedConcept(NamedConcept), ArgsAsWritten(ArgsAsWritten) {}
-
- ConceptReference() : NestedNameSpec(), TemplateKWLoc(), ConceptName(),
- FoundDecl(nullptr), NamedConcept(nullptr), ArgsAsWritten(nullptr) {}
+ const ASTTemplateArgumentListInfo *ArgsAsWritten)
+ : NestedNameSpec(NNS), TemplateKWLoc(TemplateKWLoc),
+ ConceptName(ConceptNameInfo), FoundDecl(FoundDecl),
+ NamedConcept(NamedConcept), ArgsAsWritten(ArgsAsWritten) {}
+
+ ConceptReference()
+ : TemplateKWLoc(), FoundDecl(nullptr), NamedConcept(nullptr),
+ ArgsAsWritten(nullptr) {}
const NestedNameSpecifierLoc &getNestedNameSpecifierLoc() const {
return NestedNameSpec;
diff --git a/clang/include/clang/AST/Comment.h b/clang/include/clang/AST/Comment.h
index 4184e103206dd..5ecc35791b7b0 100644
--- a/clang/include/clang/AST/Comment.h
+++ b/clang/include/clang/AST/Comment.h
@@ -424,19 +424,13 @@ class HTMLStartTagComment : public HTMLTagComment {
Attribute() { }
- Attribute(SourceLocation NameLocBegin, StringRef Name) :
- NameLocBegin(NameLocBegin), Name(Name),
- EqualsLoc(SourceLocation()),
- ValueRange(SourceRange()), Value(StringRef())
- { }
+ Attribute(SourceLocation NameLocBegin, StringRef Name)
+ : NameLocBegin(NameLocBegin), Name(Name), EqualsLoc(SourceLocation()) {}
Attribute(SourceLocation NameLocBegin, StringRef Name,
- SourceLocation EqualsLoc,
- SourceRange ValueRange, StringRef Value) :
- NameLocBegin(NameLocBegin), Name(Name),
- EqualsLoc(EqualsLoc),
- ValueRange(ValueRange), Value(Value)
- { }
+ SourceLocation EqualsLoc, SourceRange ValueRange, StringRef Value)
+ : NameLocBegin(NameLocBegin), Name(Name), EqualsLoc(EqualsLoc),
+ ValueRange(ValueRange), Value(Value) {}
SourceLocation getNameLocEnd() const {
return NameLocBegin.getLocWithOffset(Name.size());
diff --git a/clang/include/clang/AST/DeclObjC.h b/clang/include/clang/AST/DeclObjC.h
index 79ec1d6e5c3c2..f227561b8fcbc 100644
--- a/clang/include/clang/AST/DeclObjC.h
+++ b/clang/include/clang/AST/DeclObjC.h
@@ -779,17 +779,13 @@ class ObjCPropertyDecl : public NamedDecl {
LParenLoc(LParenLocation), DeclType(T), DeclTypeSourceInfo(TSI),
PropertyAttributes(ObjCPropertyAttribute::kind_noattr),
PropertyAttributesAsWritten(ObjCPropertyAttribute::kind_noattr),
- PropertyImplementation(propControl), GetterName(Selector()),
- SetterName(Selector()) {}
+ PropertyImplementation(propControl) {}
public:
- static ObjCPropertyDecl *Create(ASTContext &C, DeclContext *DC,
- SourceLocation L,
- IdentifierInfo *Id, SourceLocation AtLocation,
- SourceLocation LParenLocation,
- QualType T,
- TypeSourceInfo *TSI,
- PropertyControl propControl = None);
+ static ObjCPropertyDecl *
+ Create(ASTContext &C, DeclContext *DC, SourceLocation L, IdentifierInfo *Id,
+ SourceLocation AtLocation, SourceLocation LParenLocation, QualType T,
+ TypeSourceInfo *TSI, PropertyControl propControl = None);
static ObjCPropertyDecl *CreateDeserialized(ASTContext &C, unsigned ID);
diff --git a/clang/include/clang/AST/Expr.h b/clang/include/clang/AST/Expr.h
index e2c36e12393fa..c32e74ac76ee4 100644
--- a/clang/include/clang/AST/Expr.h
+++ b/clang/include/clang/AST/Expr.h
@@ -2388,7 +2388,7 @@ class OffsetOfNode {
/// Create an offsetof node that refers into a C++ base class.
explicit OffsetOfNode(const CXXBaseSpecifier *Base)
- : Range(), Data(reinterpret_cast<uintptr_t>(Base) | OffsetOfNode::Base) {}
+ : Data(reinterpret_cast<uintptr_t>(Base) | OffsetOfNode::Base) {}
/// Determine what kind of offsetof node this is.
Kind getKind() const { return static_cast<Kind>(Data & Mask); }
diff --git a/clang/include/clang/ASTMatchers/Dynamic/Diagnostics.h b/clang/include/clang/ASTMatchers/Dynamic/Diagnostics.h
index af1affc16dbc5..25eb38e6435e0 100644
--- a/clang/include/clang/ASTMatchers/Dynamic/Diagnostics.h
+++ b/clang/include/clang/ASTMatchers/Dynamic/Diagnostics.h
@@ -40,7 +40,7 @@ struct SourceRange {
/// A VariantValue instance annotated with its parser context.
struct ParserValue {
- ParserValue() : Text(), Range(), Value() {}
+ ParserValue() : Range() {}
StringRef Text;
SourceRange Range;
VariantValue Value;
diff --git a/clang/include/clang/Analysis/Analyses/Consumed.h b/clang/include/clang/Analysis/Analyses/Consumed.h
index dec1ae3b2b4bf..24702567ab6c3 100644
--- a/clang/include/clang/Analysis/Analyses/Consumed.h
+++ b/clang/include/clang/Analysis/Analyses/Consumed.h
@@ -153,8 +153,7 @@ namespace consumed {
public:
ConsumedStateMap() = default;
ConsumedStateMap(const ConsumedStateMap &Other)
- : Reachable(Other.Reachable), From(Other.From), VarMap(Other.VarMap),
- TmpMap() {}
+ : Reachable(Other.Reachable), From(Other.From), VarMap(Other.VarMap) {}
/// Warn if any of the parameters being tracked are not in the state
/// they were declared to be in upon return from a function.
diff --git a/clang/include/clang/Basic/Diagnostic.h b/clang/include/clang/Basic/Diagnostic.h
index e5577e74fa639..6a80823d12422 100644
--- a/clang/include/clang/Basic/Diagnostic.h
+++ b/clang/include/clang/Basic/Diagnostic.h
@@ -1326,7 +1326,7 @@ class DiagnosticBuilder : public StreamingDiagnostic {
public:
/// Copy constructor. When copied, this "takes" the diagnostic info from the
/// input and neuters it.
- DiagnosticBuilder(const DiagnosticBuilder &D) : StreamingDiagnostic() {
+ DiagnosticBuilder(const DiagnosticBuilder &D) {
DiagObj = D.DiagObj;
DiagStorage = D.DiagStorage;
IsActive = D.IsActive;
diff --git a/clang/include/clang/Basic/PartialDiagnostic.h b/clang/include/clang/Basic/PartialDiagnostic.h
index 9fb70bff7fee1..217441979869b 100644
--- a/clang/include/clang/Basic/PartialDiagnostic.h
+++ b/clang/include/clang/Basic/PartialDiagnostic.h
@@ -49,8 +49,7 @@ class PartialDiagnostic : public StreamingDiagnostic {
PartialDiagnostic(unsigned DiagID, DiagStorageAllocator &Allocator_)
: StreamingDiagnostic(Allocator_), DiagID(DiagID) {}
- PartialDiagnostic(const PartialDiagnostic &Other)
- : StreamingDiagnostic(), DiagID(Other.DiagID) {
+ PartialDiagnostic(const PartialDiagnostic &Other) : DiagID(Other.DiagID) {
Allocator = Other.Allocator;
if (Other.DiagStorage) {
DiagStorage = getStorage();
diff --git a/clang/include/clang/Sema/DeclSpec.h b/clang/include/clang/Sema/DeclSpec.h
index 2704a9c1fc785..2437be497de4e 100644
--- a/clang/include/clang/Sema/DeclSpec.h
+++ b/clang/include/clang/Sema/DeclSpec.h
@@ -434,8 +434,7 @@ class DeclSpec {
FS_noreturn_specified(false), Friend_specified(false),
ConstexprSpecifier(
static_cast<unsigned>(ConstexprSpecKind::Unspecified)),
- FS_explicit_specifier(), Attrs(attrFactory), writtenBS(),
- ObjCQualifiers(nullptr) {}
+ Attrs(attrFactory), writtenBS(), ObjCQualifiers(nullptr) {}
// storage-class-specifier
SCS getStorageClassSpec() const { return (SCS)StorageClassSpec; }
diff --git a/clang/include/clang/Sema/Overload.h b/clang/include/clang/Sema/Overload.h
index 88405a63b735d..48997e186ef69 100644
--- a/clang/include/clang/Sema/Overload.h
+++ b/clang/include/clang/Sema/Overload.h
@@ -577,8 +577,7 @@ class Sema;
ImplicitConversionSequence()
: ConversionKind(Uninitialized),
- InitializerListOfIncompleteArray(false),
- InitializerListContainerType() {
+ InitializerListOfIncompleteArray(false) {
Standard.setAsIdentityConversion();
}
diff --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h
index 6758e7ef2c30a..f97a785c74260 100644
--- a/clang/include/clang/Sema/Sema.h
+++ b/clang/include/clang/Sema/Sema.h
@@ -1365,10 +1365,10 @@ class Sema final {
};
private:
- llvm::PointerIntPair<CXXMethodDecl*, 2> Pair;
+ llvm::PointerIntPair<CXXMethodDecl *, 2> Pair;
public:
- SpecialMemberOverloadResult() : Pair() {}
+ SpecialMemberOverloadResult() {}
SpecialMemberOverloadResult(CXXMethodDecl *MD)
: Pair(MD, MD->isDeleted() ? NoMemberOrDeleted : Success) {}
@@ -7520,7 +7520,7 @@ class Sema final {
RequiredTemplateKind(SourceLocation TemplateKWLoc = SourceLocation())
: TemplateKW(TemplateKWLoc) {}
/// Template name is unconditionally required.
- RequiredTemplateKind(TemplateNameIsRequiredTag) : TemplateKW() {}
+ RequiredTemplateKind(TemplateNameIsRequiredTag) {}
SourceLocation getTemplateKeywordLoc() const {
return TemplateKW.getValueOr(SourceLocation());
@@ -13061,7 +13061,7 @@ class Sema final {
ValueDecl *MD;
CharUnits Alignment;
- MisalignedMember() : E(), RD(), MD(), Alignment() {}
+ MisalignedMember() : E(), RD(), MD() {}
MisalignedMember(Expr *E, RecordDecl *RD, ValueDecl *MD,
CharUnits Alignment)
: E(E), RD(RD), MD(MD), Alignment(Alignment) {}
diff --git a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/DynamicTypeInfo.h b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/DynamicTypeInfo.h
index 6d2b495dc0f50..3ff453a8de4f9 100644
--- a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/DynamicTypeInfo.h
+++ b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/DynamicTypeInfo.h
@@ -18,7 +18,7 @@ namespace ento {
/// of a region in a given state along the analysis path.
class DynamicTypeInfo {
public:
- DynamicTypeInfo() : DynTy(QualType()) {}
+ DynamicTypeInfo() {}
DynamicTypeInfo(QualType Ty, bool CanBeSub = true)
: DynTy(Ty), CanBeASubClass(CanBeSub) {}
diff --git a/clang/lib/ARCMigrate/Internals.h b/clang/lib/ARCMigrate/Internals.h
index ed0136e4867a8..8b482738cc898 100644
--- a/clang/lib/ARCMigrate/Internals.h
+++ b/clang/lib/ARCMigrate/Internals.h
@@ -154,13 +154,11 @@ class MigrationPass {
std::vector<SourceLocation> &ARCMTMacroLocs;
Optional<bool> EnableCFBridgeFns;
- MigrationPass(ASTContext &Ctx, LangOptions::GCMode OrigGCMode,
- Sema &sema, TransformActions &TA,
- const CapturedDiagList &capturedDiags,
+ MigrationPass(ASTContext &Ctx, LangOptions::GCMode OrigGCMode, Sema &sema,
+ TransformActions &TA, const CapturedDiagList &capturedDiags,
std::vector<SourceLocation> &ARCMTMacroLocs)
- : Ctx(Ctx), OrigGCMode(OrigGCMode), MigOptions(),
- SemaRef(sema), TA(TA), CapturedDiags(capturedDiags),
- ARCMTMacroLocs(ARCMTMacroLocs) { }
+ : Ctx(Ctx), OrigGCMode(OrigGCMode), SemaRef(sema), TA(TA),
+ CapturedDiags(capturedDiags), ARCMTMacroLocs(ARCMTMacroLocs) {}
const CapturedDiagList &getDiags() const { return CapturedDiags; }
diff --git a/clang/lib/ARCMigrate/TransAutoreleasePool.cpp b/clang/lib/ARCMigrate/TransAutoreleasePool.cpp
index 393adcd85a3f5..47587d81850ab 100644
--- a/clang/lib/ARCMigrate/TransAutoreleasePool.cpp
+++ b/clang/lib/ARCMigrate/TransAutoreleasePool.cpp
@@ -229,8 +229,9 @@ class AutoreleasePoolRewriter
bool IsFollowedBySimpleReturnStmt;
SmallVector<ObjCMessageExpr *, 4> Releases;
- PoolScope() : PoolVar(nullptr), CompoundParent(nullptr), Begin(), End(),
- IsFollowedBySimpleReturnStmt(false) { }
+ PoolScope()
+ : PoolVar(nullptr), CompoundParent(nullptr),
+ IsFollowedBySimpleReturnStmt(false) {}
SourceRange getIndentedRange() const {
Stmt::child_iterator rangeS = Begin;
diff --git a/clang/lib/AST/DeclCXX.cpp b/clang/lib/AST/DeclCXX.cpp
index 1780358cc3484..108113274b8e0 100644
--- a/clang/lib/AST/DeclCXX.cpp
+++ b/clang/lib/AST/DeclCXX.cpp
@@ -3272,7 +3272,7 @@ void MSGuidDecl::anchor() {}
MSGuidDecl::MSGuidDecl(DeclContext *DC, QualType T, Parts P)
: ValueDecl(Decl::MSGuid, DC, SourceLocation(), DeclarationName(), T),
- PartVal(P), APVal() {}
+ PartVal(P) {}
MSGuidDecl *MSGuidDecl::Create(const ASTContext &C, QualType T, Parts P) {
DeclContext *DC = C.getTranslationUnitDecl();
diff --git a/clang/lib/AST/ExprConcepts.cpp b/clang/lib/AST/ExprConcepts.cpp
index 8cb8625e2a1a8..c17453fb45fb8 100644
--- a/clang/lib/AST/ExprConcepts.cpp
+++ b/clang/lib/AST/ExprConcepts.cpp
@@ -57,9 +57,9 @@ ConceptSpecializationExpr::ConceptSpecializationExpr(
}
ConceptSpecializationExpr::ConceptSpecializationExpr(EmptyShell Empty,
- unsigned NumTemplateArgs)
- : Expr(ConceptSpecializationExprClass, Empty), ConceptReference(),
- NumTemplateArgs(NumTemplateArgs) { }
+ unsigned NumTemplateArgs)
+ : Expr(ConceptSpecializationExprClass, Empty),
+ NumTemplateArgs(NumTemplateArgs) {}
void ConceptSpecializationExpr::setTemplateArguments(
ArrayRef<TemplateArgument> Converted) {
diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp
index 105cd7a3506dd..3bf205d8cb064 100644
--- a/clang/lib/AST/ExprConstant.cpp
+++ b/clang/lib/AST/ExprConstant.cpp
@@ -1706,8 +1706,8 @@ namespace {
struct MemberPtr {
MemberPtr() {}
- explicit MemberPtr(const ValueDecl *Decl) :
- DeclAndIsDerivedMember(Decl, false), Path() {}
+ explicit MemberPtr(const ValueDecl *Decl)
+ : DeclAndIsDerivedMember(Decl, false) {}
/// The member or (direct or indirect) field referred to by this member
/// pointer, or 0 if this is a null member pointer.
diff --git a/clang/lib/Analysis/CFG.cpp b/clang/lib/Analysis/CFG.cpp
index 9ef3b5b6277a9..9bde034d5e099 100644
--- a/clang/lib/Analysis/CFG.cpp
+++ b/clang/lib/Analysis/CFG.cpp
@@ -531,9 +531,7 @@ class CFGBuilder {
public:
explicit CFGBuilder(ASTContext *astContext,
const CFG::BuildOptions &buildOpts)
- : Context(astContext), cfg(new CFG()), // crew a new CFG
- ConstructionContextMap(), BuildOpts(buildOpts) {}
-
+ : Context(astContext), cfg(new CFG()), BuildOpts(buildOpts) {}
// buildCFG - Used by external clients to construct the CFG.
std::unique_ptr<CFG> buildCFG(const Decl *D, Stmt *Statement);
diff --git a/clang/lib/Basic/TargetInfo.cpp b/clang/lib/Basic/TargetInfo.cpp
index 646bbe8b73873..ddb20008bc9da 100644
--- a/clang/lib/Basic/TargetInfo.cpp
+++ b/clang/lib/Basic/TargetInfo.cpp
@@ -25,7 +25,7 @@ using namespace clang;
static const LangASMap DefaultAddrSpaceMap = {0};
// TargetInfo Constructor.
-TargetInfo::TargetInfo(const llvm::Triple &T) : TargetOpts(), Triple(T) {
+TargetInfo::TargetInfo(const llvm::Triple &T) : Triple(T) {
// Set defaults. Defaults are set for a 32-bit RISC platform, like PPC or
// SPARC. These should be overridden by concrete targets as needed.
BigEndian = !T.isLittleEndian();
diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp
index bacac0a20d4d5..6ce125c027366 100644
--- a/clang/lib/CodeGen/BackendUtil.cpp
+++ b/clang/lib/CodeGen/BackendUtil.cpp
@@ -197,8 +197,7 @@ class PassManagerBuilderWrapper : public PassManagerBuilder {
PassManagerBuilderWrapper(const Triple &TargetTriple,
const CodeGenOptions &CGOpts,
const LangOptions &LangOpts)
- : PassManagerBuilder(), TargetTriple(TargetTriple), CGOpts(CGOpts),
- LangOpts(LangOpts) {}
+ : TargetTriple(TargetTriple), CGOpts(CGOpts), LangOpts(LangOpts) {}
const Triple &getTargetTriple() const { return TargetTriple; }
const CodeGenOptions &getCGOpts() const { return CGOpts; }
const LangOptions &getLangOpts() const { return LangOpts; }
diff --git a/clang/lib/CodeGen/CGCall.h b/clang/lib/CodeGen/CGCall.h
index c8594068c3fcb..8d63739fbbad4 100644
--- a/clang/lib/CodeGen/CGCall.h
+++ b/clang/lib/CodeGen/CGCall.h
@@ -49,11 +49,11 @@ class CGCalleeInfo {
GlobalDecl CalleeDecl;
public:
- explicit CGCalleeInfo() : CalleeProtoTy(nullptr), CalleeDecl() {}
+ explicit CGCalleeInfo() : CalleeProtoTy(nullptr) {}
CGCalleeInfo(const FunctionProtoType *calleeProtoTy, GlobalDecl calleeDecl)
: CalleeProtoTy(calleeProtoTy), CalleeDecl(calleeDecl) {}
CGCalleeInfo(const FunctionProtoType *calleeProtoTy)
- : CalleeProtoTy(calleeProtoTy), CalleeDecl() {}
+ : CalleeProtoTy(calleeProtoTy) {}
CGCalleeInfo(GlobalDecl calleeDecl)
: CalleeProtoTy(nullptr), CalleeDecl(calleeDecl) {}
diff --git a/clang/lib/CodeGen/CGRecordLayout.h b/clang/lib/CodeGen/CGRecordLayout.h
index e6665b72bcba1..5a3bcdf72f7b6 100644
--- a/clang/lib/CodeGen/CGRecordLayout.h
+++ b/clang/lib/CodeGen/CGRecordLayout.h
@@ -93,8 +93,8 @@ struct CGBitFieldInfo {
CharUnits VolatileStorageOffset;
CGBitFieldInfo()
- : Offset(), Size(), IsSigned(), StorageSize(), StorageOffset(),
- VolatileOffset(), VolatileStorageSize(), VolatileStorageOffset() {}
+ : Offset(), Size(), IsSigned(), StorageSize(), VolatileOffset(),
+ VolatileStorageSize() {}
CGBitFieldInfo(unsigned Offset, unsigned Size, bool IsSigned,
unsigned StorageSize, CharUnits StorageOffset)
diff --git a/clang/lib/CodeGen/CGStmtOpenMP.cpp b/clang/lib/CodeGen/CGStmtOpenMP.cpp
index 4c11f7d67534f..94472668c8e70 100644
--- a/clang/lib/CodeGen/CGStmtOpenMP.cpp
+++ b/clang/lib/CodeGen/CGStmtOpenMP.cpp
@@ -6789,7 +6789,7 @@ void CodeGenFunction::EmitOMPTargetDataDirective(
public:
explicit DevicePointerPrivActionTy(bool &PrivatizeDevicePointers)
- : PrePostActionTy(), PrivatizeDevicePointers(PrivatizeDevicePointers) {}
+ : PrivatizeDevicePointers(PrivatizeDevicePointers) {}
void Enter(CodeGenFunction &CGF) override {
PrivatizeDevicePointers = true;
}
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h
index ece863ad10777..17bdbc0bd3341 100644
--- a/clang/lib/CodeGen/CodeGenFunction.h
+++ b/clang/lib/CodeGen/CodeGenFunction.h
@@ -242,11 +242,10 @@ class CodeGenFunction : public CodeGenTypeCache {
/// A jump destination is an abstract label, branching to which may
/// require a jump out through normal cleanups.
struct JumpDest {
- JumpDest() : Block(nullptr), ScopeDepth(), Index(0) {}
- JumpDest(llvm::BasicBlock *Block,
- EHScopeStack::stable_iterator Depth,
+ JumpDest() : Block(nullptr), Index(0) {}
+ JumpDest(llvm::BasicBlock *Block, EHScopeStack::stable_iterator Depth,
unsigned Index)
- : Block(Block), ScopeDepth(Depth), Index(Index) {}
+ : Block(Block), ScopeDepth(Depth), Index(Index) {}
bool isValid() const { return Block != nullptr; }
llvm::BasicBlock *getBlock() const { return Block; }
diff --git a/clang/lib/CodeGen/CodeGenPGO.cpp b/clang/lib/CodeGen/CodeGenPGO.cpp
index ab953c2c7d525..6657f2a91e3d8 100644
--- a/clang/lib/CodeGen/CodeGenPGO.cpp
+++ b/clang/lib/CodeGen/CodeGenPGO.cpp
@@ -131,7 +131,7 @@ class PGOHash {
static_assert(LastHashType <= TooBig, "Too many types in HashType");
PGOHash(PGOHashVersion HashVersion)
- : Working(0), Count(0), HashVersion(HashVersion), MD5() {}
+ : Working(0), Count(0), HashVersion(HashVersion) {}
void combine(HashType Type);
uint64_t finalize();
PGOHashVersion getHashVersion() const { return HashVersion; }
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index a73421c0535d0..4ac48cc280169 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -170,10 +170,8 @@ Driver::Driver(StringRef ClangExecutable, StringRef TargetTriple,
: Diags(Diags), VFS(std::move(VFS)), Mode(GCCMode),
SaveTemps(SaveTempsNone), BitcodeEmbed(EmbedNone), LTOMode(LTOK_None),
ClangExecutable(ClangExecutable), SysRoot(DEFAULT_SYSROOT),
- DriverTitle(Title), CCPrintStatReportFilename(), CCPrintOptionsFilename(),
- CCPrintHeadersFilename(), CCLogDiagnosticsFilename(),
- CCCPrintBindings(false), CCPrintOptions(false), CCPrintHeaders(false),
- CCLogDiagnostics(false), CCGenDiagnostics(false),
+ DriverTitle(Title), CCCPrintBindings(false), CCPrintOptions(false),
+ CCPrintHeaders(false), CCLogDiagnostics(false), CCGenDiagnostics(false),
CCPrintProcessStats(false), TargetTriple(TargetTriple), Saver(Alloc),
CheckInputsExist(true), GenReproducer(false),
SuppressMissingInputWarning(false) {
diff --git a/clang/lib/Frontend/MultiplexConsumer.cpp b/clang/lib/Frontend/MultiplexConsumer.cpp
index 5abbb3a235b49..34bbc365e6476 100644
--- a/clang/lib/Frontend/MultiplexConsumer.cpp
+++ b/clang/lib/Frontend/MultiplexConsumer.cpp
@@ -236,10 +236,10 @@ void MultiplexASTMutationListener::AddedAttributeToRecord(
MultiplexConsumer::MultiplexConsumer(
std::vector<std::unique_ptr<ASTConsumer>> C)
- : Consumers(std::move(C)), MutationListener(), DeserializationListener() {
+ : Consumers(std::move(C)) {
// Collect the mutation listeners and deserialization listeners of all
// children, and create a multiplex listener each if so.
- std::vector<ASTMutationListener*> mutationListeners;
+ std::vector<ASTMutationListener *> mutationListeners;
std::vector<ASTDeserializationListener*> serializationListeners;
for (auto &Consumer : Consumers) {
if (auto *mutationListener = Consumer->GetASTMutationListener())
diff --git a/clang/lib/Frontend/SerializedDiagnosticPrinter.cpp b/clang/lib/Frontend/SerializedDiagnosticPrinter.cpp
index 462aeda6e027f..fc8fce4b42b85 100644
--- a/clang/lib/Frontend/SerializedDiagnosticPrinter.cpp
+++ b/clang/lib/Frontend/SerializedDiagnosticPrinter.cpp
@@ -95,8 +95,7 @@ class SDiagsMerger : SerializedDiagnosticReader {
AbbrevLookup DiagFlagLookup;
public:
- SDiagsMerger(SDiagsWriter &Writer)
- : SerializedDiagnosticReader(), Writer(Writer) {}
+ SDiagsMerger(SDiagsWriter &Writer) : Writer(Writer) {}
std::error_code mergeRecordsFromFile(const char *File) {
return readDiagnostics(File);
diff --git a/clang/lib/Sema/AnalysisBasedWarnings.cpp b/clang/lib/Sema/AnalysisBasedWarnings.cpp
index b4dcc9759b990..ac5ad52c0b1d8 100644
--- a/clang/lib/Sema/AnalysisBasedWarnings.cpp
+++ b/clang/lib/Sema/AnalysisBasedWarnings.cpp
@@ -128,7 +128,7 @@ class LogicalErrorHandler : public CFGCallback {
Sema &S;
public:
- LogicalErrorHandler(Sema &S) : CFGCallback(), S(S) {}
+ LogicalErrorHandler(Sema &S) : S(S) {}
static bool HasMacroID(const Expr *E) {
if (E->getExprLoc().isMacroID())
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
index 4e83fa1fffca4..03608a339e55e 100644
--- a/clang/lib/Sema/SemaChecking.cpp
+++ b/clang/lib/Sema/SemaChecking.cpp
@@ -14021,7 +14021,7 @@ class SequenceChecker : public ConstEvaluatedExprVisitor<SequenceChecker> {
const Expr *UsageExpr;
SequenceTree::Seq Seq;
- Usage() : UsageExpr(nullptr), Seq() {}
+ Usage() : UsageExpr(nullptr) {}
};
struct UsageInfo {
@@ -14030,7 +14030,7 @@ class SequenceChecker : public ConstEvaluatedExprVisitor<SequenceChecker> {
/// Have we issued a diagnostic for this object already?
bool Diagnosed;
- UsageInfo() : Uses(), Diagnosed(false) {}
+ UsageInfo() : Diagnosed(false) {}
};
using UsageInfoMap = llvm::SmallDenseMap<Object, UsageInfo, 16>;
diff --git a/clang/lib/Sema/SemaCodeComplete.cpp b/clang/lib/Sema/SemaCodeComplete.cpp
index 93c07ccc891f5..be492b5f3607c 100644
--- a/clang/lib/Sema/SemaCodeComplete.cpp
+++ b/clang/lib/Sema/SemaCodeComplete.cpp
@@ -98,7 +98,7 @@ class ResultBuilder {
unsigned SingleDeclIndex;
public:
- ShadowMapEntry() : DeclOrVector(), SingleDeclIndex(0) {}
+ ShadowMapEntry() : SingleDeclIndex(0) {}
ShadowMapEntry(const ShadowMapEntry &) = delete;
ShadowMapEntry(ShadowMapEntry &&Move) { *this = std::move(Move); }
ShadowMapEntry &operator=(const ShadowMapEntry &) = delete;
diff --git a/clang/lib/Sema/SemaTemplateDeduction.cpp b/clang/lib/Sema/SemaTemplateDeduction.cpp
index e9636d2b942e8..22dd395d99439 100644
--- a/clang/lib/Sema/SemaTemplateDeduction.cpp
+++ b/clang/lib/Sema/SemaTemplateDeduction.cpp
@@ -4452,7 +4452,7 @@ namespace {
public:
SubstituteDeducedTypeTransform(Sema &SemaRef, DependentAuto DA)
- : TreeTransform<SubstituteDeducedTypeTransform>(SemaRef), Replacement(),
+ : TreeTransform<SubstituteDeducedTypeTransform>(SemaRef),
ReplacementIsPack(DA.IsPack), UseTypeSugar(true) {}
SubstituteDeducedTypeTransform(Sema &SemaRef, QualType Replacement,
diff --git a/clang/lib/StaticAnalyzer/Core/ProgramState.cpp b/clang/lib/StaticAnalyzer/Core/ProgramState.cpp
index 1ccb0de92fba3..8d4e0bbb7dec9 100644
--- a/clang/lib/StaticAnalyzer/Core/ProgramState.cpp
+++ b/clang/lib/StaticAnalyzer/Core/ProgramState.cpp
@@ -54,11 +54,7 @@ ProgramState::ProgramState(ProgramStateManager *mgr, const Environment& env,
}
ProgramState::ProgramState(const ProgramState &RHS)
- : llvm::FoldingSetNode(),
- stateMgr(RHS.stateMgr),
- Env(RHS.Env),
- store(RHS.store),
- GDM(RHS.GDM),
+ : stateMgr(RHS.stateMgr), Env(RHS.Env), store(RHS.store), GDM(RHS.GDM),
refCount(0) {
stateMgr->getStoreManager().incrementReferenceCount(store);
}
diff --git a/clang/tools/clang-offload-bundler/ClangOffloadBundler.cpp b/clang/tools/clang-offload-bundler/ClangOffloadBundler.cpp
index f9ccbd36dc407..ce673628866a9 100644
--- a/clang/tools/clang-offload-bundler/ClangOffloadBundler.cpp
+++ b/clang/tools/clang-offload-bundler/ClangOffloadBundler.cpp
@@ -356,7 +356,7 @@ class BinaryFileHandler final : public FileHandler {
std::string CurWriteBundleTarget;
public:
- BinaryFileHandler() : FileHandler() {}
+ BinaryFileHandler() {}
~BinaryFileHandler() final {}
@@ -576,8 +576,7 @@ class ObjectFileHandler final : public FileHandler {
public:
ObjectFileHandler(std::unique_ptr<ObjectFile> ObjIn)
- : FileHandler(), Obj(std::move(ObjIn)),
- CurrentSection(Obj->section_begin()),
+ : Obj(std::move(ObjIn)), CurrentSection(Obj->section_begin()),
NextSection(Obj->section_begin()) {}
~ObjectFileHandler() final {}
@@ -813,8 +812,7 @@ class TextFileHandler final : public FileHandler {
}
public:
- TextFileHandler(StringRef Comment)
- : FileHandler(), Comment(Comment), ReadChars(0) {
+ TextFileHandler(StringRef Comment) : Comment(Comment), ReadChars(0) {
BundleStartString =
"\n" + Comment.str() + " " OFFLOAD_BUNDLER_MAGIC_STR "__START__ ";
BundleEndString =
diff --git a/clang/tools/libclang/CXIndexDataConsumer.h b/clang/tools/libclang/CXIndexDataConsumer.h
index ace9d59bf0455..8e6045dbf6bc8 100644
--- a/clang/tools/libclang/CXIndexDataConsumer.h
+++ b/clang/tools/libclang/CXIndexDataConsumer.h
@@ -332,10 +332,9 @@ class CXIndexDataConsumer : public index::IndexDataConsumer {
public:
CXIndexDataConsumer(CXClientData clientData, IndexerCallbacks &indexCallbacks,
- unsigned indexOptions, CXTranslationUnit cxTU)
- : Ctx(nullptr), ClientData(clientData), CB(indexCallbacks),
- IndexOptions(indexOptions), CXTU(cxTU),
- StrScratch(), StrAdapterCount(0) { }
+ unsigned indexOptions, CXTranslationUnit cxTU)
+ : Ctx(nullptr), ClientData(clientData), CB(indexCallbacks),
+ IndexOptions(indexOptions), CXTU(cxTU), StrAdapterCount(0) {}
ASTContext &getASTContext() const { return *Ctx; }
CXTranslationUnit getCXTU() const { return CXTU; }
diff --git a/clang/tools/libclang/CXLoadedDiagnostic.cpp b/clang/tools/libclang/CXLoadedDiagnostic.cpp
index b3dcf977b921a..bb6942a45f460 100644
--- a/clang/tools/libclang/CXLoadedDiagnostic.cpp
+++ b/clang/tools/libclang/CXLoadedDiagnostic.cpp
@@ -235,7 +235,7 @@ class DiagLoader : serialized_diags::SerializedDiagnosticReader {
public:
DiagLoader(enum CXLoadDiag_Error *e, CXString *es)
- : SerializedDiagnosticReader(), error(e), errorString(es) {
+ : error(e), errorString(es) {
if (error)
*error = CXLoadDiag_None;
if (errorString)
More information about the cfe-commits
mailing list