Index: lib/ARCMigrate/ARCMT.cpp =================================================================== --- lib/ARCMigrate/ARCMT.cpp +++ lib/ARCMigrate/ARCMT.cpp @@ -193,7 +193,7 @@ std::string define = getARCMTMacroName(); define += '='; CInvok->getPreprocessorOpts().addMacroDef(define); - CInvok->getLangOpts()->ObjCAutoRefCount = true; + CInvok->getLangOpts()->ObjCAutoRefCount = 1; CInvok->getLangOpts()->setGC(LangOptions::NonGC); CInvok->getDiagnosticOpts().ErrorLimit = 0; CInvok->getDiagnosticOpts().PedanticErrors = 0; @@ -374,7 +374,7 @@ DiagClient, /*ShouldOwnClient=*/false)); if (outputDir.empty()) { - origCI.getLangOpts()->ObjCAutoRefCount = true; + origCI.getLangOpts()->ObjCAutoRefCount = 1; return migration.getRemapper().overwriteOriginal(*Diags); } else { return migration.getRemapper().flushToDisk(outputDir, *Diags); @@ -524,7 +524,7 @@ std::unique_ptr CInvok; CInvok.reset( createInvocationForMigration(OrigCI, PCHContainerOps->getRawReader())); - CInvok->getDiagnosticOpts().IgnoreWarnings = true; + CInvok->getDiagnosticOpts().IgnoreWarnings = 1; Remapper.applyMappings(CInvok->getPreprocessorOpts()); Index: lib/ARCMigrate/ObjCMT.cpp =================================================================== --- lib/ARCMigrate/ObjCMT.cpp +++ lib/ARCMigrate/ObjCMT.cpp @@ -514,8 +514,8 @@ } PropertyString += " "; PrintingPolicy SubPolicy(Context.getPrintingPolicy()); - SubPolicy.SuppressStrongLifetime = true; - SubPolicy.SuppressLifetimeQualifiers = true; + SubPolicy.SuppressStrongLifetime = 1; + SubPolicy.SuppressLifetimeQualifiers = 1; std::string TypeString = RT.getAsString(SubPolicy); if (LengthOfPrefix > 0) { // property name must strip off "is" and lower case the first character Index: lib/AST/ASTContext.cpp =================================================================== --- lib/AST/ASTContext.cpp +++ lib/AST/ASTContext.cpp @@ -422,7 +422,7 @@ const Decl *D) const { comments::DeclInfo *ThisDeclInfo = new (*this) comments::DeclInfo; ThisDeclInfo->CommentDecl = D; - ThisDeclInfo->IsFilled = false; + ThisDeclInfo->IsFilled = 0; ThisDeclInfo->fill(); ThisDeclInfo->CommentDecl = FC->getDecl(); if (!ThisDeclInfo->TemplateParameters) Index: lib/AST/ASTDiagnostic.cpp =================================================================== --- lib/AST/ASTDiagnostic.cpp +++ lib/AST/ASTDiagnostic.cpp @@ -346,7 +346,7 @@ TDT.PrintFromType, TDT.ElideType, TDT.ShowColors, OS)) { NeedQuotes = !TDT.PrintTree; - TDT.TemplateDiffUsed = true; + TDT.TemplateDiffUsed = 1; break; } Index: lib/AST/Comment.cpp =================================================================== --- lib/AST/Comment.cpp +++ lib/AST/Comment.cpp @@ -132,15 +132,15 @@ // Set defaults. Kind = OtherKind; TemplateKind = NotTemplate; - IsObjCMethod = false; - IsInstanceMethod = false; - IsClassMethod = false; + IsObjCMethod = 0; + IsInstanceMethod = 0; + IsClassMethod = 0; ParamVars = None; TemplateParameters = nullptr; if (!CommentDecl) { // If there is no declaration, the defaults is our only guess. - IsFilled = true; + IsFilled = 1; return; } CurrentDecl = CommentDecl; @@ -179,7 +179,7 @@ Kind = FunctionKind; ParamVars = llvm::makeArrayRef(MD->param_begin(), MD->param_size()); ReturnType = MD->getReturnType(); - IsObjCMethod = true; + IsObjCMethod = 1; IsInstanceMethod = MD->isInstanceMethod(); IsClassMethod = !IsInstanceMethod; break; @@ -318,7 +318,7 @@ break; } - IsFilled = true; + IsFilled = 1; } StringRef ParamCommandComment::getParamName(const FullComment *FC) const { Index: lib/AST/CommentCommandTraits.cpp =================================================================== --- lib/AST/CommentCommandTraits.cpp +++ lib/AST/CommentCommandTraits.cpp @@ -103,13 +103,13 @@ const CommandInfo *CommandTraits::registerUnknownCommand( StringRef CommandName) { CommandInfo *Info = createCommandInfoWithName(CommandName); - Info->IsUnknownCommand = true; + Info->IsUnknownCommand = 1; return Info; } const CommandInfo *CommandTraits::registerBlockCommand(StringRef CommandName) { CommandInfo *Info = createCommandInfoWithName(CommandName); - Info->IsBlockCommand = true; + Info->IsBlockCommand = 1; return Info; } Index: lib/AST/CommentSema.cpp =================================================================== --- lib/AST/CommentSema.cpp +++ lib/AST/CommentSema.cpp @@ -39,7 +39,7 @@ ThisDeclInfo = new (Allocator) DeclInfo; ThisDeclInfo->CommentDecl = D; - ThisDeclInfo->IsFilled = false; + ThisDeclInfo->IsFilled = 0; } ParagraphComment *Sema::actOnParagraphComment( Index: lib/AST/Decl.cpp =================================================================== --- lib/AST/Decl.cpp +++ lib/AST/Decl.cpp @@ -2677,7 +2677,7 @@ } if (PrevDecl && PrevDecl->IsInline) - IsInline = true; + IsInline = 1; } FunctionDecl *FunctionDecl::getCanonicalDecl() { return getFirstDecl(); } Index: lib/AST/DeclBase.cpp =================================================================== --- lib/AST/DeclBase.cpp +++ lib/AST/DeclBase.cpp @@ -347,7 +347,7 @@ if (C.getASTMutationListener()) C.getASTMutationListener()->DeclarationMarkedUsed(this); - Used = true; + Used = 1; } bool Decl::isReferenced() const { @@ -679,13 +679,13 @@ assert(AttrBlank.empty() && "HasAttrs was wrong?"); AttrBlank = attrs; - HasAttrs = true; + HasAttrs = 1; } void Decl::dropAttrs() { if (!HasAttrs) return; - HasAttrs = false; + HasAttrs = 0; getASTContext().eraseDeclAttrs(this); } Index: lib/AST/DeclCXX.cpp =================================================================== --- lib/AST/DeclCXX.cpp +++ lib/AST/DeclCXX.cpp @@ -46,31 +46,31 @@ } CXXRecordDecl::DefinitionData::DefinitionData(CXXRecordDecl *D) - : UserDeclaredConstructor(false), UserDeclaredSpecialMembers(0), - Aggregate(true), PlainOldData(true), Empty(true), Polymorphic(false), - Abstract(false), IsStandardLayout(true), HasNoNonEmptyBases(true), - HasPrivateFields(false), HasProtectedFields(false), - HasPublicFields(false), HasMutableFields(false), HasVariantMembers(false), - HasOnlyCMembers(true), HasInClassInitializer(false), - HasUninitializedReferenceMember(false), HasUninitializedFields(false), - NeedOverloadResolutionForMoveConstructor(false), - NeedOverloadResolutionForMoveAssignment(false), - NeedOverloadResolutionForDestructor(false), - DefaultedMoveConstructorIsDeleted(false), - DefaultedMoveAssignmentIsDeleted(false), - DefaultedDestructorIsDeleted(false), HasTrivialSpecialMembers(SMF_All), - DeclaredNonTrivialSpecialMembers(0), HasIrrelevantDestructor(true), - HasConstexprNonCopyMoveConstructor(false), - HasDefaultedDefaultConstructor(false), - DefaultedDefaultConstructorIsConstexpr(true), - HasConstexprDefaultConstructor(false), - HasNonLiteralTypeFieldsOrBases(false), ComputedVisibleConversions(false), - UserProvidedDefaultConstructor(false), DeclaredSpecialMembers(0), - ImplicitCopyConstructorHasConstParam(true), - ImplicitCopyAssignmentHasConstParam(true), - HasDeclaredCopyConstructorWithConstParam(false), - HasDeclaredCopyAssignmentWithConstParam(false), IsLambda(false), - IsParsingBaseSpecifiers(false), NumBases(0), NumVBases(0), Bases(), + : UserDeclaredConstructor(0), UserDeclaredSpecialMembers(0), + Aggregate(1), PlainOldData(1), Empty(1), Polymorphic(0), + Abstract(0), IsStandardLayout(1), HasNoNonEmptyBases(1), + HasPrivateFields(0), HasProtectedFields(0), + HasPublicFields(0), HasMutableFields(0), HasVariantMembers(0), + HasOnlyCMembers(1), HasInClassInitializer(0), + HasUninitializedReferenceMember(0), HasUninitializedFields(0), + NeedOverloadResolutionForMoveConstructor(0), + NeedOverloadResolutionForMoveAssignment(0), + NeedOverloadResolutionForDestructor(0), + DefaultedMoveConstructorIsDeleted(0), + DefaultedMoveAssignmentIsDeleted(0), + DefaultedDestructorIsDeleted(0), HasTrivialSpecialMembers(SMF_All), + DeclaredNonTrivialSpecialMembers(0), HasIrrelevantDestructor(1), + HasConstexprNonCopyMoveConstructor(0), + HasDefaultedDefaultConstructor(0), + DefaultedDefaultConstructorIsConstexpr(1), + HasConstexprDefaultConstructor(0), + HasNonLiteralTypeFieldsOrBases(0), ComputedVisibleConversions(0), + UserProvidedDefaultConstructor(0), DeclaredSpecialMembers(0), + ImplicitCopyConstructorHasConstParam(1), + ImplicitCopyAssignmentHasConstParam(1), + HasDeclaredCopyConstructorWithConstParam(0), + HasDeclaredCopyAssignmentWithConstParam(0), IsLambda(0), + IsParsingBaseSpecifiers(0), NumBases(0), NumVBases(0), Bases(), VBases(), Definition(D), FirstFriend() {} CXXBaseSpecifier *CXXRecordDecl::DefinitionData::getBasesSlowCase() const { @@ -144,12 +144,12 @@ if (!C.getLangOpts().CPlusPlus1z) { // C++ [dcl.init.aggr]p1: // An aggregate is [...] a class with [...] no base classes [...]. - data().Aggregate = false; + data().Aggregate = 0; } // C++ [class]p4: // A POD-struct is an aggregate class... - data().PlainOldData = false; + data().PlainOldData = 0; } // The set of seen virtual base types. @@ -183,33 +183,33 @@ // or has no base classes with non-static data members, and // If this is the second non-empty base, then neither of these two // clauses can be true. - data().IsStandardLayout = false; + data().IsStandardLayout = 0; } - data().Empty = false; - data().HasNoNonEmptyBases = false; + data().Empty = 0; + data().HasNoNonEmptyBases = 0; } // C++1z [dcl.init.agg]p1: // An aggregate is a class with [...] no private or protected base classes if (Base->getAccessSpecifier() != AS_public) - data().Aggregate = false; + data().Aggregate = 0; // C++ [class.virtual]p1: // A class that declares or inherits a virtual function is called a // polymorphic class. if (BaseClassDecl->isPolymorphic()) - data().Polymorphic = true; + data().Polymorphic = 1; // C++0x [class]p7: // A standard-layout class is a class that: [...] // -- has no non-standard-layout base classes if (!BaseClassDecl->isStandardLayout()) - data().IsStandardLayout = false; + data().IsStandardLayout = 0; // Record if this base is the first non-literal field or base. if (!hasNonLiteralTypeFieldsOrBases() && !BaseType->isLiteralType(C)) - data().HasNonLiteralTypeFieldsOrBases = true; + data().HasNonLiteralTypeFieldsOrBases = 1; // Now go through all virtual bases of this base and add them. for (const auto &VBase : BaseClassDecl->vbases()) { @@ -224,11 +224,11 @@ // 'const B&' or 'const volatile B&' [...] if (CXXRecordDecl *VBaseDecl = VBase.getType()->getAsCXXRecordDecl()) if (!VBaseDecl->hasCopyConstructorWithConstParam()) - data().ImplicitCopyConstructorHasConstParam = false; + data().ImplicitCopyConstructorHasConstParam = 0; // C++1z [dcl.init.agg]p1: // An aggregate is a class with [...] no virtual base classes - data().Aggregate = false; + data().Aggregate = 0; } } @@ -240,11 +240,11 @@ // C++11 [meta.unary.prop] is_empty: // T is a class type, but not a union type, with ... no virtual base // classes - data().Empty = false; + data().Empty = 0; // C++1z [dcl.init.agg]p1: // An aggregate is a class with [...] no virtual base classes - data().Aggregate = false; + data().Aggregate = 0; // C++11 [class.ctor]p5, C++11 [class.copy]p12, C++11 [class.copy]p25: // A [default constructor, copy/move constructor, or copy/move assignment @@ -255,12 +255,12 @@ // C++0x [class]p7: // A standard-layout class is a class that: [...] // -- has [...] no virtual base classes - data().IsStandardLayout = false; + data().IsStandardLayout = 0; // C++11 [dcl.constexpr]p4: // In the definition of a constexpr constructor [...] // -- the class shall not have any virtual base classes - data().DefaultedDefaultConstructorIsConstexpr = false; + data().DefaultedDefaultConstructorIsConstexpr = 0; } else { // C++ [class.ctor]p5: // A default constructor is trivial [...] if: @@ -302,7 +302,7 @@ // requirements of a constexpr constructor, the implicitly-defined // default constructor is constexpr. if (!BaseClassDecl->hasConstexprDefaultConstructor()) - data().DefaultedDefaultConstructorIsConstexpr = false; + data().DefaultedDefaultConstructorIsConstexpr = 0; } // C++ [class.ctor]p3: @@ -312,7 +312,7 @@ data().HasTrivialSpecialMembers &= ~SMF_Destructor; if (!BaseClassDecl->hasIrrelevantDestructor()) - data().HasIrrelevantDestructor = false; + data().HasIrrelevantDestructor = 0; // C++11 [class.copy]p18: // The implicitly-declared copy assignment oeprator for a class X will @@ -320,7 +320,7 @@ // of X has a copy assignment operator whose parameter is of type 'const // B&', 'const volatile B&', or 'B' [...] if (!BaseClassDecl->hasCopyAssignmentWithConstParam()) - data().ImplicitCopyAssignmentHasConstParam = false; + data().ImplicitCopyAssignmentHasConstParam = 0; // C++11 [class.copy]p8: // The implicitly-declared copy constructor for a class X will have @@ -328,7 +328,7 @@ // has a copy constructor whose first parameter is of type // 'const B&' or 'const volatile B&' [...] if (!BaseClassDecl->hasCopyConstructorWithConstParam()) - data().ImplicitCopyConstructorHasConstParam = false; + data().ImplicitCopyConstructorHasConstParam = 0; // A class has an Objective-C object member if... or any of its bases // has an Objective-C object member. @@ -340,19 +340,19 @@ // Keep track of the presence of mutable fields. if (BaseClassDecl->hasMutableFields()) - data().HasMutableFields = true; + data().HasMutableFields = 1; if (BaseClassDecl->hasUninitializedReferenceMember()) - data().HasUninitializedReferenceMember = true; + data().HasUninitializedReferenceMember = 1; if (!BaseClassDecl->allowConstDefaultInit()) - data().HasUninitializedFields = true; + data().HasUninitializedFields = 1; addedClassSubobject(BaseClassDecl); } if (VBases.empty()) { - data().IsParsingBaseSpecifiers = false; + data().IsParsingBaseSpecifiers = 0; return; } @@ -366,7 +366,7 @@ data().getVBases()[I] = *VBases[I]; } - data().IsParsingBaseSpecifiers = false; + data().IsParsingBaseSpecifiers = 0; } void CXXRecordDecl::addedClassSubobject(CXXRecordDecl *Subobj) { @@ -377,7 +377,7 @@ // -- a non-static data member of class type M (or array thereof) // that cannot be copied or moved [...] if (!Subobj->hasSimpleMoveConstructor()) - data().NeedOverloadResolutionForMoveConstructor = true; + data().NeedOverloadResolutionForMoveConstructor = 1; // C++11 [class.copy]p23: // A defaulted copy/move assignment operator for a class X is defined as @@ -386,7 +386,7 @@ // -- a non-static data member of class type M (or array thereof) // that cannot be copied or moved [...] if (!Subobj->hasSimpleMoveAssignment()) - data().NeedOverloadResolutionForMoveAssignment = true; + data().NeedOverloadResolutionForMoveAssignment = 1; // C++11 [class.ctor]p5, C++11 [class.copy]p11, C++11 [class.dtor]p5: // A defaulted [ctor or dtor] for a class X is defined as @@ -396,8 +396,8 @@ // -- any non-static data member has a type with a destructor // that is deleted or inaccessible from the defaulted [ctor or dtor]. if (!Subobj->hasSimpleDestructor()) { - data().NeedOverloadResolutionForMoveConstructor = true; - data().NeedOverloadResolutionForDestructor = true; + data().NeedOverloadResolutionForMoveConstructor = 1; + data().NeedOverloadResolutionForDestructor = 1; } } @@ -428,7 +428,7 @@ void CXXRecordDecl::markedVirtualFunctionPure() { // C++ [class.abstract]p2: // A class is abstract if it has at least one pure virtual function. - data().Abstract = true; + data().Abstract = 1; } void CXXRecordDecl::addedMember(Decl *D) { @@ -437,7 +437,7 @@ !isa(D) && (!isa(D) || cast(D)->getTagKind() == TTK_Class || cast(D)->getTagKind() == TTK_Interface)) - data().HasOnlyCMembers = false; + data().HasOnlyCMembers = 0; // Ignore friends and invalid declarations. if (D->getFriendObjectKind() || D->isInvalidDecl()) @@ -451,20 +451,20 @@ if (Method->isVirtual()) { // C++ [dcl.init.aggr]p1: // An aggregate is an array or a class with [...] no virtual functions. - data().Aggregate = false; + data().Aggregate = 0; // C++ [class]p4: // A POD-struct is an aggregate class... - data().PlainOldData = false; + data().PlainOldData = 0; // Virtual functions make the class non-empty. // FIXME: Standard ref? - data().Empty = false; + data().Empty = 0; // C++ [class.virtual]p1: // A class that declares or inherits a virtual function is called a // polymorphic class. - data().Polymorphic = true; + data().Polymorphic = 1; // C++11 [class.ctor]p5, C++11 [class.copy]p12, C++11 [class.copy]p25: // A [default constructor, copy/move constructor, or copy/move @@ -475,7 +475,7 @@ // C++0x [class]p7: // A standard-layout class is a class that: [...] // -- has no virtual functions - data().IsStandardLayout = false; + data().IsStandardLayout = 0; } } @@ -492,13 +492,13 @@ if (CXXConstructorDecl *Constructor = dyn_cast(D)) { if (!Constructor->isImplicit()) { // Note that we have a user-declared constructor. - data().UserDeclaredConstructor = true; + data().UserDeclaredConstructor = 1; // C++ [class]p4: // A POD-struct is an aggregate class [...] // Since the POD bit is meant to be C++03 POD-ness, clear it even if the // type is technically an aggregate in C++0x since it wouldn't be in 03. - data().PlainOldData = false; + data().PlainOldData = 0; } // Technically, "user-provided" is only defined for special member @@ -510,11 +510,11 @@ SMKind |= SMF_DefaultConstructor; if (UserProvided) - data().UserProvidedDefaultConstructor = true; + data().UserProvidedDefaultConstructor = 1; if (Constructor->isConstexpr()) - data().HasConstexprDefaultConstructor = true; + data().HasConstexprDefaultConstructor = 1; if (Constructor->isDefaulted()) - data().HasDefaultedDefaultConstructor = true; + data().HasDefaultedDefaultConstructor = 1; } if (!FunTmpl) { @@ -523,7 +523,7 @@ SMKind |= SMF_CopyConstructor; if (Quals & Qualifiers::Const) - data().HasDeclaredCopyConstructorWithConstParam = true; + data().HasDeclaredCopyConstructorWithConstParam = 1; } else if (Constructor->isMoveConstructor()) SMKind |= SMF_MoveConstructor; } @@ -531,7 +531,7 @@ // Record if we see any constexpr constructors which are neither copy // nor move constructors. if (Constructor->isConstexpr() && !Constructor->isCopyOrMoveConstructor()) - data().HasConstexprNonCopyMoveConstructor = true; + data().HasConstexprNonCopyMoveConstructor = 1; // C++ [dcl.init.aggr]p1: // An aggregate is an array or a class with no user-declared @@ -541,7 +541,7 @@ // constructors [...]. if (getASTContext().getLangOpts().CPlusPlus11 ? UserProvided : !Constructor->isImplicit()) - data().Aggregate = false; + data().Aggregate = 0; } // Handle destructors. @@ -549,7 +549,7 @@ SMKind |= SMF_Destructor; if (DD->isUserProvided()) - data().HasIrrelevantDestructor = false; + data().HasIrrelevantDestructor = 0; // If the destructor is explicitly defaulted and not trivial or not public // or if the destructor is deleted, we clear HasIrrelevantDestructor in // finishedDefaultedOrDeletedMember. @@ -568,7 +568,7 @@ const ReferenceType *ParamTy = Method->getParamDecl(0)->getType()->getAs(); if (!ParamTy || ParamTy->getPointeeType().isConstQualified()) - data().HasDeclaredCopyAssignmentWithConstParam = true; + data().HasDeclaredCopyAssignmentWithConstParam = 1; } if (Method->isMoveAssignmentOperator()) @@ -632,7 +632,7 @@ // // Also, a user-declared move assignment operator makes a class non-POD. // This is an extension in C++03. - data().PlainOldData = false; + data().PlainOldData = 0; } } @@ -654,8 +654,8 @@ // // A POD must be an aggregate. if (D->getAccess() == AS_private || D->getAccess() == AS_protected) { - data().Aggregate = false; - data().PlainOldData = false; + data().Aggregate = 0; + data().PlainOldData = 0; } // C++0x [class]p7: @@ -663,24 +663,24 @@ // [...] // -- has the same access control for all non-static data members, switch (D->getAccess()) { - case AS_private: data().HasPrivateFields = true; break; - case AS_protected: data().HasProtectedFields = true; break; - case AS_public: data().HasPublicFields = true; break; + case AS_private: data().HasPrivateFields = 1; break; + case AS_protected: data().HasProtectedFields = 1; break; + case AS_public: data().HasPublicFields = 1; break; case AS_none: llvm_unreachable("Invalid access specifier"); }; if ((data().HasPrivateFields + data().HasProtectedFields + data().HasPublicFields) > 1) - data().IsStandardLayout = false; + data().IsStandardLayout = 0; // Keep track of the presence of mutable fields. if (Field->isMutable()) - data().HasMutableFields = true; + data().HasMutableFields = 1; // C++11 [class.union]p8, DR1460: // If X is a union, a non-static data member of X that is not an anonymous // union is a variant member of X. if (isUnion() && !Field->isAnonymousStructOrUnion()) - data().HasVariantMembers = true; + data().HasVariantMembers = 1; // C++0x [class]p9: // A POD struct is a class that is both a trivial class and a @@ -703,40 +703,40 @@ // non-trivial. setHasObjectMember(true); struct DefinitionData &Data = data(); - Data.PlainOldData = false; + Data.PlainOldData = 0; Data.HasTrivialSpecialMembers = 0; - Data.HasIrrelevantDestructor = false; + Data.HasIrrelevantDestructor = 0; } } else if (!T.isCXX98PODType(Context)) - data().PlainOldData = false; + data().PlainOldData = 0; if (T->isReferenceType()) { if (!Field->hasInClassInitializer()) - data().HasUninitializedReferenceMember = true; + data().HasUninitializedReferenceMember = 1; // C++0x [class]p7: // A standard-layout class is a class that: // -- has no non-static data members of type [...] reference, - data().IsStandardLayout = false; + data().IsStandardLayout = 0; } if (!Field->hasInClassInitializer() && !Field->isMutable()) { if (CXXRecordDecl *FieldType = Field->getType()->getAsCXXRecordDecl()) { if (FieldType->hasDefinition() && !FieldType->allowConstDefaultInit()) - data().HasUninitializedFields = true; + data().HasUninitializedFields = 1; } else { - data().HasUninitializedFields = true; + data().HasUninitializedFields = 1; } } // Record if this field is the first non-literal or volatile field or base. if (!T->isLiteralType(Context) || T.isVolatileQualified()) - data().HasNonLiteralTypeFieldsOrBases = true; + data().HasNonLiteralTypeFieldsOrBases = 1; if (Field->hasInClassInitializer() || (Field->isAnonymousStructOrUnion() && Field->getType()->getAsCXXRecordDecl()->hasInClassInitializer())) { - data().HasInClassInitializer = true; + data().HasInClassInitializer = 1; // C++11 [class]p5: // A default constructor is trivial if [...] no non-static data member @@ -749,11 +749,11 @@ // // This rule was removed in C++14. if (!getASTContext().getLangOpts().CPlusPlus14) - data().Aggregate = false; + data().Aggregate = 0; // C++11 [class]p10: // A POD struct is [...] a trivial class. - data().PlainOldData = false; + data().PlainOldData = 0; } // C++11 [class.copy]p23: @@ -761,7 +761,7 @@ // as deleted if X has: // -- a non-static data member of reference type if (T->isReferenceType()) - data().DefaultedMoveAssignmentIsDeleted = true; + data().DefaultedMoveAssignmentIsDeleted = 1; if (const RecordType *RecordTy = T->getAs()) { CXXRecordDecl* FieldRec = cast(RecordTy->getDecl()); @@ -771,8 +771,8 @@ // We may need to perform overload resolution to determine whether a // field can be moved if it's const or volatile qualified. if (T.getCVRQualifiers() & (Qualifiers::Const | Qualifiers::Volatile)) { - data().NeedOverloadResolutionForMoveConstructor = true; - data().NeedOverloadResolutionForMoveAssignment = true; + data().NeedOverloadResolutionForMoveConstructor = 1; + data().NeedOverloadResolutionForMoveAssignment = 1; } // C++11 [class.ctor]p5, C++11 [class.copy]p11: @@ -782,11 +782,11 @@ // non-trivial [corresponding special member] if (isUnion()) { if (FieldRec->hasNonTrivialMoveConstructor()) - data().DefaultedMoveConstructorIsDeleted = true; + data().DefaultedMoveConstructorIsDeleted = 1; if (FieldRec->hasNonTrivialMoveAssignment()) - data().DefaultedMoveAssignmentIsDeleted = true; + data().DefaultedMoveAssignmentIsDeleted = 1; if (FieldRec->hasNonTrivialDestructor()) - data().DefaultedDestructorIsDeleted = true; + data().DefaultedDestructorIsDeleted = 1; } // C++0x [class.ctor]p5: @@ -828,7 +828,7 @@ if (!FieldRec->hasTrivialDestructor()) data().HasTrivialSpecialMembers &= ~SMF_Destructor; if (!FieldRec->hasIrrelevantDestructor()) - data().HasIrrelevantDestructor = false; + data().HasIrrelevantDestructor = 0; if (FieldRec->hasObjectMember()) setHasObjectMember(true); if (FieldRec->hasVolatileMember()) @@ -839,7 +839,7 @@ // -- has no non-static data members of type non-standard-layout // class (or array of such types) [...] if (!FieldRec->isStandardLayout()) - data().IsStandardLayout = false; + data().IsStandardLayout = 0; // C++0x [class]p7: // A standard-layout class is a class that: @@ -859,7 +859,7 @@ if (data().IsStandardLayout && data().Empty) { for (const auto &BI : bases()) { if (Context.hasSameUnqualifiedType(BI.getType(), T)) { - data().IsStandardLayout = false; + data().IsStandardLayout = 0; break; } } @@ -867,7 +867,7 @@ // Keep track of the presence of mutable fields. if (FieldRec->hasMutableFields()) - data().HasMutableFields = true; + data().HasMutableFields = 1; // C++11 [class.copy]p13: // If the implicitly-defined constructor would satisfy the @@ -880,7 +880,7 @@ !FieldRec->hasConstexprDefaultConstructor() && !isUnion()) // The standard requires any in-class initializer to be a constant // expression. We consider this to be a defect. - data().DefaultedDefaultConstructorIsConstexpr = false; + data().DefaultedDefaultConstructorIsConstexpr = 0; // C++11 [class.copy]p8: // The implicitly-declared copy constructor for a class X will have @@ -889,7 +889,7 @@ // such class type has a copy constructor whose first parameter is // of type 'const M&' or 'const volatile M&'. if (!FieldRec->hasCopyConstructorWithConstParam()) - data().ImplicitCopyConstructorHasConstParam = false; + data().ImplicitCopyConstructorHasConstParam = 0; // C++11 [class.copy]p18: // The implicitly-declared copy assignment oeprator for a class X will @@ -898,24 +898,24 @@ // thereof), each such class type has a copy assignment operator whose // parameter is of type 'const M&', 'const volatile M&' or 'M'. if (!FieldRec->hasCopyAssignmentWithConstParam()) - data().ImplicitCopyAssignmentHasConstParam = false; + data().ImplicitCopyAssignmentHasConstParam = 0; if (FieldRec->hasUninitializedReferenceMember() && !Field->hasInClassInitializer()) - data().HasUninitializedReferenceMember = true; + data().HasUninitializedReferenceMember = 1; // C++11 [class.union]p8, DR1460: // a non-static data member of an anonymous union that is a member of // X is also a variant member of X. if (FieldRec->hasVariantMembers() && Field->isAnonymousStructOrUnion()) - data().HasVariantMembers = true; + data().HasVariantMembers = 1; } } else { // Base element type of field is a non-class type. if (!T->isLiteralType(Context) || (!Field->hasInClassInitializer() && !isUnion())) - data().DefaultedDefaultConstructorIsConstexpr = false; + data().DefaultedDefaultConstructorIsConstexpr = 0; // C++11 [class.copy]p23: // A defaulted copy/move assignment operator for a class X is defined @@ -923,7 +923,7 @@ // -- a non-static data member of const non-class type (or array // thereof) if (T.isConstQualified()) - data().DefaultedMoveAssignmentIsDeleted = true; + data().DefaultedMoveAssignmentIsDeleted = 1; } // C++0x [class]p7: @@ -935,7 +935,7 @@ // At this point we know that we have a non-static data member, so the last // clause holds. if (!data().HasNoNonEmptyBases) - data().IsStandardLayout = false; + data().IsStandardLayout = 0; // If this is not a zero-length bit-field, then the class is not empty. if (data().Empty) { @@ -943,7 +943,7 @@ (!Field->getBitWidth()->isTypeDependent() && !Field->getBitWidth()->isValueDependent() && Field->getBitWidthValue(Context) != 0)) - data().Empty = false; + data().Empty = 0; } } @@ -967,7 +967,7 @@ if (Constructor->isDefaultConstructor()) { SMKind |= SMF_DefaultConstructor; if (Constructor->isConstexpr()) - data().HasConstexprDefaultConstructor = true; + data().HasConstexprDefaultConstructor = 1; } if (Constructor->isCopyConstructor()) SMKind |= SMF_CopyConstructor; @@ -975,11 +975,11 @@ SMKind |= SMF_MoveConstructor; else if (Constructor->isConstexpr()) // We may now know that the constructor is constexpr. - data().HasConstexprNonCopyMoveConstructor = true; + data().HasConstexprNonCopyMoveConstructor = 1; } else if (isa(D)) { SMKind |= SMF_Destructor; if (!D->isTrivial() || D->getAccess() != AS_public || D->isDeleted()) - data().HasIrrelevantDestructor = false; + data().HasIrrelevantDestructor = 0; } else if (D->isCopyAssignmentOperator()) SMKind |= SMF_CopyAssignment; else if (D->isMoveAssignmentOperator()) @@ -1207,7 +1207,7 @@ // If visible conversion list is not evaluated, evaluate it. if (!data().ComputedVisibleConversions) { CollectVisibleConversions(Ctx, this, *Set); - data().ComputedVisibleConversions = true; + data().ComputedVisibleConversions = 1; } } return llvm::make_range(Set->begin(), Set->end()); @@ -1401,7 +1401,7 @@ // pure virtual function for which the final overrider is pure // virtual. if (SO->second.front().Method->isPure()) { - data().Abstract = true; + data().Abstract = 1; Done = true; break; } Index: lib/AST/DeclObjC.cpp =================================================================== --- lib/AST/DeclObjC.cpp +++ lib/AST/DeclObjC.cpp @@ -788,8 +788,8 @@ void ObjCMethodDecl::setAsRedeclaration(const ObjCMethodDecl *PrevMethod) { assert(PrevMethod); getASTContext().setObjCMethodRedeclaration(PrevMethod, this); - IsRedeclaration = true; - PrevMethod->HasRedeclaration = true; + IsRedeclaration = 1; + PrevMethod->HasRedeclaration = 1; } void ObjCMethodDecl::setParamsAndSelLocs(ASTContext &C, Index: lib/AST/DeclPrinter.cpp =================================================================== --- lib/AST/DeclPrinter.cpp +++ lib/AST/DeclPrinter.cpp @@ -1008,10 +1008,10 @@ void DeclPrinter::PrintObjCTypeParams(ObjCTypeParamList *Params) { Out << "<"; - unsigned First = true; + unsigned First = 1; for (auto *Param : *Params) { if (First) { - First = false; + First = 0; } else { Out << ", "; } Index: lib/AST/DeclTemplate.cpp =================================================================== --- lib/AST/DeclTemplate.cpp +++ lib/AST/DeclTemplate.cpp @@ -33,7 +33,7 @@ ArrayRef Params, SourceLocation RAngleLoc) : TemplateLoc(TemplateLoc), LAngleLoc(LAngleLoc), RAngleLoc(RAngleLoc), - NumParams(Params.size()), ContainsUnexpandedParameterPack(false) { + NumParams(Params.size()), ContainsUnexpandedParameterPack(0) { assert(this->NumParams == NumParams && "Too many template parameters"); for (unsigned Idx = 0; Idx < NumParams; ++Idx) { NamedDecl *P = Params[Idx]; @@ -42,11 +42,11 @@ if (!P->isTemplateParameterPack()) { if (NonTypeTemplateParmDecl *NTTP = dyn_cast(P)) if (NTTP->getType()->containsUnexpandedParameterPack()) - ContainsUnexpandedParameterPack = true; + ContainsUnexpandedParameterPack = 1; if (TemplateTemplateParmDecl *TTP = dyn_cast(P)) if (TTP->getTemplateParameters()->containsUnexpandedParameterPack()) - ContainsUnexpandedParameterPack = true; + ContainsUnexpandedParameterPack = 1; // FIXME: If a default argument contains an unexpanded parameter pack, the // template parameter list does too. Index: lib/AST/DeclarationName.cpp =================================================================== --- lib/AST/DeclarationName.cpp +++ lib/AST/DeclarationName.cpp @@ -100,8 +100,8 @@ for (unsigned I = 0, N = std::min(LN, RN); I != N; ++I) { switch (LHSSelector.getNameForSlot(I).compare( RHSSelector.getNameForSlot(I))) { - case -1: return true; - case 1: return false; + case -1: return 1; + case 1: return 0; default: break; } } @@ -149,7 +149,7 @@ if (!Policy.LangOpts.CPlusPlus) { // Passed policy is the default one from operator <<, use a C++ policy. LangOptions LO; - LO.CPlusPlus = true; + LO.CPlusPlus = 1; ClassType.print(OS, PrintingPolicy(LO)); } else { ClassType.print(OS, Policy); @@ -209,8 +209,8 @@ if (!Policy.LangOpts.CPlusPlus) { // Passed policy is the default one from operator <<, use a C++ policy. LangOptions LO; - LO.CPlusPlus = true; - LO.Bool = true; + LO.CPlusPlus = 1; + LO.Bool = 1; Type.print(OS, PrintingPolicy(LO)); } else { Type.print(OS, Policy); @@ -576,8 +576,8 @@ else if (Name.getNameKind() == DeclarationName::CXXConversionFunctionName) OS << "operator "; LangOptions LO; - LO.CPlusPlus = true; - LO.Bool = true; + LO.CPlusPlus = 1; + LO.Bool = 1; OS << TInfo->getType().getAsString(PrintingPolicy(LO)); } else OS << Name; Index: lib/AST/Expr.cpp =================================================================== --- lib/AST/Expr.cpp +++ lib/AST/Expr.cpp @@ -316,7 +316,7 @@ // Is the declaration a parameter pack? if (getDecl()->isParameterPack()) - ExprBits.ContainsUnexpandedParameterPack = true; + ExprBits.ContainsUnexpandedParameterPack = 1; } DeclRefExpr::DeclRefExpr(const ASTContext &Ctx, @@ -335,9 +335,9 @@ NestedNameSpecifierLoc(QualifierLoc); auto *NNS = QualifierLoc.getNestedNameSpecifier(); if (NNS->isInstantiationDependent()) - ExprBits.InstantiationDependent = true; + ExprBits.InstantiationDependent = 1; if (NNS->containsUnexpandedParameterPack()) - ExprBits.ContainsUnexpandedParameterPack = true; + ExprBits.ContainsUnexpandedParameterPack = 1; } DeclRefExprBits.HasFoundDecl = FoundD ? 1 : 0; if (FoundD) @@ -739,7 +739,7 @@ FloatingLiteral::FloatingLiteral(const ASTContext &C, EmptyShell Empty) : Expr(FloatingLiteralClass, Empty) { setRawSemantics(IEEEhalf); - FloatingLiteralBits.IsExact = false; + FloatingLiteralBits.IsExact = 0; } FloatingLiteral * @@ -1185,13 +1185,13 @@ void CallExpr::updateDependenciesFromArg(Expr *Arg) { if (Arg->isTypeDependent()) - ExprBits.TypeDependent = true; + ExprBits.TypeDependent = 1; if (Arg->isValueDependent()) - ExprBits.ValueDependent = true; + ExprBits.ValueDependent = 1; if (Arg->isInstantiationDependent()) - ExprBits.InstantiationDependent = true; + ExprBits.InstantiationDependent = 1; if (Arg->containsUnexpandedParameterPack()) - ExprBits.ContainsUnexpandedParameterPack = true; + ExprBits.ContainsUnexpandedParameterPack = 1; } Decl *CallExpr::getCalleeDecl() { @@ -1357,9 +1357,9 @@ for (unsigned i = 0; i != exprs.size(); ++i) { if (exprs[i]->isTypeDependent() || exprs[i]->isValueDependent()) - ExprBits.ValueDependent = true; + ExprBits.ValueDependent = 1; if (exprs[i]->containsUnexpandedParameterPack()) - ExprBits.ContainsUnexpandedParameterPack = true; + ExprBits.ContainsUnexpandedParameterPack = 1; setIndexExpr(i, exprs[i]); } @@ -1383,7 +1383,7 @@ E->containsUnexpandedParameterPack()), OpLoc(op), RParenLoc(rp) { UnaryExprOrTypeTraitExprBits.Kind = ExprKind; - UnaryExprOrTypeTraitExprBits.IsType = false; + UnaryExprOrTypeTraitExprBits.IsType = 0; Argument.Ex = E; // Check to see if we are in the situation where alignof(decl) should be @@ -1927,13 +1927,13 @@ sawArrayRangeDesignator(false); for (unsigned I = 0; I != initExprs.size(); ++I) { if (initExprs[I]->isTypeDependent()) - ExprBits.TypeDependent = true; + ExprBits.TypeDependent = 1; if (initExprs[I]->isValueDependent()) - ExprBits.ValueDependent = true; + ExprBits.ValueDependent = 1; if (initExprs[I]->isInstantiationDependent()) - ExprBits.InstantiationDependent = true; + ExprBits.InstantiationDependent = 1; if (initExprs[I]->containsUnexpandedParameterPack()) - ExprBits.ContainsUnexpandedParameterPack = true; + ExprBits.ContainsUnexpandedParameterPack = 1; } InitExprs.insert(C, InitExprs.end(), initExprs.begin(), initExprs.end()); @@ -3575,13 +3575,13 @@ SubExprs = new (C) Stmt*[args.size()]; for (unsigned i = 0; i != args.size(); i++) { if (args[i]->isTypeDependent()) - ExprBits.TypeDependent = true; + ExprBits.TypeDependent = 1; if (args[i]->isValueDependent()) - ExprBits.ValueDependent = true; + ExprBits.ValueDependent = 1; if (args[i]->isInstantiationDependent()) - ExprBits.InstantiationDependent = true; + ExprBits.InstantiationDependent = 1; if (args[i]->containsUnexpandedParameterPack()) - ExprBits.ContainsUnexpandedParameterPack = true; + ExprBits.ContainsUnexpandedParameterPack = 1; SubExprs[i] = args[i]; } @@ -3688,12 +3688,12 @@ // Compute type- and value-dependence. Expr *Index = IndexExprs[IndexIdx]; if (Index->isTypeDependent() || Index->isValueDependent()) - ExprBits.TypeDependent = ExprBits.ValueDependent = true; + ExprBits.TypeDependent = ExprBits.ValueDependent = 1; if (Index->isInstantiationDependent()) - ExprBits.InstantiationDependent = true; + ExprBits.InstantiationDependent = 1; // Propagate unexpanded parameter packs. if (Index->containsUnexpandedParameterPack()) - ExprBits.ContainsUnexpandedParameterPack = true; + ExprBits.ContainsUnexpandedParameterPack = 1; // Copy the index expressions into permanent storage. *Child++ = IndexExprs[IndexIdx++]; @@ -3703,17 +3703,17 @@ Expr *End = IndexExprs[IndexIdx + 1]; if (Start->isTypeDependent() || Start->isValueDependent() || End->isTypeDependent() || End->isValueDependent()) { - ExprBits.TypeDependent = ExprBits.ValueDependent = true; - ExprBits.InstantiationDependent = true; + ExprBits.TypeDependent = ExprBits.ValueDependent = 1; + ExprBits.InstantiationDependent = 1; } else if (Start->isInstantiationDependent() || End->isInstantiationDependent()) { - ExprBits.InstantiationDependent = true; + ExprBits.InstantiationDependent = 1; } // Propagate unexpanded parameter packs. if (Start->containsUnexpandedParameterPack() || End->containsUnexpandedParameterPack()) - ExprBits.ContainsUnexpandedParameterPack = true; + ExprBits.ContainsUnexpandedParameterPack = 1; // Copy the start/end expressions into permanent storage. *Child++ = IndexExprs[IndexIdx++]; @@ -3852,13 +3852,13 @@ Exprs = new (C) Stmt*[exprs.size()]; for (unsigned i = 0; i != exprs.size(); ++i) { if (exprs[i]->isTypeDependent()) - ExprBits.TypeDependent = true; + ExprBits.TypeDependent = 1; if (exprs[i]->isValueDependent()) - ExprBits.ValueDependent = true; + ExprBits.ValueDependent = 1; if (exprs[i]->isInstantiationDependent()) - ExprBits.InstantiationDependent = true; + ExprBits.InstantiationDependent = 1; if (exprs[i]->containsUnexpandedParameterPack()) - ExprBits.ContainsUnexpandedParameterPack = true; + ExprBits.ContainsUnexpandedParameterPack = 1; Exprs[i] = exprs[i]; } @@ -3926,13 +3926,13 @@ getSubExprsBuffer()[i] = E; if (E->isTypeDependent()) - ExprBits.TypeDependent = true; + ExprBits.TypeDependent = 1; if (E->isValueDependent()) - ExprBits.ValueDependent = true; + ExprBits.ValueDependent = 1; if (E->isInstantiationDependent()) - ExprBits.InstantiationDependent = true; + ExprBits.InstantiationDependent = 1; if (E->containsUnexpandedParameterPack()) - ExprBits.ContainsUnexpandedParameterPack = true; + ExprBits.ContainsUnexpandedParameterPack = 1; if (isa(E)) assert(cast(E)->getSourceExpr() != nullptr && @@ -3968,13 +3968,13 @@ assert(args.size() == getNumSubExprs(op) && "wrong number of subexpressions"); for (unsigned i = 0; i != args.size(); i++) { if (args[i]->isTypeDependent()) - ExprBits.TypeDependent = true; + ExprBits.TypeDependent = 1; if (args[i]->isValueDependent()) - ExprBits.ValueDependent = true; + ExprBits.ValueDependent = 1; if (args[i]->isInstantiationDependent()) - ExprBits.InstantiationDependent = true; + ExprBits.InstantiationDependent = 1; if (args[i]->containsUnexpandedParameterPack()) - ExprBits.ContainsUnexpandedParameterPack = true; + ExprBits.ContainsUnexpandedParameterPack = 1; SubExprs[i] = args[i]; } Index: lib/AST/ExprCXX.cpp =================================================================== --- lib/AST/ExprCXX.cpp +++ lib/AST/ExprCXX.cpp @@ -85,29 +85,29 @@ unsigned i = 0; if (Array) { if (arraySize->isInstantiationDependent()) - ExprBits.InstantiationDependent = true; + ExprBits.InstantiationDependent = 1; if (arraySize->containsUnexpandedParameterPack()) - ExprBits.ContainsUnexpandedParameterPack = true; + ExprBits.ContainsUnexpandedParameterPack = 1; SubExprs[i++] = arraySize; } if (initializer) { if (initializer->isInstantiationDependent()) - ExprBits.InstantiationDependent = true; + ExprBits.InstantiationDependent = 1; if (initializer->containsUnexpandedParameterPack()) - ExprBits.ContainsUnexpandedParameterPack = true; + ExprBits.ContainsUnexpandedParameterPack = 1; SubExprs[i++] = initializer; } for (unsigned j = 0; j != placementArgs.size(); ++j) { if (placementArgs[j]->isInstantiationDependent()) - ExprBits.InstantiationDependent = true; + ExprBits.InstantiationDependent = 1; if (placementArgs[j]->containsUnexpandedParameterPack()) - ExprBits.ContainsUnexpandedParameterPack = true; + ExprBits.ContainsUnexpandedParameterPack = 1; SubExprs[i++] = placementArgs[j]; } @@ -278,9 +278,9 @@ for (UnresolvedSetImpl::const_iterator I = Begin; I != End; ++I) { if ((*I)->getDeclContext()->isDependentContext() || isa(*I)) { - ExprBits.TypeDependent = true; - ExprBits.ValueDependent = true; - ExprBits.InstantiationDependent = true; + ExprBits.TypeDependent = 1; + ExprBits.ValueDependent = 1; + ExprBits.InstantiationDependent = 1; } } @@ -302,13 +302,13 @@ Dependent, InstantiationDependent, ContainsUnexpandedParameterPack); if (Dependent) { - ExprBits.TypeDependent = true; - ExprBits.ValueDependent = true; + ExprBits.TypeDependent = 1; + ExprBits.ValueDependent = 1; } if (InstantiationDependent) - ExprBits.InstantiationDependent = true; + ExprBits.InstantiationDependent = 1; if (ContainsUnexpandedParameterPack) - ExprBits.ContainsUnexpandedParameterPack = true; + ExprBits.ContainsUnexpandedParameterPack = 1; } else if (TemplateKWLoc.isValid()) { getTrailingASTTemplateKWAndArgsInfo()->initializeFrom(TemplateKWLoc); } @@ -795,11 +795,11 @@ assert(args[i] && "NULL argument in CXXConstructExpr"); if (args[i]->isValueDependent()) - ExprBits.ValueDependent = true; + ExprBits.ValueDependent = 1; if (args[i]->isInstantiationDependent()) - ExprBits.InstantiationDependent = true; + ExprBits.InstantiationDependent = 1; if (args[i]->containsUnexpandedParameterPack()) - ExprBits.ContainsUnexpandedParameterPack = true; + ExprBits.ContainsUnexpandedParameterPack = 1; Args[i] = args[i]; } @@ -1078,7 +1078,7 @@ Expr **StoredArgs = getTrailingObjects(); for (unsigned I = 0; I != Args.size(); ++I) { if (Args[I]->containsUnexpandedParameterPack()) - ExprBits.ContainsUnexpandedParameterPack = true; + ExprBits.ContainsUnexpandedParameterPack = 1; StoredArgs[I] = Args[I]; } @@ -1132,7 +1132,7 @@ TemplateKWLoc, *TemplateArgs, getTrailingObjects(), Dependent, InstantiationDependent, ContainsUnexpandedParameterPack); if (ContainsUnexpandedParameterPack) - ExprBits.ContainsUnexpandedParameterPack = true; + ExprBits.ContainsUnexpandedParameterPack = 1; } else if (TemplateKWLoc.isValid()) { getTrailingObjects()->initializeFrom( TemplateKWLoc); Index: lib/AST/ExprObjC.cpp =================================================================== --- lib/AST/ExprObjC.cpp +++ lib/AST/ExprObjC.cpp @@ -25,11 +25,11 @@ Expr **SaveElements = getElements(); for (unsigned I = 0, N = Elements.size(); I != N; ++I) { if (Elements[I]->isTypeDependent() || Elements[I]->isValueDependent()) - ExprBits.ValueDependent = true; + ExprBits.ValueDependent = 1; if (Elements[I]->isInstantiationDependent()) - ExprBits.InstantiationDependent = true; + ExprBits.InstantiationDependent = 1; if (Elements[I]->containsUnexpandedParameterPack()) - ExprBits.ContainsUnexpandedParameterPack = true; + ExprBits.ContainsUnexpandedParameterPack = 1; SaveElements[I] = Elements[I]; } @@ -64,14 +64,14 @@ for (unsigned I = 0; I < NumElements; I++) { if (VK[I].Key->isTypeDependent() || VK[I].Key->isValueDependent() || VK[I].Value->isTypeDependent() || VK[I].Value->isValueDependent()) - ExprBits.ValueDependent = true; + ExprBits.ValueDependent = 1; if (VK[I].Key->isInstantiationDependent() || VK[I].Value->isInstantiationDependent()) - ExprBits.InstantiationDependent = true; + ExprBits.InstantiationDependent = 1; if (VK[I].EllipsisLoc.isInvalid() && (VK[I].Key->containsUnexpandedParameterPack() || VK[I].Value->containsUnexpandedParameterPack())) - ExprBits.ContainsUnexpandedParameterPack = true; + ExprBits.ContainsUnexpandedParameterPack = 1; KeyValues[I].Key = VK[I].Key; KeyValues[I].Value = VK[I].Value; @@ -129,7 +129,7 @@ SelectorOrMethod( reinterpret_cast(Method ? Method : Sel.getAsOpaquePtr())), Kind(IsInstanceSuper ? SuperInstance : SuperClass), - HasMethod(Method != nullptr), IsDelegateInitCall(false), + HasMethod(Method != nullptr), IsDelegateInitCall(0), IsImplicit(isImplicit), SuperLoc(SuperLoc), LBracLoc(LBracLoc), RBracLoc(RBracLoc) { initArgsAndSelLocs(Args, SelLocs, SelLocsK); @@ -148,7 +148,7 @@ T->containsUnexpandedParameterPack()), SelectorOrMethod( reinterpret_cast(Method ? Method : Sel.getAsOpaquePtr())), - Kind(Class), HasMethod(Method != nullptr), IsDelegateInitCall(false), + Kind(Class), HasMethod(Method != nullptr), IsDelegateInitCall(0), IsImplicit(isImplicit), LBracLoc(LBracLoc), RBracLoc(RBracLoc) { initArgsAndSelLocs(Args, SelLocs, SelLocsK); setReceiverPointer(Receiver); @@ -166,7 +166,7 @@ Receiver->containsUnexpandedParameterPack()), SelectorOrMethod( reinterpret_cast(Method ? Method : Sel.getAsOpaquePtr())), - Kind(Instance), HasMethod(Method != nullptr), IsDelegateInitCall(false), + Kind(Instance), HasMethod(Method != nullptr), IsDelegateInitCall(0), IsImplicit(isImplicit), LBracLoc(LBracLoc), RBracLoc(RBracLoc) { initArgsAndSelLocs(Args, SelLocs, SelLocsK); setReceiverPointer(Receiver); @@ -179,13 +179,13 @@ Expr **MyArgs = getArgs(); for (unsigned I = 0; I != Args.size(); ++I) { if (Args[I]->isTypeDependent()) - ExprBits.TypeDependent = true; + ExprBits.TypeDependent = 1; if (Args[I]->isValueDependent()) - ExprBits.ValueDependent = true; + ExprBits.ValueDependent = 1; if (Args[I]->isInstantiationDependent()) - ExprBits.InstantiationDependent = true; + ExprBits.InstantiationDependent = 1; if (Args[I]->containsUnexpandedParameterPack()) - ExprBits.ContainsUnexpandedParameterPack = true; + ExprBits.ContainsUnexpandedParameterPack = 1; MyArgs[I] = Args[I]; } Index: lib/AST/RecordLayoutBuilder.cpp =================================================================== --- lib/AST/RecordLayoutBuilder.cpp +++ lib/AST/RecordLayoutBuilder.cpp @@ -659,8 +659,8 @@ EmptySubobjectMap *EmptySubobjects) : Context(Context), EmptySubobjects(EmptySubobjects), Size(0), Alignment(CharUnits::One()), UnpackedAlignment(CharUnits::One()), - UseExternalLayout(false), InferAlignment(false), Packed(false), - IsUnion(false), IsMac68kAlign(false), IsMsStruct(false), + UseExternalLayout(0), InferAlignment(0), Packed(0), + IsUnion(0), IsMac68kAlign(0), IsMsStruct(0), UnfilledBitsInLastUnit(0), LastBitfieldTypeSize(0), MaxFieldAlignment(CharUnits::Zero()), DataSize(0), NonVirtualSize(CharUnits::Zero()), @@ -1208,7 +1208,7 @@ // The externally-supplied base offset is before the base offset we // computed. Assume that the structure is packed. Alignment = CharUnits::One(); - InferAlignment = false; + InferAlignment = 0; } } @@ -1244,7 +1244,7 @@ // allude to additional (more complicated) semantics, especially with regard // to bit-fields, but gcc appears not to follow that. if (D->hasAttr()) { - IsMac68kAlign = true; + IsMac68kAlign = 1; MaxFieldAlignment = CharUnits::fromQuantity(2); Alignment = CharUnits::fromQuantity(2); } else { @@ -1268,7 +1268,7 @@ Alignment = Context.toCharUnitsFromBits(External.Align); } else { // The external source didn't have alignment information; infer it. - InferAlignment = true; + InferAlignment = 1; } } } @@ -1857,7 +1857,7 @@ // alignment to 1. if (InferAlignment && External.Size < RoundedSize) { Alignment = CharUnits::One(); - InferAlignment = false; + InferAlignment = 0; } setSize(External.Size); return; @@ -1920,7 +1920,7 @@ // The externally-supplied field offset is before the field offset we // computed. Assume that the structure is packed. Alignment = CharUnits::One(); - InferAlignment = false; + InferAlignment = 0; } // Use the externally-supplied field offset. Index: lib/AST/TemplateBase.cpp =================================================================== --- lib/AST/TemplateBase.cpp +++ lib/AST/TemplateBase.cpp @@ -360,7 +360,7 @@ case Type: { PrintingPolicy SubPolicy(Policy); - SubPolicy.SuppressStrongLifetime = true; + SubPolicy.SuppressStrongLifetime = 1; getAsType().print(Out, SubPolicy); break; } @@ -417,8 +417,8 @@ void TemplateArgument::dump(raw_ostream &Out) const { LangOptions LO; // FIXME! see also TemplateName::dump(). - LO.CPlusPlus = true; - LO.Bool = true; + LO.CPlusPlus = 1; + LO.Bool = 1; print(PrintingPolicy(LO), Out); } @@ -505,7 +505,7 @@ SmallString<32> Str; llvm::raw_svector_ostream OS(Str); LangOptions LangOpts; - LangOpts.CPlusPlus = true; + LangOpts.CPlusPlus = 1; PrintingPolicy Policy(LangOpts); Arg.getAsExpr()->printPretty(OS, nullptr, Policy); return DB << OS.str(); @@ -516,7 +516,7 @@ SmallString<32> Str; llvm::raw_svector_ostream OS(Str); LangOptions LangOpts; - LangOpts.CPlusPlus = true; + LangOpts.CPlusPlus = 1; PrintingPolicy Policy(LangOpts); Arg.print(Policy, OS); return DB << OS.str(); Index: lib/AST/TemplateName.cpp =================================================================== --- lib/AST/TemplateName.cpp +++ lib/AST/TemplateName.cpp @@ -211,8 +211,8 @@ std::string NameStr; raw_string_ostream OS(NameStr); LangOptions LO; - LO.CPlusPlus = true; - LO.Bool = true; + LO.CPlusPlus = 1; + LO.Bool = 1; OS << '\''; N.print(OS, PrintingPolicy(LO)); OS << '\''; @@ -222,8 +222,8 @@ void TemplateName::dump(raw_ostream &OS) const { LangOptions LO; // FIXME! - LO.CPlusPlus = true; - LO.Bool = true; + LO.CPlusPlus = 1; + LO.Bool = 1; print(OS, PrintingPolicy(LO)); } Index: lib/AST/Type.cpp =================================================================== --- lib/AST/Type.cpp +++ lib/AST/Type.cpp @@ -3273,7 +3273,7 @@ if (!T->isCanonicalUnqualified()) { const Type *CT = T->getCanonicalTypeInternal().getTypePtr(); ensure(CT); - T->TypeBits.CacheValid = true; + T->TypeBits.CacheValid = 1; T->TypeBits.CachedLinkage = CT->TypeBits.CachedLinkage; T->TypeBits.CachedLocalOrUnnamed = CT->TypeBits.CachedLocalOrUnnamed; return; @@ -3281,7 +3281,7 @@ // Compute the cached properties and then set the cache. CachedProperties Result = computeCachedProperties(T); - T->TypeBits.CacheValid = true; + T->TypeBits.CacheValid = 1; T->TypeBits.CachedLinkage = Result.getLinkage(); T->TypeBits.CachedLocalOrUnnamed = Result.hasLocalOrUnnamedType(); } Index: lib/AST/TypePrinter.cpp =================================================================== --- lib/AST/TypePrinter.cpp +++ lib/AST/TypePrinter.cpp @@ -37,7 +37,7 @@ explicit IncludeStrongLifetimeRAII(PrintingPolicy &Policy) : Policy(Policy), Old(Policy.SuppressStrongLifetime) { if (!Policy.SuppressLifetimeQualifiers) - Policy.SuppressStrongLifetime = false; + Policy.SuppressStrongLifetime = 0; } ~IncludeStrongLifetimeRAII() { Index: lib/Analysis/CFG.cpp =================================================================== --- lib/Analysis/CFG.cpp +++ lib/Analysis/CFG.cpp @@ -4081,7 +4081,7 @@ CFGBlockTerminatorPrint(raw_ostream &os, StmtPrinterHelper* helper, const PrintingPolicy &Policy) : OS(os), Helper(helper), Policy(Policy) { - this->Policy.IncludeNewlines = false; + this->Policy.IncludeNewlines = 0; } void VisitIfStmt(IfStmt *I) { Index: lib/Basic/Diagnostic.cpp =================================================================== --- lib/Basic/Diagnostic.cpp +++ lib/Basic/Diagnostic.cpp @@ -867,7 +867,7 @@ TDT.ToType = getRawArg(ArgNo2); TDT.ElideType = getDiags()->ElideType; TDT.ShowColors = getDiags()->ShowColors; - TDT.TemplateDiffUsed = false; + TDT.TemplateDiffUsed = 0; intptr_t val = reinterpret_cast(&TDT); const char *ArgumentEnd = Argument + ArgumentLen; @@ -876,8 +876,8 @@ // Print the tree. If this diagnostic already has a tree, skip the // second tree. if (getDiags()->PrintTemplateTree && Tree.empty()) { - TDT.PrintFromType = true; - TDT.PrintTree = true; + TDT.PrintFromType = 1; + TDT.PrintTree = 1; getDiags()->ConvertArgToString(Kind, val, StringRef(Modifier, ModifierLen), StringRef(Argument, ArgumentLen), @@ -899,8 +899,8 @@ FormatDiagnostic(Argument, FirstDollar, OutStr); // Append first type - TDT.PrintTree = false; - TDT.PrintFromType = true; + TDT.PrintTree = 0; + TDT.PrintFromType = 1; getDiags()->ConvertArgToString(Kind, val, StringRef(Modifier, ModifierLen), StringRef(Argument, ArgumentLen), @@ -914,7 +914,7 @@ FormatDiagnostic(FirstDollar + 1, SecondDollar, OutStr); // Append second type - TDT.PrintFromType = false; + TDT.PrintFromType = 0; getDiags()->ConvertArgToString(Kind, val, StringRef(Modifier, ModifierLen), StringRef(Argument, ArgumentLen), Index: lib/Basic/Module.cpp =================================================================== --- lib/Basic/Module.cpp +++ lib/Basic/Module.cpp @@ -28,19 +28,19 @@ bool IsFramework, bool IsExplicit, unsigned VisibilityID) : Name(Name), DefinitionLoc(DefinitionLoc), Parent(Parent), Directory(), Umbrella(), Signature(0), ASTFile(nullptr), VisibilityID(VisibilityID), - IsMissingRequirement(false), HasIncompatibleModuleFile(false), - IsAvailable(true), IsFromModuleFile(false), IsFramework(IsFramework), - IsExplicit(IsExplicit), IsSystem(false), IsExternC(false), - IsInferred(false), InferSubmodules(false), InferExplicitSubmodules(false), - InferExportWildcard(false), ConfigMacrosExhaustive(false), + IsMissingRequirement(0), HasIncompatibleModuleFile(0), + IsAvailable(1), IsFromModuleFile(0), IsFramework(IsFramework), + IsExplicit(IsExplicit), IsSystem(0), IsExternC(0), + IsInferred(0), InferSubmodules(0), InferExplicitSubmodules(0), + InferExportWildcard(0), ConfigMacrosExhaustive(0), NameVisibility(Hidden) { if (Parent) { if (!Parent->isAvailable()) - IsAvailable = false; + IsAvailable = 0; if (Parent->IsSystem) - IsSystem = true; + IsSystem = 1; if (Parent->IsExternC) - IsExternC = true; + IsExternC = 1; IsMissingRequirement = Parent->IsMissingRequirement; Parent->SubModuleIndex[Name] = Parent->SubModules.size(); @@ -211,7 +211,7 @@ if (!needUpdate(Current)) continue; - Current->IsAvailable = false; + Current->IsAvailable = 0; Current->IsMissingRequirement |= MissingRequirement; for (submodule_iterator Sub = Current->submodule_begin(), SubEnd = Current->submodule_end(); Index: lib/Basic/SourceManager.cpp =================================================================== --- lib/Basic/SourceManager.cpp +++ lib/Basic/SourceManager.cpp @@ -645,7 +645,7 @@ assert(IR && "getOrCreateContentCache() cannot return NULL"); const_cast(IR)->replaceBuffer(Buffer, DoNotFree); - const_cast(IR)->BufferOverridden = true; + const_cast(IR)->BufferOverridden = 1; getOverriddenFilesInfo().OverriddenFilesWithBuffer.insert(SourceFile); } @@ -676,7 +676,7 @@ void SourceManager::setFileIsTransient(const FileEntry *File) { const SrcMgr::ContentCache *CC = getOrCreateContentCache(File); - const_cast(CC)->IsTransient = true; + const_cast(CC)->IsTransient = 1; } StringRef SourceManager::getBufferData(FileID FID, bool *Invalid) const { Index: lib/Basic/TargetInfo.cpp =================================================================== --- lib/Basic/TargetInfo.cpp +++ lib/Basic/TargetInfo.cpp @@ -63,10 +63,10 @@ Int64Type = SignedLongLong; SigAtomicType = SignedInt; ProcessIDType = SignedInt; - UseSignedCharForObjCBool = true; - UseBitFieldTypeAlignment = true; - UseZeroLengthBitfieldAlignment = false; - UseExplicitBitFieldAlignment = true; + UseSignedCharForObjCBool = 1; + UseBitFieldTypeAlignment = 1; + UseZeroLengthBitfieldAlignment = 0; + UseExplicitBitFieldAlignment = 1; ZeroLengthBitfieldBoundary = 0; HalfFormat = &llvm::APFloat::IEEEhalf; FloatFormat = &llvm::APFloat::IEEEsingle; @@ -75,14 +75,14 @@ MCountName = "mcount"; RegParmMax = 0; SSERegParmMax = 0; - HasAlignMac68kSupport = false; - HasBuiltinMSVaList = false; + HasAlignMac68kSupport = 0; + HasBuiltinMSVaList = 0; // Default to no types using fpret. RealTypeUsesObjCFPRet = 0; // Default to not using fp2ret for __Complex long double - ComplexLongDoubleUsesFP2Ret = false; + ComplexLongDoubleUsesFP2Ret = 0; // Set the C++ ABI based on the triple. TheCXXABI.set(Triple.isKnownWindowsMSVCEnvironment() @@ -272,7 +272,7 @@ /// language options which change the target configuration. void TargetInfo::adjust(const LangOptions &Opts) { if (Opts.NoBitFieldTypeAlign) - UseBitFieldTypeAlignment = false; + UseBitFieldTypeAlignment = 0; if (Opts.ShortWChar) WCharType = UnsignedShort; Index: lib/Basic/Targets.cpp =================================================================== --- lib/Basic/Targets.cpp +++ lib/Basic/Targets.cpp @@ -597,7 +597,7 @@ // On PS4, do not honor explicit bit field alignment, // as in "__attribute__((aligned(2))) int b : 1;". - this->UseExplicitBitFieldAlignment = false; + this->UseExplicitBitFieldAlignment = 0; switch (Triple.getArch()) { default: @@ -1561,7 +1561,7 @@ public: DarwinPPC32TargetInfo(const llvm::Triple &Triple) : DarwinTargetInfo(Triple) { - HasAlignMac68kSupport = true; + HasAlignMac68kSupport = 1; BoolWidth = BoolAlign = 32; //XXX support -mone-byte-bool? PtrDiffType = SignedInt; // for http://llvm.org/bugs/show_bug.cgi?id=15726 LongLongAlign = 32; @@ -1578,7 +1578,7 @@ public: DarwinPPC64TargetInfo(const llvm::Triple &Triple) : DarwinTargetInfo(Triple) { - HasAlignMac68kSupport = true; + HasAlignMac68kSupport = 1; SuitableAlign = 128; resetDataLayout("E-m:o-i64:64-n32:64"); } @@ -3827,11 +3827,11 @@ // The watchOS simulator uses the builtin bool type for Objective-C. llvm::Triple T = llvm::Triple(Triple); if (T.isWatchOS()) - UseSignedCharForObjCBool = false; + UseSignedCharForObjCBool = 0; SizeType = UnsignedLong; IntPtrType = SignedLong; resetDataLayout("e-m:o-p:32:32-f64:32:64-f80:128-n8:16:32-S128"); - HasAlignMac68kSupport = true; + HasAlignMac68kSupport = 1; } bool handleTargetFeatures(std::vector &Features, @@ -4075,10 +4075,10 @@ RealTypeUsesObjCFPRet = (1 << TargetInfo::LongDouble); // Use fp2ret for _Complex long double. - ComplexLongDoubleUsesFP2Ret = true; + ComplexLongDoubleUsesFP2Ret = 1; // Make __builtin_ms_va_list available. - HasBuiltinMSVaList = true; + HasBuiltinMSVaList = 1; // x86-64 has atomics up to 16 bytes. MaxAtomicPromoteWidth = 128; @@ -4251,7 +4251,7 @@ // The 64-bit iOS simulator uses the builtin bool type for Objective-C. llvm::Triple T = llvm::Triple(Triple); if (T.isiOS()) - UseSignedCharForObjCBool = false; + UseSignedCharForObjCBool = 0; resetDataLayout("e-m:o-i64:64-f80:128-n8:16:32:64-S128"); } @@ -4358,7 +4358,7 @@ static const Builtin::Info BuiltinInfo[]; void setABIAAPCS() { - IsAAPCS = true; + IsAAPCS = 1; DoubleAlign = LongLongAlign = LongDoubleAlign = SuitableAlign = 64; const llvm::Triple &T = getTriple(); @@ -4384,7 +4384,7 @@ break; } - UseBitFieldTypeAlignment = true; + UseBitFieldTypeAlignment = 1; ZeroLengthBitfieldBoundary = 0; @@ -4419,7 +4419,7 @@ void setABIAPCS(bool IsAAPCS16) { const llvm::Triple &T = getTriple(); - IsAAPCS = false; + IsAAPCS = 0; if (IsAAPCS16) DoubleAlign = LongLongAlign = LongDoubleAlign = SuitableAlign = 64; @@ -4437,7 +4437,7 @@ // Do not respect the alignment of bit-field types when laying out // structures. This corresponds to PCC_BITFIELD_TYPE_MATTERS in gcc. - UseBitFieldTypeAlignment = false; + UseBitFieldTypeAlignment = 0; /// gcc forces the alignment to 4 bytes, regardless of the type of the /// zero length bitfield. This corresponds to EMPTY_FIELD_BOUNDARY in @@ -4565,7 +4565,7 @@ public: ARMTargetInfo(const llvm::Triple &Triple, bool IsBigEndian) : TargetInfo(Triple), FPMath(FP_Default), - IsAAPCS(true), LDREX(0), HW_FP(0) { + IsAAPCS(1), LDREX(0), HW_FP(0) { BigEndian = IsBigEndian; switch (getTriple().getOS()) { @@ -4636,7 +4636,7 @@ // the alignment of the zero-length bitfield is greater than the member // that follows it, `bar', `bar' will be aligned as the type of the // zero length bitfield. - UseZeroLengthBitfieldAlignment = true; + UseZeroLengthBitfieldAlignment = 1; } StringRef getABI() const override { return ABI; } @@ -4690,7 +4690,7 @@ Crypto = 0; DSP = 0; Unaligned = 1; - SoftFloat = SoftFloatABI = false; + SoftFloat = SoftFloatABI = 0; HWDiv = 0; // This does not diagnose illegal cases like having both @@ -4698,9 +4698,9 @@ uint32_t HW_FP_remove = 0; for (const auto &Feature : Features) { if (Feature == "+soft-float") { - SoftFloat = true; + SoftFloat = 1; } else if (Feature == "+soft-float-abi") { - SoftFloatABI = true; + SoftFloatABI = 1; } else if (Feature == "+vfp2") { FPU |= VFP2FPU; HW_FP |= HW_FP_SP | HW_FP_DP; @@ -5341,7 +5341,7 @@ public: DarwinARMTargetInfo(const llvm::Triple &Triple) : DarwinTargetInfo(Triple) { - HasAlignMac68kSupport = true; + HasAlignMac68kSupport = 1; // iOS always has 64-bit atomic instructions. // FIXME: This should be based off of the target features in // ARMleTargetInfo. @@ -5356,7 +5356,7 @@ PtrDiffType = SignedLong; // BOOL should be a real boolean on the new ABI - UseSignedCharForObjCBool = false; + UseSignedCharForObjCBool = 0; } else TheCXXABI.set(TargetCXXABI::iOS); } @@ -5416,7 +5416,7 @@ // a plain (non bit-field) member of that type would, without exception for // zero-sized or anonymous bit-fields." assert(UseBitFieldTypeAlignment && "bitfields affect type alignment"); - UseZeroLengthBitfieldAlignment = true; + UseZeroLengthBitfieldAlignment = 1; // AArch64 targets default to using the ARM C++ ABI. TheCXXABI.set(TargetCXXABI::GenericAArch64); @@ -5763,7 +5763,7 @@ : DarwinTargetInfo(Triple) { Int64Type = SignedLongLong; WCharType = SignedInt; - UseSignedCharForObjCBool = false; + UseSignedCharForObjCBool = 0; LongDoubleWidth = LongDoubleAlign = SuitableAlign = 64; LongDoubleFormat = &llvm::APFloat::IEEEdouble; @@ -5803,7 +5803,7 @@ LargeArrayMinWidth = 64; LargeArrayAlign = 64; - UseBitFieldTypeAlignment = true; + UseBitFieldTypeAlignment = 1; ZeroLengthBitfieldBoundary = 32; HasHVX = HasHVXDouble = false; } @@ -7692,7 +7692,7 @@ IntPtrType = SignedInt; WCharType = UnsignedChar; WIntType = UnsignedInt; - UseZeroLengthBitfieldAlignment = true; + UseZeroLengthBitfieldAlignment = 1; resetDataLayout("e-m:e-p:32:32-i1:8:32-i8:8:32-i16:16:32-i64:32" "-f64:32-a:0:32-n32"); } Index: lib/CodeGen/CGAtomic.cpp =================================================================== --- lib/CodeGen/CGAtomic.cpp +++ lib/CodeGen/CGAtomic.cpp @@ -653,7 +653,7 @@ CharUnits Align = CGF.getContext().getTypeAlignInChars(ValTy); int64_t SizeInBits = CGF.getContext().toBits(SizeInChars); ValTy = - CGF.getContext().getIntTypeForBitwidth(SizeInBits, /*Signed=*/false); + CGF.getContext().getIntTypeForBitwidth(SizeInBits, /*Signed=*/0); llvm::Type *IPtrTy = llvm::IntegerType::get(CGF.getLLVMContext(), SizeInBits)->getPointerTo(); Address Ptr = Address(CGF.Builder.CreateBitCast(Val, IPtrTy), Align); @@ -982,7 +982,7 @@ // Value is returned directly. // The function returns an appropriately sized integer type. RetTy = getContext().getIntTypeForBitwidth( - getContext().toBits(sizeChars), /*Signed=*/false); + getContext().toBits(sizeChars), /*Signed=*/0); } else { // Value is returned through parameter before the order. RetTy = getContext().VoidTy; Index: lib/CodeGen/CGBuiltin.cpp =================================================================== --- lib/CodeGen/CGBuiltin.cpp +++ lib/CodeGen/CGBuiltin.cpp @@ -6946,7 +6946,7 @@ case PPC::BI__builtin_altivec_vclzd: { llvm::Type *ResultType = ConvertType(E->getType()); Value *X = EmitScalarExpr(E->getArg(0)); - Value *Undef = ConstantInt::get(Builder.getInt1Ty(), false); + Value *Undef = ConstantInt::get(Builder.getInt1Ty(), 0); Function *F = CGM.getIntrinsic(Intrinsic::ctlz, ResultType); return Builder.CreateCall(F, {X, Undef}); } @@ -7207,7 +7207,7 @@ case SystemZ::BI__builtin_s390_vclzg: { llvm::Type *ResultType = ConvertType(E->getType()); Value *X = EmitScalarExpr(E->getArg(0)); - Value *Undef = ConstantInt::get(Builder.getInt1Ty(), false); + Value *Undef = ConstantInt::get(Builder.getInt1Ty(), 0); Function *F = CGM.getIntrinsic(Intrinsic::ctlz, ResultType); return Builder.CreateCall(F, {X, Undef}); } @@ -7218,7 +7218,7 @@ case SystemZ::BI__builtin_s390_vctzg: { llvm::Type *ResultType = ConvertType(E->getType()); Value *X = EmitScalarExpr(E->getArg(0)); - Value *Undef = ConstantInt::get(Builder.getInt1Ty(), false); + Value *Undef = ConstantInt::get(Builder.getInt1Ty(), 0); Function *F = CGM.getIntrinsic(Intrinsic::cttz, ResultType); return Builder.CreateCall(F, {X, Undef}); } Index: lib/CodeGen/CGObjC.cpp =================================================================== --- lib/CodeGen/CGObjC.cpp +++ lib/CodeGen/CGObjC.cpp @@ -669,7 +669,7 @@ IsCopy = (setterKind == ObjCPropertyDecl::Copy); IsAtomic = prop->isAtomic(); - HasStrong = false; // doesn't matter here. + HasStrong = 0; // doesn't matter here. // Evaluate the ivar's size and alignment. ObjCIvarDecl *ivar = propImpl->getPropertyIvarDecl(); Index: lib/CodeGen/CGOpenMPRuntime.cpp =================================================================== --- lib/CodeGen/CGOpenMPRuntime.cpp +++ lib/CodeGen/CGOpenMPRuntime.cpp @@ -1773,7 +1773,7 @@ auto ThreadID = getThreadID(CGF, Loc); auto Int32Ty = - CGF.getContext().getIntTypeForBitwidth(/*DestWidth*/ 32, /*Signed*/ true); + CGF.getContext().getIntTypeForBitwidth(/*DestWidth*/ 32, /*Signed*/ 1); auto ThreadIDTemp = CGF.CreateMemTemp(Int32Ty, /*Name*/ ".threadid_temp."); CGF.EmitStoreOfScalar(ThreadID, CGF.MakeAddrLValue(ThreadIDTemp, Int32Ty)); @@ -2331,7 +2331,7 @@ llvm::Value *Call = CGF.EmitRuntimeCall(createDispatchNextFunction(IVSize, IVSigned), Args); return CGF.EmitScalarConversion( - Call, CGF.getContext().getIntTypeForBitwidth(32, /* Signed */ true), + Call, CGF.getContext().getIntTypeForBitwidth(32, /* Signed */ 1), CGF.getContext().BoolTy, Loc); } @@ -2859,7 +2859,7 @@ auto *RD = C.buildImplicitRecord("__tgt_bin_desc"); RD->startDefinition(); addFieldToRecordDecl( - C, RD, C.getIntTypeForBitwidth(/*DestWidth=*/32, /*Signed=*/true)); + C, RD, C.getIntTypeForBitwidth(/*DestWidth=*/32, /*Signed=*/1)); addFieldToRecordDecl(C, RD, C.getPointerType(getTgtDeviceImageQTy())); addFieldToRecordDecl(C, RD, C.getPointerType(getTgtOffloadEntryQTy())); addFieldToRecordDecl(C, RD, C.getPointerType(getTgtOffloadEntryQTy())); @@ -3371,7 +3371,7 @@ enum RTLDependInfoFieldsTy { BaseAddr, Len, Flags }; RecordDecl *KmpDependInfoRD; QualType FlagsTy = - C.getIntTypeForBitwidth(C.getTypeSize(C.BoolTy), /*Signed=*/false); + C.getIntTypeForBitwidth(C.getTypeSize(C.BoolTy), /*Signed=*/0); llvm::Type *LLVMFlagsTy = CGF.ConvertTypeForMem(FlagsTy); if (KmpDependInfoTy.isNull()) { KmpDependInfoRD = C.buildImplicitRecord("kmp_depend_info"); @@ -4470,7 +4470,7 @@ // Keep track on whether the host function has to be executed. auto OffloadErrorQType = - Ctx.getIntTypeForBitwidth(/*DestWidth=*/32, /*Signed=*/true); + Ctx.getIntTypeForBitwidth(/*DestWidth=*/32, /*Signed=*/1); auto OffloadError = CGF.MakeAddrLValue( CGF.CreateMemTemp(OffloadErrorQType, ".run_host_version"), OffloadErrorQType); Index: lib/CodeGen/ObjectFilePCHContainerOperations.cpp =================================================================== --- lib/CodeGen/ObjectFilePCHContainerOperations.cpp +++ lib/CodeGen/ObjectFilePCHContainerOperations.cpp @@ -150,7 +150,7 @@ // ThreadModel, but the backend expects them to be nonempty. CodeGenOpts.CodeModel = "default"; CodeGenOpts.ThreadModel = "single"; - CodeGenOpts.DebugTypeExtRefs = true; + CodeGenOpts.DebugTypeExtRefs = 1; CodeGenOpts.setDebugInfo(codegenoptions::FullDebugInfo); } Index: lib/Driver/Driver.cpp =================================================================== --- lib/Driver/Driver.cpp +++ lib/Driver/Driver.cpp @@ -56,9 +56,9 @@ DefaultTargetTriple(DefaultTargetTriple), DriverTitle("clang LLVM compiler"), CCPrintOptionsFilename(nullptr), CCPrintHeadersFilename(nullptr), CCLogDiagnosticsFilename(nullptr), - CCCPrintBindings(false), CCPrintHeaders(false), CCLogDiagnostics(false), - CCGenDiagnostics(false), CCCGenericGCCName(""), CheckInputsExist(true), - CCCUsePCH(true), SuppressMissingInputWarning(false) { + CCCPrintBindings(0), CCPrintHeaders(0), CCLogDiagnostics(0), + CCGenDiagnostics(0), CCCGenericGCCName(""), CheckInputsExist(1), + CCCUsePCH(1), SuppressMissingInputWarning(false) { // Provide a sane fallback if no VFS is specified. if (!this->VFS) @@ -579,7 +579,7 @@ // Suppress driver output and emit preprocessor output to temp file. Mode = CPPMode; - CCGenDiagnostics = true; + CCGenDiagnostics = 1; // Save the original job command(s). Command Cmd = FailingCommand; Index: lib/Driver/Tools.cpp =================================================================== --- lib/Driver/Tools.cpp +++ lib/Driver/Tools.cpp @@ -2014,7 +2014,7 @@ } } - if (OptionIter->second == true) { + if (OptionIter->second == 1) { // Duplicate option specified. D.Diag(diag::err_drv_invalid_value) << A->getOption().getName() << Val; return; Index: lib/Frontend/ASTUnit.cpp =================================================================== --- lib/Frontend/ASTUnit.cpp +++ lib/Frontend/ASTUnit.cpp @@ -226,7 +226,7 @@ CompletionCacheTopLevelHashValue(0), PreambleTopLevelHashValue(0), CurrentTopLevelHashValue(0), - UnsafeToFree(false) { + UnsafeToFree(0) { if (getenv("LIBCLANG_OBJTRACKING")) fprintf(stderr, "+++ %u translation units\n", ++ActiveASTUnitObjects); } @@ -1761,7 +1761,7 @@ // We'll manage file buffers ourselves. CI->getPreprocessorOpts().RetainRemappedFileBuffers = true; - CI->getFrontendOpts().DisableFree = false; + CI->getFrontendOpts().DisableFree = 0; ProcessWarningOptions(AST->getDiagnostics(), CI->getDiagnosticOpts()); // Create the compiler instance to use for building the AST. @@ -1869,7 +1869,7 @@ // We'll manage file buffers ourselves. Invocation->getPreprocessorOpts().RetainRemappedFileBuffers = true; - Invocation->getFrontendOpts().DisableFree = false; + Invocation->getFrontendOpts().DisableFree = 0; ProcessWarningOptions(getDiagnostics(), Invocation->getDiagnosticOpts()); std::unique_ptr OverrideMainBuffer; @@ -2342,8 +2342,8 @@ LangOpts = *CCInvocation->getLangOpts(); // Spell-checking and warnings are wasteful during code-completion. - LangOpts.SpellChecking = false; - CCInvocation->getDiagnosticOpts().IgnoreWarnings = true; + LangOpts.SpellChecking = 0; + CCInvocation->getDiagnosticOpts().IgnoreWarnings = 1; std::unique_ptr Clang( new CompilerInstance(PCHContainerOps)); @@ -2441,7 +2441,7 @@ // Disable the preprocessing record if modules are not enabled. if (!Clang->getLangOpts().Modules) - PreprocessorOpts.DetailedRecord = false; + PreprocessorOpts.DetailedRecord = 0; std::unique_ptr Act; Act.reset(new SyntaxOnlyAction); Index: lib/Frontend/CompilerInstance.cpp =================================================================== --- lib/Frontend/CompilerInstance.cpp +++ lib/Frontend/CompilerInstance.cpp @@ -963,9 +963,9 @@ // header. FrontendOptions &FrontendOpts = Invocation->getFrontendOpts(); FrontendOpts.OutputFile = ModuleFileName.str(); - FrontendOpts.DisableFree = false; - FrontendOpts.GenerateGlobalModuleIndex = false; - FrontendOpts.BuildingImplicitModule = true; + FrontendOpts.DisableFree = 0; + FrontendOpts.GenerateGlobalModuleIndex = 0; + FrontendOpts.BuildingImplicitModule = 1; FrontendOpts.Inputs.clear(); InputKind IK = getSourceInputKindFromOptions(*Invocation->getLangOpts()); @@ -1364,7 +1364,7 @@ .getHeaderSearchInfo() .getModuleMap() .findModule(II->getName())) - M->HasIncompatibleModuleFile = true; + M->HasIncompatibleModuleFile = 1; } LoadedModules.clear(); } Index: lib/Frontend/CompilerInvocation.cpp =================================================================== --- lib/Frontend/CompilerInvocation.cpp +++ lib/Frontend/CompilerInvocation.cpp @@ -848,11 +848,11 @@ llvm::sys::Process::UseANSIEscapeCodes(Args.hasArg(OPT_fansi_escape_codes)); // Default behavior is to not to show note include stacks. - Opts.ShowNoteIncludeStack = false; + Opts.ShowNoteIncludeStack = 0; if (Arg *A = Args.getLastArg(OPT_fdiagnostics_show_note_include_stack, OPT_fno_diagnostics_show_note_include_stack)) if (A->getOption().matches(OPT_fdiagnostics_show_note_include_stack)) - Opts.ShowNoteIncludeStack = true; + Opts.ShowNoteIncludeStack = 1; StringRef ShowOverloads = Args.getLastArgValue(OPT_fshow_overloads_EQ, "all"); @@ -892,7 +892,7 @@ Opts.setFormat(DiagnosticOptions::MSVC); else if (Format == "msvc-fallback") { Opts.setFormat(DiagnosticOptions::MSVC); - Opts.CLFallbackMode = true; + Opts.CLFallbackMode = 1; } else if (Format == "vi") Opts.setFormat(DiagnosticOptions::Vi); else { Index: lib/Frontend/FrontendActions.cpp =================================================================== --- lib/Frontend/FrontendActions.cpp +++ lib/Frontend/FrontendActions.cpp @@ -262,7 +262,7 @@ bool GenerateModuleAction::BeginSourceFileAction(CompilerInstance &CI, StringRef Filename) { - CI.getLangOpts().CompilingModule = true; + CI.getLangOpts().CompilingModule = 1; // Find the module map file. const FileEntry *ModuleMap = @@ -336,7 +336,7 @@ } if (ModuleMapForUniquing && ModuleMapForUniquing != ModuleMap) { - Module->IsInferred = true; + Module->IsInferred = 1; HS.getModuleMap().setInferredModuleAllowedBy(Module, ModuleMapForUniquing); } else { ModuleMapForUniquing = ModuleMap; Index: lib/Index/CommentToXML.cpp =================================================================== --- lib/Index/CommentToXML.cpp +++ lib/Index/CommentToXML.cpp @@ -584,8 +584,8 @@ const LangOptions &LangOpts = Context.getLangOpts(); llvm::raw_svector_ostream OS(Str); PrintingPolicy PPolicy(LangOpts); - PPolicy.PolishForDeclaration = true; - PPolicy.TerseOutput = true; + PPolicy.PolishForDeclaration = 1; + PPolicy.TerseOutput = 1; ThisDecl->CurrentDecl->print(OS, PPolicy, /*Indentation*/0, /*PrintInstantiation*/false); } Index: lib/Index/IndexSymbol.cpp =================================================================== --- lib/Index/IndexSymbol.cpp +++ lib/Index/IndexSymbol.cpp @@ -250,7 +250,7 @@ // Forward references can have different template argument names. Suppress // the template argument names in constructors to make their name more // stable. - Policy.SuppressTemplateArgsInCXXConstructors = true; + Policy.SuppressTemplateArgsInCXXConstructors = 1; DeclarationName DeclName = ND->getDeclName(); if (DeclName.isEmpty()) return true; Index: lib/Index/USRGeneration.cpp =================================================================== --- lib/Index/USRGeneration.cpp +++ lib/Index/USRGeneration.cpp @@ -214,7 +214,7 @@ PrintingPolicy Policy(Context->getLangOpts()); // Forward references can have different template argument names. Suppress the // template argument names in constructors to make their USR more stable. - Policy.SuppressTemplateArgsInCXXConstructors = true; + Policy.SuppressTemplateArgsInCXXConstructors = 1; D->getDeclName().print(Out, Policy); ASTContext &Ctx = *Context; Index: lib/Lex/HeaderSearch.cpp =================================================================== --- lib/Lex/HeaderSearch.cpp +++ lib/Lex/HeaderSearch.cpp @@ -938,7 +938,7 @@ HFI.DirInfo = OtherHFI.DirInfo; HFI.External = (!HFI.IsValid || HFI.External); - HFI.IsValid = true; + HFI.IsValid = 1; HFI.IndexHeaderMapHeader = OtherHFI.IndexHeaderMapHeader; if (HFI.Framework.empty()) @@ -954,7 +954,7 @@ HeaderFileInfo *HFI = &FileInfo[FE->getUID()]; // FIXME: Use a generation count to check whether this is really up to date. if (ExternalSource && !HFI->Resolved) { - HFI->Resolved = true; + HFI->Resolved = 1; auto ExternalHFI = ExternalSource->GetHeaderFileInfo(FE); HFI = &FileInfo[FE->getUID()]; @@ -962,10 +962,10 @@ mergeHeaderFileInfo(*HFI, ExternalHFI); } - HFI->IsValid = true; + HFI->IsValid = 1; // We have local information about this header file, so it's no longer // strictly external. - HFI->External = false; + HFI->External = 0; return *HFI; } @@ -986,7 +986,7 @@ if (!WantExternal && (!HFI->IsValid || HFI->External)) return nullptr; if (!HFI->Resolved) { - HFI->Resolved = true; + HFI->Resolved = 1; auto ExternalHFI = ExternalSource->GetHeaderFileInfo(FE); HFI = &FileInfo[FE->getUID()]; @@ -1044,7 +1044,7 @@ // this header. if (isImport) { // If this has already been imported, don't import it again. - FileInfo.isImport = true; + FileInfo.isImport = 1; // Has this already been #import'ed or #include'd? if (FileInfo.NumIncludes) return false; Index: lib/Lex/Lexer.cpp =================================================================== --- lib/Lex/Lexer.cpp +++ lib/Lex/Lexer.cpp @@ -2052,7 +2052,7 @@ // Mark them enabled so we only emit one warning for this translation // unit. - LangOpts.LineComment = true; + LangOpts.LineComment = 1; } // Scan over the body of the comment. The common case, when scanning, is that Index: lib/Lex/ModuleMap.cpp =================================================================== --- lib/Lex/ModuleMap.cpp +++ lib/Lex/ModuleMap.cpp @@ -90,7 +90,7 @@ : SourceMgr(SourceMgr), Diags(Diags), LangOpts(LangOpts), Target(Target), HeaderInfo(HeaderInfo), BuiltinIncludeDir(nullptr), SourceModule(nullptr), NumCreatedModules(0) { - MMapLangOpts.LineComment = true; + MMapLangOpts.LineComment = 1; } ModuleMap::~ModuleMap() { @@ -386,7 +386,7 @@ Result = findOrCreateModule(Name, Result, /*IsFramework=*/false, Explicit).first; InferredModuleAllowedBy[Result] = UmbrellaModuleMap; - Result->IsInferred = true; + Result->IsInferred = 1; // Associate the module and the directory. UmbrellaDirs[SkippedDirs[I-1]] = Result; @@ -404,7 +404,7 @@ Result = findOrCreateModule(Name, Result, /*IsFramework=*/false, Explicit).first; InferredModuleAllowedBy[Result] = UmbrellaModuleMap; - Result->IsInferred = true; + Result->IsInferred = 1; Result->addTopHeader(File); // If inferred submodules export everything they import, add a @@ -685,7 +685,7 @@ /*IsFramework=*/true, /*IsExplicit=*/false, NumCreatedModules++); InferredModuleAllowedBy[Result] = ModuleMapFile; - Result->IsInferred = true; + Result->IsInferred = 1; if (!Parent) { if (LangOpts.CurrentModule == ModuleName) SourceModule = Result; @@ -707,8 +707,8 @@ Result->Exports.push_back(Module::ExportDecl(nullptr, true)); // module * { export * } - Result->InferSubmodules = true; - Result->InferExportWildcard = true; + Result->InferSubmodules = 1; + Result->InferExportWildcard = 1; // Look for subframeworks. std::error_code EC; @@ -1451,9 +1451,9 @@ Explicit).first; ActiveModule->DefinitionLoc = ModuleNameLoc; if (Attrs.IsSystem || IsSystem) - ActiveModule->IsSystem = true; + ActiveModule->IsSystem = 1; if (Attrs.IsExternC) - ActiveModule->IsExternC = true; + ActiveModule->IsExternC = 1; ActiveModule->Directory = Directory; bool Done = false; @@ -2076,7 +2076,7 @@ return; if (Attrs.IsExhaustive && !ActiveModule->Parent) { - ActiveModule->ConfigMacrosExhaustive = true; + ActiveModule->ConfigMacrosExhaustive = 1; } // If we don't have an identifier, we're done. @@ -2227,12 +2227,12 @@ if (ActiveModule) { // Note that we have an inferred submodule. - ActiveModule->InferSubmodules = true; + ActiveModule->InferSubmodules = 1; ActiveModule->InferredSubmoduleLoc = StarLoc; ActiveModule->InferExplicitSubmodules = Explicit; } else { // We'll be inferring framework modules for this directory. - Map.InferredDirectories[Directory].InferModules = true; + Map.InferredDirectories[Directory].InferModules = 1; Map.InferredDirectories[Directory].Attrs = Attrs; Map.InferredDirectories[Directory].ModuleMapFile = ModuleMapFile; // FIXME: Handle the 'framework' keyword. @@ -2286,7 +2286,7 @@ consumeToken(); if (Tok.is(MMToken::Star)) - ActiveModule->InferExportWildcard = true; + ActiveModule->InferExportWildcard = 1; else Diags.Report(Tok.getLocation(), diag::err_mmap_expected_export_wildcard); @@ -2357,15 +2357,15 @@ break; case AT_system: - Attrs.IsSystem = true; + Attrs.IsSystem = 1; break; case AT_extern_c: - Attrs.IsExternC = true; + Attrs.IsExternC = 1; break; case AT_exhaustive: - Attrs.IsExhaustive = true; + Attrs.IsExhaustive = 1; break; } consumeToken(); Index: lib/Lex/PPMacroExpansion.cpp =================================================================== --- lib/Lex/PPMacroExpansion.cpp +++ lib/Lex/PPMacroExpansion.cpp @@ -1691,9 +1691,9 @@ IdentifierInfo *II = ExpectFeatureIdentifierInfo(Tok, *this, diag::err_feature_check_malformed); if (!II) - return false; + return 0; else if (II->getBuiltinID() != 0) - return true; + return 1; else { const LangOptions &LangOpts = getLangOpts(); return llvm::StringSwitch(II->getName()) @@ -1729,7 +1729,7 @@ IdentifierInfo *II = ExpectFeatureIdentifierInfo(Tok, *this, diag::err_feature_check_malformed); if (!II) - return false; + return 0; // It is possible to receive a scope token. Read the "::", if it is // available, and the subsequent identifier. @@ -1771,14 +1771,14 @@ HasLexedNextToken = Tok.is(tok::string_literal); if (!FinishLexStringLiteral(Tok, WarningName, "'__has_warning'", /*MacroExpansion=*/false)) - return false; + return 0; // FIXME: Should we accept "-R..." flags here, or should that be // handled by a separate __has_remark? if (WarningName.size() < 3 || WarningName[0] != '-' || WarningName[1] != 'W') { Diag(StrStartLoc, diag::warn_has_warning_invalid_option); - return false; + return 0; } // Finally, check if the warning flags maps to a diagnostic group. Index: lib/Sema/DeclSpec.cpp =================================================================== --- lib/Sema/DeclSpec.cpp +++ lib/Sema/DeclSpec.cpp @@ -191,7 +191,7 @@ I.Fun.LParenLoc = LParenLoc.getRawEncoding(); I.Fun.EllipsisLoc = EllipsisLoc.getRawEncoding(); I.Fun.RParenLoc = RParenLoc.getRawEncoding(); - I.Fun.DeleteParams = false; + I.Fun.DeleteParams = 0; I.Fun.TypeQuals = TypeQuals; I.Fun.NumParams = NumParams; I.Fun.Params = nullptr; @@ -223,11 +223,11 @@ if (!TheDeclarator.InlineParamsUsed && NumParams <= llvm::array_lengthof(TheDeclarator.InlineParams)) { I.Fun.Params = TheDeclarator.InlineParams; - I.Fun.DeleteParams = false; + I.Fun.DeleteParams = 0; TheDeclarator.InlineParamsUsed = true; } else { I.Fun.Params = new DeclaratorChunk::ParamInfo[NumParams]; - I.Fun.DeleteParams = true; + I.Fun.DeleteParams = 1; } memcpy(I.Fun.Params, Params, sizeof(Params[0]) * NumParams); } @@ -625,7 +625,7 @@ TypeRep = Rep; TSTLoc = TagKwLoc; TSTNameLoc = TagNameLoc; - TypeSpecOwned = false; + TypeSpecOwned = 0; return false; } @@ -645,7 +645,7 @@ ExprRep = Rep; TSTLoc = Loc; TSTNameLoc = Loc; - TypeSpecOwned = false; + TypeSpecOwned = 0; return false; } @@ -693,11 +693,11 @@ TSTLoc = Loc; TSTNameLoc = Loc; if (TypeAltiVecVector && (T == TST_bool) && !TypeAltiVecBool) { - TypeAltiVecBool = true; + TypeAltiVecBool = 1; return false; } TypeSpecType = T; - TypeSpecOwned = false; + TypeSpecOwned = 0; return false; } @@ -762,7 +762,7 @@ bool DeclSpec::SetTypeSpecError() { TypeSpecType = TST_error; - TypeSpecOwned = false; + TypeSpecOwned = 0; TSTLoc = SourceLocation(); TSTNameLoc = SourceLocation(); return false; @@ -802,7 +802,7 @@ PrevSpec = "inline"; return true; } - FS_inline_specified = true; + FS_inline_specified = 1; FS_inlineLoc = Loc; return false; } @@ -814,7 +814,7 @@ PrevSpec = "__forceinline"; return true; } - FS_forceinline_specified = true; + FS_forceinline_specified = 1; FS_forceinlineLoc = Loc; return false; } @@ -829,7 +829,7 @@ PrevSpec = "virtual"; return true; } - FS_virtual_specified = true; + FS_virtual_specified = 1; FS_virtualLoc = Loc; return false; } @@ -844,7 +844,7 @@ PrevSpec = "explicit"; return true; } - FS_explicit_specified = true; + FS_explicit_specified = 1; FS_explicitLoc = Loc; return false; } @@ -859,7 +859,7 @@ PrevSpec = "_Noreturn"; return true; } - FS_noreturn_specified = true; + FS_noreturn_specified = 1; FS_noreturnLoc = Loc; return false; } @@ -877,7 +877,7 @@ return true; } - Friend_specified = true; + Friend_specified = 1; FriendLoc = Loc; return false; } @@ -903,7 +903,7 @@ PrevSpec = "constexpr"; return true; } - Constexpr_specified = true; + Constexpr_specified = 1; ConstexprLoc = Loc; return false; } @@ -915,7 +915,7 @@ PrevSpec = "concept"; return true; } - Concept_specified = true; + Concept_specified = 1; ConceptLoc = Loc; return false; } @@ -972,7 +972,7 @@ TypeSpecWidth = TSW_unspecified; TypeSpecComplex = TSC_unspecified; TypeSpecSign = TSS_unspecified; - TypeAltiVecVector = TypeAltiVecPixel = TypeAltiVecBool = false; + TypeAltiVecVector = TypeAltiVecPixel = TypeAltiVecBool = 0; TypeQualifiers = 0; S.Diag(TSTLoc, diag::err_decltype_auto_cannot_be_combined) << Hints[0] << Hints[1] << Hints[2] << Hints[3] @@ -1039,7 +1039,7 @@ TypeSpecType = TST_int; TypeSpecSign = TSS_unsigned; TypeSpecWidth = TSW_short; - TypeSpecOwned = false; + TypeSpecOwned = 0; } } @@ -1067,7 +1067,7 @@ S.Diag(TSWLoc, diag::err_invalid_width_spec) << (int)TypeSpecWidth << getSpecifierName((TST)TypeSpecType, Policy); TypeSpecType = TST_int; - TypeSpecOwned = false; + TypeSpecOwned = 0; } break; case TSW_long: // long double, long int @@ -1077,7 +1077,7 @@ S.Diag(TSWLoc, diag::err_invalid_width_spec) << (int)TypeSpecWidth << getSpecifierName((TST)TypeSpecType, Policy); TypeSpecType = TST_int; - TypeSpecOwned = false; + TypeSpecOwned = 0; } break; } @@ -1206,7 +1206,7 @@ S.Diag(SCLoc, diag::err_friend_decl_spec) << Keyword << Hint; - FS_virtual_specified = FS_explicit_specified = false; + FS_virtual_specified = FS_explicit_specified = 0; FS_virtualLoc = FS_explicitLoc = SourceLocation(); } Index: lib/Sema/Sema.cpp =================================================================== --- lib/Sema/Sema.cpp +++ lib/Sema/Sema.cpp @@ -801,7 +801,7 @@ = Context.getAsIncompleteArrayType(VD->getType())) { // Set the length of the array to 1 (C99 6.9.2p5). Diag(VD->getLocation(), diag::warn_tentative_incomplete_array); - llvm::APInt One(Context.getTypeSize(Context.getSizeType()), true); + llvm::APInt One(Context.getTypeSize(Context.getSizeType()), 1); QualType T = Context.getConstantArrayType(ArrayT->getElementType(), One, ArrayType::Normal, 0); VD->setType(T); Index: lib/Sema/SemaChecking.cpp =================================================================== --- lib/Sema/SemaChecking.cpp +++ lib/Sema/SemaChecking.cpp @@ -4470,7 +4470,7 @@ EmitFormatDiagnostic( S.PDiag(diag::warn_format_conversion_argument_type_mismatch) << AT.getRepresentativeTypeName(S.Context) << Ex->getType() - << false << Ex->getSourceRange(), + << 0 << Ex->getSourceRange(), Ex->getLocStart(), /*IsStringLocation*/false, getSpecifierRange(startSpecifier, specifierLen)); @@ -4481,7 +4481,7 @@ EmitFormatDiagnostic( S.PDiag(diag::warn_format_conversion_argument_type_mismatch) << AT2.getRepresentativeTypeName(S.Context) << Ex->getType() - << false << Ex->getSourceRange(), + << 0 << Ex->getSourceRange(), Ex->getLocStart(), /*IsStringLocation*/false, getSpecifierRange(startSpecifier, specifierLen)); @@ -5062,7 +5062,7 @@ EmitFormatDiagnostic( S.PDiag(diag) << AT.getRepresentativeTypeName(S.Context) - << Ex->getType() << false << Ex->getSourceRange(), + << Ex->getType() << 0 << Ex->getSourceRange(), Ex->getLocStart(), /*IsStringLocation*/ false, getSpecifierRange(startSpecifier, specifierLen), @@ -5071,7 +5071,7 @@ } else { EmitFormatDiagnostic(S.PDiag(diag) << AT.getRepresentativeTypeName(S.Context) - << Ex->getType() << false << Ex->getSourceRange(), + << Ex->getType() << 0 << Ex->getSourceRange(), Ex->getLocStart(), /*IsStringLocation*/ false, getSpecifierRange(startSpecifier, specifierLen)); Index: lib/Sema/SemaCodeComplete.cpp =================================================================== --- lib/Sema/SemaCodeComplete.cpp +++ lib/Sema/SemaCodeComplete.cpp @@ -1450,7 +1450,7 @@ const Preprocessor &PP) { PrintingPolicy Policy = Sema::getPrintingPolicy(Context, PP); Policy.AnonymousTagLocations = false; - Policy.SuppressStrongLifetime = true; + Policy.SuppressStrongLifetime = 1; Policy.SuppressUnwrittenScope = true; return Policy; } Index: lib/Sema/SemaDecl.cpp =================================================================== --- lib/Sema/SemaDecl.cpp +++ lib/Sema/SemaDecl.cpp @@ -10771,7 +10771,7 @@ if (!T.isConstQualified()) { DelayedDiagnostics.add( sema::DelayedDiagnostic::makeForbiddenType( - NameLoc, diag::err_arc_array_param_no_ownership, T, false)); + NameLoc, diag::err_arc_array_param_no_ownership, T, 0)); } lifetime = Qualifiers::OCL_ExplicitNone; } else { Index: lib/Sema/SemaDeclAttr.cpp =================================================================== --- lib/Sema/SemaDeclAttr.cpp +++ lib/Sema/SemaDeclAttr.cpp @@ -4872,7 +4872,7 @@ << (S.Context.getTargetInfo().getTriple().getArch() == llvm::Triple::x86 ? 0 : 1) - << 3 << S.Context.getIntTypeForBitwidth(TypeSize, /*Signed=*/false); + << 3 << S.Context.getIntTypeForBitwidth(TypeSize, /*Signed=*/0); return; } D->addAttr(::new (S.Context) AnyX86InterruptAttr( Index: lib/Sema/SemaDeclCXX.cpp =================================================================== --- lib/Sema/SemaDeclCXX.cpp +++ lib/Sema/SemaDeclCXX.cpp @@ -2954,7 +2954,7 @@ // member. diagnoseTypo(Corr, PDiag(diag::err_mem_init_not_member_or_class_suggest) - << MemberOrBase << true); + << MemberOrBase << 1); return BuildMemberInitializer(Member, Init, IdLoc); } else if (TypeDecl *Type = Corr.getCorrectionDeclAs()) { const CXXBaseSpecifier *DirectBaseSpec; @@ -2967,7 +2967,7 @@ // that base class. diagnoseTypo(Corr, PDiag(diag::err_mem_init_not_member_or_class_suggest) - << MemberOrBase << false, + << MemberOrBase << 0, PDiag() /*Suppress note, we provide our own.*/); const CXXBaseSpecifier *BaseSpec = DirectBaseSpec ? DirectBaseSpec Index: lib/Sema/SemaDeclObjC.cpp =================================================================== --- lib/Sema/SemaDeclObjC.cpp +++ lib/Sema/SemaDeclObjC.cpp @@ -1615,7 +1615,7 @@ if (auto objcClass = corrected.getCorrectionDeclAs()) { diagnoseTypo(corrected, PDiag(diag::err_unknown_type_or_class_name_suggest) - << identifiers[i] << true); + << identifiers[i] << 1); lookupKind = LookupOrdinaryName; typeDecls[i] = objcClass; ++numTypeDeclsResolved; Index: lib/Sema/SemaOpenMP.cpp =================================================================== --- lib/Sema/SemaOpenMP.cpp +++ lib/Sema/SemaOpenMP.cpp @@ -4184,7 +4184,7 @@ if (HasBits >= Bits) return ExprResult(E); // OK to convert to signed, because new type has more bits than old. - QualType NewType = C.getIntTypeForBitwidth(Bits, /* Signed */ true); + QualType NewType = C.getIntTypeForBitwidth(Bits, /* Signed */ 1); return SemaRef.PerformImplicitConversion(E, NewType, Sema::AA_Converting, true); } @@ -4441,7 +4441,7 @@ // A 32-bit variable-flag where runtime returns 1 for the last iteration. // This will be used to implement clause 'lastprivate'. - QualType Int32Ty = SemaRef.Context.getIntTypeForBitwidth(32, true); + QualType Int32Ty = SemaRef.Context.getIntTypeForBitwidth(32, 1); VarDecl *ILDecl = buildVarDecl(SemaRef, InitLoc, Int32Ty, ".omp.is_last"); IL = buildDeclRefExpr(SemaRef, ILDecl, Int32Ty, InitLoc); SemaRef.AddInitializerToDecl( Index: lib/Sema/SemaOverload.cpp =================================================================== --- lib/Sema/SemaOverload.cpp +++ lib/Sema/SemaOverload.cpp @@ -180,15 +180,15 @@ First = ICK_Identity; Second = ICK_Identity; Third = ICK_Identity; - DeprecatedStringLiteralToCharPtr = false; - QualificationIncludesObjCLifetime = false; - ReferenceBinding = false; - DirectBinding = false; - IsLvalueReference = true; - BindsToFunctionLvalue = false; - BindsToRvalue = false; - BindsImplicitObjectArgumentWithoutRefQualifier = false; - ObjCLifetimeConversionBinding = false; + DeprecatedStringLiteralToCharPtr = 0; + QualificationIncludesObjCLifetime = 0; + ReferenceBinding = 0; + DirectBinding = 0; + IsLvalueReference = 1; + BindsToFunctionLvalue = 0; + BindsToRvalue = 0; + BindsImplicitObjectArgumentWithoutRefQualifier = 0; + ObjCLifetimeConversionBinding = 0; CopyConstructor = nullptr; } @@ -567,7 +567,7 @@ TemplateDeductionInfo &Info) { DeductionFailureInfo Result; Result.Result = static_cast(TDK); - Result.HasDiagnostic = false; + Result.HasDiagnostic = 0; switch (TDK) { case Sema::TDK_Success: case Sema::TDK_Invalid: @@ -620,7 +620,7 @@ PartialDiagnosticAt *Diag = new (Result.Diagnostic) PartialDiagnosticAt( SourceLocation(), PartialDiagnostic::NullDiagnostic()); Info.takeSFINAEDiagnostic(*Diag); - Result.HasDiagnostic = true; + Result.HasDiagnostic = 1; } break; @@ -657,7 +657,7 @@ Data = nullptr; if (PartialDiagnosticAt *Diag = getSFINAEDiagnostic()) { Diag->~PartialDiagnosticAt(); - HasDiagnostic = false; + HasDiagnostic = 0; } break; @@ -1495,7 +1495,7 @@ // Standard conversions (C++ [conv]) SCS.setAsIdentityConversion(); - SCS.IncompatibleObjC = false; + SCS.IncompatibleObjC = 0; SCS.setFromType(FromType); SCS.CopyConstructor = nullptr; @@ -1592,7 +1592,7 @@ if (S.IsStringLiteralToNonConstPointerConversion(From, ToType)) { // This conversion is deprecated in C++03 (D.4) - SCS.DeprecatedStringLiteralToCharPtr = true; + SCS.DeprecatedStringLiteralToCharPtr = 1; // For the purpose of ranking in overload resolution // (13.3.3.1.1), this conversion is considered an @@ -1600,7 +1600,7 @@ // conversion (4.4). (C++ 4.2p2) SCS.Second = ICK_Identity; SCS.Third = ICK_Qualification; - SCS.QualificationIncludesObjCLifetime = false; + SCS.QualificationIncludesObjCLifetime = 0; SCS.setAllToTypes(FromType); return true; } @@ -4345,15 +4345,15 @@ ICS.Standard.setToType(0, T2); ICS.Standard.setToType(1, T1); ICS.Standard.setToType(2, T1); - ICS.Standard.ReferenceBinding = true; - ICS.Standard.DirectBinding = true; + ICS.Standard.ReferenceBinding = 1; + ICS.Standard.DirectBinding = 1; ICS.Standard.IsLvalueReference = !isRValRef; ICS.Standard.BindsToFunctionLvalue = T2->isFunctionType(); - ICS.Standard.BindsToRvalue = false; - ICS.Standard.BindsImplicitObjectArgumentWithoutRefQualifier = false; + ICS.Standard.BindsToRvalue = 0; + ICS.Standard.BindsImplicitObjectArgumentWithoutRefQualifier = 0; ICS.Standard.ObjCLifetimeConversionBinding = ObjCLifetimeConversion; ICS.Standard.CopyConstructor = nullptr; - ICS.Standard.DeprecatedStringLiteralToCharPtr = false; + ICS.Standard.DeprecatedStringLiteralToCharPtr = 0; // Nothing more to do: the inaccessibility/ambiguity check for // derived-to-base conversions is suppressed when we're @@ -4403,7 +4403,7 @@ ICS.Standard.setToType(0, T2); ICS.Standard.setToType(1, T1); ICS.Standard.setToType(2, T1); - ICS.Standard.ReferenceBinding = true; + ICS.Standard.ReferenceBinding = 1; // In C++0x, this is always a direct binding. In C++98/03, it's a direct // binding unless we're binding to a class prvalue. // Note: Although xvalues wouldn't normally show up in C++98/03 code, we @@ -4415,10 +4415,10 @@ ICS.Standard.IsLvalueReference = !isRValRef; ICS.Standard.BindsToFunctionLvalue = T2->isFunctionType(); ICS.Standard.BindsToRvalue = InitCategory.isRValue(); - ICS.Standard.BindsImplicitObjectArgumentWithoutRefQualifier = false; + ICS.Standard.BindsImplicitObjectArgumentWithoutRefQualifier = 0; ICS.Standard.ObjCLifetimeConversionBinding = ObjCLifetimeConversion; ICS.Standard.CopyConstructor = nullptr; - ICS.Standard.DeprecatedStringLiteralToCharPtr = false; + ICS.Standard.DeprecatedStringLiteralToCharPtr = 0; return ICS; } @@ -4511,12 +4511,12 @@ // Of course, that's still a reference binding. if (ICS.isStandard()) { - ICS.Standard.ReferenceBinding = true; + ICS.Standard.ReferenceBinding = 1; ICS.Standard.IsLvalueReference = !isRValRef; - ICS.Standard.BindsToFunctionLvalue = false; - ICS.Standard.BindsToRvalue = true; - ICS.Standard.BindsImplicitObjectArgumentWithoutRefQualifier = false; - ICS.Standard.ObjCLifetimeConversionBinding = false; + ICS.Standard.BindsToFunctionLvalue = 0; + ICS.Standard.BindsToRvalue = 1; + ICS.Standard.BindsImplicitObjectArgumentWithoutRefQualifier = 0; + ICS.Standard.ObjCLifetimeConversionBinding = 0; } else if (ICS.isUserDefined()) { const ReferenceType *LValRefType = ICS.UserDefined.ConversionFunction->getReturnType() @@ -4537,12 +4537,12 @@ } ICS.UserDefined.Before.setAsIdentityConversion(); - ICS.UserDefined.After.ReferenceBinding = true; + ICS.UserDefined.After.ReferenceBinding = 1; ICS.UserDefined.After.IsLvalueReference = !isRValRef; - ICS.UserDefined.After.BindsToFunctionLvalue = false; + ICS.UserDefined.After.BindsToFunctionLvalue = 0; ICS.UserDefined.After.BindsToRvalue = !LValRefType; - ICS.UserDefined.After.BindsImplicitObjectArgumentWithoutRefQualifier = false; - ICS.UserDefined.After.ObjCLifetimeConversionBinding = false; + ICS.UserDefined.After.BindsImplicitObjectArgumentWithoutRefQualifier = 0; + ICS.UserDefined.After.ObjCLifetimeConversionBinding = 0; } return ICS; @@ -4764,12 +4764,12 @@ (T1.isConstQualified() && !T1.isVolatileQualified())) { StandardConversionSequence &SCS = Result.isStandard() ? Result.Standard : Result.UserDefined.After; - SCS.ReferenceBinding = true; + SCS.ReferenceBinding = 1; SCS.IsLvalueReference = ToType->isLValueReferenceType(); - SCS.BindsToRvalue = true; - SCS.BindsToFunctionLvalue = false; - SCS.BindsImplicitObjectArgumentWithoutRefQualifier = false; - SCS.ObjCLifetimeConversionBinding = false; + SCS.BindsToRvalue = 1; + SCS.BindsToFunctionLvalue = 0; + SCS.BindsImplicitObjectArgumentWithoutRefQualifier = 0; + SCS.ObjCLifetimeConversionBinding = 0; } else Result.setBad(BadConversionSequence::lvalue_ref_to_rvalue, From, ToType); @@ -4952,10 +4952,10 @@ ICS.Standard.Second = SecondKind; ICS.Standard.setFromType(FromType); ICS.Standard.setAllToTypes(ImplicitParamType); - ICS.Standard.ReferenceBinding = true; - ICS.Standard.DirectBinding = true; + ICS.Standard.ReferenceBinding = 1; + ICS.Standard.DirectBinding = 1; ICS.Standard.IsLvalueReference = Method->getRefQualifier() != RQ_RValue; - ICS.Standard.BindsToFunctionLvalue = false; + ICS.Standard.BindsToFunctionLvalue = 0; ICS.Standard.BindsToRvalue = FromClassification.isRValue(); ICS.Standard.BindsImplicitObjectArgumentWithoutRefQualifier = (Method->getRefQualifier() == RQ_None); Index: lib/Sema/SemaStmt.cpp =================================================================== --- lib/Sema/SemaStmt.cpp +++ lib/Sema/SemaStmt.cpp @@ -3520,15 +3520,15 @@ // getEmptyKey() and getTombstoneKey() functions. friend struct llvm::DenseMapInfo; enum Unique { ForDenseMap }; - CatchHandlerType(QualType QT, Unique) : QT(QT), IsPointer(false) {} + CatchHandlerType(QualType QT, Unique) : QT(QT), IsPointer(0) {} public: /// Used when creating a CatchHandlerType from a handler type; will determine /// whether the type is a pointer or reference and will strip off the top /// level pointer and cv-qualifiers. - CatchHandlerType(QualType Q) : QT(Q), IsPointer(false) { + CatchHandlerType(QualType Q) : QT(Q), IsPointer(0) { if (QT->isPointerType()) - IsPointer = true; + IsPointer = 1; if (IsPointer || QT->isReferenceType()) QT = QT->getPointeeType(); Index: lib/Sema/SemaType.cpp =================================================================== --- lib/Sema/SemaType.cpp +++ lib/Sema/SemaType.cpp @@ -673,7 +673,7 @@ // i.e. whether the innermost semantic chunk is a function. if (declarator.isFunctionDeclarator()) { // If so, make that declarator a prototyped declarator. - declarator.getFunctionTypeInfo().hasPrototype = true; + declarator.getFunctionTypeInfo().hasPrototype = 1; return; } Index: lib/Serialization/ASTReader.cpp =================================================================== --- lib/Serialization/ASTReader.cpp +++ lib/Serialization/ASTReader.cpp @@ -1630,8 +1630,8 @@ } // This HeaderFileInfo was externally loaded. - HFI.External = true; - HFI.IsValid = true; + HFI.External = 1; + HFI.IsValid = 1; return HFI; } @@ -3366,7 +3366,7 @@ assert(Owner->NameVisibility != Module::Hidden && "nothing to make visible?"); for (Decl *D : Names) { bool wasHidden = D->Hidden; - D->Hidden = false; + D->Hidden = 0; if (wasHidden && SemaObj) { if (ObjCMethodDecl *Method = dyn_cast(D)) { @@ -4529,7 +4529,7 @@ } CurrentModule->Signature = F.Signature; - CurrentModule->IsFromModuleFile = true; + CurrentModule->IsFromModuleFile = 1; CurrentModule->IsSystem = IsSystem || CurrentModule->IsSystem; CurrentModule->IsExternC = IsExternC; CurrentModule->InferSubmodules = InferSubmodules; @@ -4640,7 +4640,7 @@ Unresolved.Mod = CurrentModule; Unresolved.ID = Record[Idx]; Unresolved.Kind = UnresolvedModuleRef::Import; - Unresolved.IsWildcard = false; + Unresolved.IsWildcard = 0; UnresolvedModuleRefs.push_back(Unresolved); } break; @@ -4683,7 +4683,7 @@ Unresolved.Mod = CurrentModule; Unresolved.ID = Record[0]; Unresolved.Kind = UnresolvedModuleRef::Conflict; - Unresolved.IsWildcard = false; + Unresolved.IsWildcard = 0; Unresolved.String = Blob; UnresolvedModuleRefs.push_back(Unresolved); break; @@ -5464,7 +5464,7 @@ case TYPE_AUTO: { QualType Deduced = readType(*Loc.F, Record, Idx); AutoTypeKeyword Keyword = (AutoTypeKeyword)Record[Idx++]; - bool IsDependent = Deduced.isNull() ? Record[Idx++] : false; + bool IsDependent = Deduced.isNull() ? Record[Idx++] : 0; return Context.getAutoType(Deduced, Keyword, IsDependent); } Index: lib/Serialization/ASTReaderDecl.cpp =================================================================== --- lib/Serialization/ASTReaderDecl.cpp +++ lib/Serialization/ASTReaderDecl.cpp @@ -374,7 +374,7 @@ if (Def->isHidden()) { // If MergedDef is visible or becomes visible, make the definition visible. if (!MergedDef->isHidden()) - Def->Hidden = false; + Def->Hidden = 0; else if (Reader.getContext().getLangOpts().ModulesLocalVisibility) { Reader.getContext().mergeDefinitionIntoModule( Def, MergedDef->getImportedOwningModule(), @@ -523,7 +523,7 @@ D->setReferenced(Record[Idx++]); D->setTopLevelDeclInObjCContainer(Record[Idx++]); D->setAccess((AccessSpecifier)Record[Idx++]); - D->FromASTFile = true; + D->FromASTFile = 1; D->setModulePrivate(Record[Idx++]); D->Hidden = D->isModulePrivate(); @@ -539,11 +539,11 @@ // If local visibility is being tracked, this declaration will become // hidden and visible as the owning module does. Inform Sema that this // declaration might not be visible. - D->Hidden = true; + D->Hidden = 1; } else if (Module *Owner = Reader.getSubmodule(SubmoduleID)) { if (Owner->NameVisibility != Module::AllVisible) { // The owning module is not visible. Mark this declaration as hidden. - D->Hidden = true; + D->Hidden = 1; // Note that this declaration was hidden because its owning module is // not yet visible. @@ -1612,7 +1612,7 @@ // match when we come to lazily load them. if (MergeDD.ComputedVisibleConversions && !DD.ComputedVisibleConversions) { DD.VisibleConversions = std::move(MergeDD.VisibleConversions); - DD.ComputedVisibleConversions = true; + DD.ComputedVisibleConversions = 1; } // FIXME: Issue a diagnostic if FirstFriend doesn't match when we come to @@ -3025,7 +3025,7 @@ // module C instantiates the definition of X::f // // If module B and C are merged, we do not have a violation of this rule. - FD->IsInline = true; + FD->IsInline = 1; } // If we need to propagate an exception specification along the redecl @@ -3111,7 +3111,7 @@ // If the previous declaration is marked as used, then this declaration should // be too. if (Previous->Used) - D->Used = true; + D->Used = 1; // If the declaration declares a template, it may inherit default arguments // from the previous declaration. @@ -3862,7 +3862,7 @@ // ASTMutationListeners other than an ASTWriter. // Maintain AST consistency: any later redeclarations are used too. - forAllLaterRedecls(D, [](Decl *D) { D->Used = true; }); + forAllLaterRedecls(D, [](Decl *D) { D->Used = 1; }); break; } @@ -3899,7 +3899,7 @@ Reader.HiddenNamesMap[Owner].push_back(Exported); } else { // The declaration is now visible. - Exported->Hidden = false; + Exported->Hidden = 0; } break; } Index: lib/Serialization/ASTWriter.cpp =================================================================== --- lib/Serialization/ASTWriter.cpp +++ lib/Serialization/ASTWriter.cpp @@ -4710,12 +4710,12 @@ auto From = Spec->getInstantiatedFrom(); if (auto PartialSpec = From.dyn_cast()) { - Record.push_back(true); + Record.push_back(1); Record.AddDeclRef(PartialSpec); Record.AddTemplateArgumentList( &Spec->getTemplateInstantiationArgs()); } else { - Record.push_back(false); + Record.push_back(0); } } Record.push_back(RD->getTagKind()); Index: lib/StaticAnalyzer/Checkers/DebugCheckers.cpp =================================================================== --- lib/StaticAnalyzer/Checkers/DebugCheckers.cpp +++ lib/StaticAnalyzer/Checkers/DebugCheckers.cpp @@ -99,8 +99,8 @@ void checkASTCodeBody(const Decl *D, AnalysisManager& mgr, BugReporter &BR) const { PrintingPolicy Policy(mgr.getLangOpts()); - Policy.TerseOutput = true; - Policy.PolishForDeclaration = true; + Policy.TerseOutput = 1; + Policy.PolishForDeclaration = 1; D->print(llvm::errs(), Policy); if (CFG *cfg = mgr.getCFG(D)) { Index: lib/StaticAnalyzer/Frontend/ModelInjector.cpp =================================================================== --- lib/StaticAnalyzer/Frontend/ModelInjector.cpp +++ lib/StaticAnalyzer/Frontend/ModelInjector.cpp @@ -70,7 +70,7 @@ InputKind IK = IK_CXX; // FIXME FrontendOpts.Inputs.clear(); FrontendOpts.Inputs.emplace_back(fileName, IK); - FrontendOpts.DisableFree = true; + FrontendOpts.DisableFree = 1; Invocation->getDiagnosticOpts().VerifyDiagnostics = 0; Index: lib/Tooling/Core/QualTypeNames.cpp =================================================================== --- lib/Tooling/Core/QualTypeNames.cpp +++ lib/Tooling/Core/QualTypeNames.cpp @@ -422,7 +422,7 @@ PrintingPolicy Policy(Ctx.getPrintingPolicy()); Policy.SuppressScope = false; Policy.AnonymousTagLocations = false; - Policy.PolishForDeclaration = true; + Policy.PolishForDeclaration = 1; Policy.SuppressUnwrittenScope = true; QualType FQQT = getFullyQualifiedType(QT, Ctx); return FQQT.getAsString(Policy); Index: lib/Tooling/Tooling.cpp =================================================================== --- lib/Tooling/Tooling.cpp +++ lib/Tooling/Tooling.cpp @@ -93,8 +93,8 @@ clang::CompilerInvocation::CreateFromArgs( *Invocation, CC1Args.data() + 1, CC1Args.data() + CC1Args.size(), *Diagnostics); - Invocation->getFrontendOpts().DisableFree = false; - Invocation->getCodeGenOpts().DisableFree = false; + Invocation->getFrontendOpts().DisableFree = 0; + Invocation->getCodeGenOpts().DisableFree = 0; Invocation->getDependencyOutputOpts() = DependencyOutputOptions(); return Invocation; } Index: tools/libclang/CIndex.cpp =================================================================== --- tools/libclang/CIndex.cpp +++ tools/libclang/CIndex.cpp @@ -3364,32 +3364,32 @@ unsigned clang_Cursor_isMacroFunctionLike(CXCursor C) { const IdentifierInfo *II = getMacroIdentifier(C); if (!II) { - return false; + return 0; } ASTUnit *ASTU = getCursorASTUnit(C); Preprocessor &PP = ASTU->getPreprocessor(); if (const MacroInfo *MI = PP.getMacroInfo(II)) return MI->isFunctionLike(); - return false; + return 0; } unsigned clang_Cursor_isMacroBuiltin(CXCursor C) { const IdentifierInfo *II = getMacroIdentifier(C); if (!II) { - return false; + return 0; } ASTUnit *ASTU = getCursorASTUnit(C); Preprocessor &PP = ASTU->getPreprocessor(); if (const MacroInfo *MI = PP.getMacroInfo(II)) return MI->isBuiltinMacro(); - return false; + return 0; } unsigned clang_Cursor_isFunctionInlined(CXCursor C) { const Decl *D = getCursorDecl(C); const FunctionDecl *FD = dyn_cast_or_null(D); if (!FD) { - return false; + return 0; } return FD->isInlined(); } @@ -3914,10 +3914,10 @@ int clang_File_isEqual(CXFile file1, CXFile file2) { if (file1 == file2) - return true; + return 1; if (!file1 || !file2) - return false; + return 0; FileEntry *FEnt1 = static_cast(file1); FileEntry *FEnt2 = static_cast(file2); @@ -5091,9 +5091,9 @@ case CXCursor_UnexposedExpr: case CXCursor_UnexposedStmt: case CXCursor_UnexposedAttr: - return true; + return 1; default: - return false; + return 0; } } Index: tools/libclang/CXComment.cpp =================================================================== --- tools/libclang/CXComment.cpp +++ tools/libclang/CXComment.cpp @@ -109,7 +109,7 @@ unsigned clang_Comment_isWhitespace(CXComment CXC) { const Comment *C = getASTNode(CXC); if (!C) - return false; + return 0; if (const TextComment *TC = dyn_cast(C)) return TC->isWhitespace(); @@ -117,13 +117,13 @@ if (const ParagraphComment *PC = dyn_cast(C)) return PC->isWhitespace(); - return false; + return 0; } unsigned clang_InlineContentComment_hasTrailingNewline(CXComment CXC) { const InlineContentComment *ICC = getASTNodeAs(CXC); if (!ICC) - return false; + return 0; return ICC->hasTrailingNewline(); } @@ -195,7 +195,7 @@ unsigned clang_HTMLStartTagComment_isSelfClosing(CXComment CXC) { const HTMLStartTagComment *HST = getASTNodeAs(CXC); if (!HST) - return false; + return 0; return HST->isSelfClosing(); } @@ -269,7 +269,7 @@ unsigned clang_ParamCommandComment_isParamIndexValid(CXComment CXC) { const ParamCommandComment *PCC = getASTNodeAs(CXC); if (!PCC) - return false; + return 0; return PCC->isParamIndexValid(); } @@ -285,7 +285,7 @@ unsigned clang_ParamCommandComment_isDirectionExplicit(CXComment CXC) { const ParamCommandComment *PCC = getASTNodeAs(CXC); if (!PCC) - return false; + return 0; return PCC->isDirectionExplicit(); } @@ -320,7 +320,7 @@ unsigned clang_TParamCommandComment_isParamPositionValid(CXComment CXC) { const TParamCommandComment *TPCC = getASTNodeAs(CXC); if (!TPCC) - return false; + return 0; return TPCC->isPositionValid(); } Index: tools/libclang/CXCursor.cpp =================================================================== --- tools/libclang/CXCursor.cpp +++ tools/libclang/CXCursor.cpp @@ -1468,13 +1468,13 @@ if (const ObjCMessageExpr *MsgE = dyn_cast(E)) { if (MsgE->getReceiverKind() != ObjCMessageExpr::Instance) - return false; + return 0; if (auto *RecE = dyn_cast( MsgE->getInstanceReceiver()->IgnoreParenCasts())) { if (RecE->getMethodFamily() == OMF_alloc) - return false; + return 0; } - return true; + return 1; } const MemberExpr *ME = nullptr; Index: tools/libclang/CXIndexDataConsumer.cpp =================================================================== --- tools/libclang/CXIndexDataConsumer.cpp +++ tools/libclang/CXIndexDataConsumer.cpp @@ -498,7 +498,7 @@ const_cast(File)), /*module=*/nullptr, getIndexLoc(SourceLocation()), - /*isImplicit=*/false + /*isImplicit=*/0 }; CXIdxClientASTFile astFile = CB.importedASTFile(ClientData, &Info); (void)astFile; Index: tools/libclang/CXType.cpp =================================================================== --- tools/libclang/CXType.cpp +++ tools/libclang/CXType.cpp @@ -955,14 +955,14 @@ CXClientData client_data){ CXCursor PC = clang_getTypeDeclaration(PT); if (clang_isInvalid(PC.kind)) - return false; + return 0; const RecordDecl *RD = dyn_cast_or_null(cxcursor::getCursorDecl(PC)); if (!RD || RD->isInvalidDecl()) - return false; + return 0; RD = RD->getDefinition(); if (!RD || RD->isInvalidDecl()) - return false; + return 0; for (RecordDecl::field_iterator I = RD->field_begin(), E = RD->field_end(); I != E; ++I){ @@ -970,12 +970,12 @@ // Callback to the client. switch (visitor(cxcursor::MakeCXCursor(FD, GetTU(PT)), client_data)){ case CXVisit_Break: - return true; + return 1; case CXVisit_Continue: break; } } - return true; + return 1; } unsigned clang_Cursor_isAnonymous(CXCursor C){ Index: tools/libclang/Indexing.cpp =================================================================== --- tools/libclang/Indexing.cpp +++ tools/libclang/Indexing.cpp @@ -508,10 +508,10 @@ // (often very broken) source code, where spell-checking can have a // significant negative impact on performance (particularly when // precompiled headers are involved), we disable it. - CInvok->getLangOpts()->SpellChecking = false; + CInvok->getLangOpts()->SpellChecking = 0; if (index_options & CXIndexOpt_SuppressWarnings) - CInvok->getDiagnosticOpts().IgnoreWarnings = true; + CInvok->getDiagnosticOpts().IgnoreWarnings = 1; // Make sure to use the raw module format. CInvok->getHeaderSearchOpts().ModuleFormat = @@ -534,7 +534,7 @@ bool SkipBodies = (index_options & CXIndexOpt_SkipParsedBodiesInSession) && CInvok->getLangOpts()->CPlusPlus; if (SkipBodies) - CInvok->getFrontendOpts().SkipFunctionBodies = true; + CInvok->getFrontendOpts().SkipFunctionBodies = 1; auto DataConsumer = std::make_shared(client_data, CB, index_options, @@ -569,11 +569,11 @@ } if (TU_options & CXTranslationUnit_DetailedPreprocessingRecord) { - PPOpts.DetailedRecord = true; + PPOpts.DetailedRecord = 1; } if (!requestedToGetTU && !CInvok->getLangOpts()->Modules) - PPOpts.DetailedRecord = false; + PPOpts.DetailedRecord = 0; // Unless the user specified that they want the preamble on the first parse // set it up to be created on the first reparse. This makes the first parse Index: unittests/AST/DeclPrinterTest.cpp =================================================================== --- unittests/AST/DeclPrinterTest.cpp +++ unittests/AST/DeclPrinterTest.cpp @@ -33,7 +33,7 @@ void PrintDecl(raw_ostream &Out, const ASTContext *Context, const Decl *D) { PrintingPolicy Policy = Context->getPrintingPolicy(); - Policy.TerseOutput = true; + Policy.TerseOutput = 1; D->print(Out, Policy, /*Indentation*/ 0, /*PrintInstantiation*/ false); } Index: unittests/Frontend/FrontendActionTest.cpp =================================================================== --- unittests/Frontend/FrontendActionTest.cpp +++ unittests/Frontend/FrontendActionTest.cpp @@ -118,8 +118,8 @@ TEST(ASTFrontendAction, LateTemplateIncrementalParsing) { CompilerInvocation *invocation = new CompilerInvocation; - invocation->getLangOpts()->CPlusPlus = true; - invocation->getLangOpts()->DelayedTemplateParsing = true; + invocation->getLangOpts()->CPlusPlus = 1; + invocation->getLangOpts()->DelayedTemplateParsing = 1; invocation->getPreprocessorOpts().addRemappedFile( "test.cc", MemoryBuffer::getMemBuffer( "template struct A { A(T); T data; };\n" Index: unittests/Tooling/ToolingTest.cpp =================================================================== --- unittests/Tooling/ToolingTest.cpp +++ unittests/Tooling/ToolingTest.cpp @@ -249,7 +249,7 @@ struct SkipBodyAction : public clang::ASTFrontendAction { std::unique_ptr CreateASTConsumer(CompilerInstance &Compiler, StringRef) override { - Compiler.getFrontendOpts().SkipFunctionBodies = true; + Compiler.getFrontendOpts().SkipFunctionBodies = 1; return llvm::make_unique(); } }; Index: unittests/libclang/LibclangTest.cpp =================================================================== --- unittests/libclang/LibclangTest.cpp +++ unittests/libclang/LibclangTest.cpp @@ -193,7 +193,7 @@ "}\n"; TestVFO T(contents); T.map("/path/virtual/foo.h", "/real/foo.h"); - clang_VirtualFileOverlay_setCaseSensitivity(T.VFO, false); + clang_VirtualFileOverlay_setCaseSensitivity(T.VFO, 0); } TEST(libclang, VirtualFileOverlay_SharedPrefix) {