Index: include/clang-c/Documentation.h =================================================================== --- include/clang-c/Documentation.h +++ include/clang-c/Documentation.h @@ -238,7 +238,7 @@ * * \returns non-zero if \c Comment is whitespace. */ -CINDEX_LINKAGE unsigned clang_Comment_isWhitespace(CXComment Comment); +CINDEX_LINKAGE bool clang_Comment_isWhitespace(CXComment Comment); /** * \returns non-zero if \c Comment is inline content and has a newline @@ -246,7 +246,7 @@ * do not count. */ CINDEX_LINKAGE -unsigned clang_InlineContentComment_hasTrailingNewline(CXComment Comment); +bool clang_InlineContentComment_hasTrailingNewline(CXComment Comment); /** * \param Comment a \c CXComment_Text AST node. @@ -305,7 +305,7 @@ * \returns non-zero if tag is self-closing (for example, <br />). */ CINDEX_LINKAGE -unsigned clang_HTMLStartTagComment_isSelfClosing(CXComment Comment); +bool clang_HTMLStartTagComment_isSelfClosing(CXComment Comment); /** * \param Comment a \c CXComment_HTMLStartTag AST node. @@ -386,7 +386,7 @@ * function will return a meaningful value. */ CINDEX_LINKAGE -unsigned clang_ParamCommandComment_isParamIndexValid(CXComment Comment); +bool clang_ParamCommandComment_isParamIndexValid(CXComment Comment); /** * \param Comment a \c CXComment_ParamCommand AST node. @@ -403,7 +403,7 @@ * the comment. */ CINDEX_LINKAGE -unsigned clang_ParamCommandComment_isDirectionExplicit(CXComment Comment); +bool clang_ParamCommandComment_isDirectionExplicit(CXComment Comment); /** * \param Comment a \c CXComment_ParamCommand AST node. @@ -432,7 +432,7 @@ * value. */ CINDEX_LINKAGE -unsigned clang_TParamCommandComment_isParamPositionValid(CXComment Comment); +bool clang_TParamCommandComment_isParamPositionValid(CXComment Comment); /** * \param Comment a \c CXComment_TParamCommand AST node. Index: include/clang-c/Index.h =================================================================== --- include/clang-c/Index.h +++ include/clang-c/Index.h @@ -338,7 +338,7 @@ * \brief Returns non-zero if the \c file1 and \c file2 point to the same file, * or they are both NULL. */ -CINDEX_LINKAGE int clang_File_isEqual(CXFile file1, CXFile file2); +CINDEX_LINKAGE bool clang_File_isEqual(CXFile file1, CXFile file2); /** * @} @@ -394,7 +394,7 @@ * \returns non-zero if the source locations refer to the same location, zero * if they refer to different locations. */ -CINDEX_LINKAGE unsigned clang_equalLocations(CXSourceLocation loc1, +CINDEX_LINKAGE bool clang_equalLocations(CXSourceLocation loc1, CXSourceLocation loc2); /** @@ -441,7 +441,7 @@ * * \returns non-zero if the ranges are the same, zero if they differ. */ -CINDEX_LINKAGE unsigned clang_equalRanges(CXSourceRange range1, +CINDEX_LINKAGE bool clang_equalRanges(CXSourceRange range1, CXSourceRange range2); /** @@ -2410,7 +2410,7 @@ /** * \brief Determine whether two cursors are equivalent. */ -CINDEX_LINKAGE unsigned clang_equalCursors(CXCursor, CXCursor); +CINDEX_LINKAGE bool clang_equalCursors(CXCursor, CXCursor); /** * \brief Returns non-zero if \p cursor is null. @@ -2430,7 +2430,7 @@ /** * \brief Determine whether the given cursor kind represents a declaration. */ -CINDEX_LINKAGE unsigned clang_isDeclaration(enum CXCursorKind); +CINDEX_LINKAGE bool clang_isDeclaration(enum CXCursorKind); /** * \brief Determine whether the given cursor kind represents a simple @@ -2440,22 +2440,22 @@ * other cursors. Use clang_getCursorReferenced() to determine whether a * particular cursor refers to another entity. */ -CINDEX_LINKAGE unsigned clang_isReference(enum CXCursorKind); +CINDEX_LINKAGE bool clang_isReference(enum CXCursorKind); /** * \brief Determine whether the given cursor kind represents an expression. */ -CINDEX_LINKAGE unsigned clang_isExpression(enum CXCursorKind); +CINDEX_LINKAGE bool clang_isExpression(enum CXCursorKind); /** * \brief Determine whether the given cursor kind represents a statement. */ -CINDEX_LINKAGE unsigned clang_isStatement(enum CXCursorKind); +CINDEX_LINKAGE bool clang_isStatement(enum CXCursorKind); /** * \brief Determine whether the given cursor kind represents an attribute. */ -CINDEX_LINKAGE unsigned clang_isAttribute(enum CXCursorKind); +CINDEX_LINKAGE bool clang_isAttribute(enum CXCursorKind); /** * \brief Determine whether the given cursor has any attributes. @@ -2466,25 +2466,25 @@ * \brief Determine whether the given cursor kind represents an invalid * cursor. */ -CINDEX_LINKAGE unsigned clang_isInvalid(enum CXCursorKind); +CINDEX_LINKAGE bool clang_isInvalid(enum CXCursorKind); /** * \brief Determine whether the given cursor kind represents a translation * unit. */ -CINDEX_LINKAGE unsigned clang_isTranslationUnit(enum CXCursorKind); +CINDEX_LINKAGE bool clang_isTranslationUnit(enum CXCursorKind); /*** * \brief Determine whether the given cursor represents a preprocessing * element, such as a preprocessor directive or macro instantiation. */ -CINDEX_LINKAGE unsigned clang_isPreprocessing(enum CXCursorKind); +CINDEX_LINKAGE bool clang_isPreprocessing(enum CXCursorKind); /*** * \brief Determine whether the given cursor represents a currently * unexposed piece of the AST (e.g., CXCursor_UnexposedStmt). */ -CINDEX_LINKAGE unsigned clang_isUnexposed(enum CXCursorKind); +CINDEX_LINKAGE bool clang_isUnexposed(enum CXCursorKind); /** * \brief Describe the linkage of the entity referred to by a cursor. @@ -3193,7 +3193,7 @@ * \returns non-zero if the CXTypes represent the same type and * zero otherwise. */ -CINDEX_LINKAGE unsigned clang_equalTypes(CXType A, CXType B); +CINDEX_LINKAGE bool clang_equalTypes(CXType A, CXType B); /** * \brief Return the canonical type for a CXType. @@ -3210,39 +3210,39 @@ * without looking through typedefs that may have added "const" at a * different level. */ -CINDEX_LINKAGE unsigned clang_isConstQualifiedType(CXType T); +CINDEX_LINKAGE bool clang_isConstQualifiedType(CXType T); /** * \brief Determine whether a CXCursor that is a macro, is * function like. */ -CINDEX_LINKAGE unsigned clang_Cursor_isMacroFunctionLike(CXCursor C); +CINDEX_LINKAGE bool clang_Cursor_isMacroFunctionLike(CXCursor C); /** * \brief Determine whether a CXCursor that is a macro, is a * builtin one. */ -CINDEX_LINKAGE unsigned clang_Cursor_isMacroBuiltin(CXCursor C); +CINDEX_LINKAGE bool clang_Cursor_isMacroBuiltin(CXCursor C); /** * \brief Determine whether a CXCursor that is a function declaration, is an * inline declaration. */ -CINDEX_LINKAGE unsigned clang_Cursor_isFunctionInlined(CXCursor C); +CINDEX_LINKAGE bool clang_Cursor_isFunctionInlined(CXCursor C); /** * \brief Determine whether a CXType has the "volatile" qualifier set, * without looking through typedefs that may have added "volatile" at * a different level. */ -CINDEX_LINKAGE unsigned clang_isVolatileQualifiedType(CXType T); +CINDEX_LINKAGE bool clang_isVolatileQualifiedType(CXType T); /** * \brief Determine whether a CXType has the "restrict" qualifier set, * without looking through typedefs that may have added "restrict" at a * different level. */ -CINDEX_LINKAGE unsigned clang_isRestrictQualifiedType(CXType T); +CINDEX_LINKAGE bool clang_isRestrictQualifiedType(CXType T); /** * \brief For pointer types, returns the type of the pointee. @@ -3663,7 +3663,7 @@ * \returns a non-zero value if the traversal was terminated * prematurely by the visitor returning \c CXChildVisit_Break. */ -CINDEX_LINKAGE unsigned clang_visitChildren(CXCursor parent, +CINDEX_LINKAGE bool clang_visitChildren(CXCursor parent, CXCursorVisitor visitor, CXClientData client_data); #ifdef __has_feature @@ -5731,7 +5731,7 @@ } IndexerCallbacks; -CINDEX_LINKAGE int clang_index_isEntityObjCContainerKind(CXIdxEntityKind); +CINDEX_LINKAGE bool clang_index_isEntityObjCContainerKind(CXIdxEntityKind); CINDEX_LINKAGE const CXIdxObjCContainerDeclInfo * clang_index_getObjCContainerDeclInfo(const CXIdxDeclInfo *); @@ -5968,7 +5968,7 @@ * \returns a non-zero value if the traversal was terminated * prematurely by the visitor returning \c CXFieldVisit_Break. */ -CINDEX_LINKAGE unsigned clang_Type_visitFields(CXType T, +CINDEX_LINKAGE bool clang_Type_visitFields(CXType T, CXFieldVisitor visitor, CXClientData client_data); Index: include/llvm-c/Core.h =================================================================== --- include/llvm-c/Core.h +++ include/llvm-c/Core.h @@ -601,7 +601,7 @@ * * @see Module::print() */ -LLVMBool LLVMPrintModuleToFile(LLVMModuleRef M, const char *Filename, +bool LLVMPrintModuleToFile(LLVMModuleRef M, const char *Filename, char **ErrorMessage); /** @@ -755,7 +755,7 @@ * * @see llvm::Type::isSized() */ -LLVMBool LLVMTypeIsSized(LLVMTypeRef Ty); +bool LLVMTypeIsSized(LLVMTypeRef Ty); /** * Obtain the context to which this type instance is associated. @@ -887,7 +887,7 @@ /** * Returns whether a function type is variadic. */ -LLVMBool LLVMIsFunctionVarArg(LLVMTypeRef FunctionTy); +bool LLVMIsFunctionVarArg(LLVMTypeRef FunctionTy); /** * Obtain the Type this function Type returns. @@ -998,14 +998,14 @@ * * @see llvm::StructType::isPacked() */ -LLVMBool LLVMIsPackedStruct(LLVMTypeRef StructTy); +bool LLVMIsPackedStruct(LLVMTypeRef StructTy); /** * Determine whether a structure is opaque. * * @see llvm::StructType::isOpaque() */ -LLVMBool LLVMIsOpaqueStruct(LLVMTypeRef StructTy); +bool LLVMIsOpaqueStruct(LLVMTypeRef StructTy); /** * @} @@ -1292,12 +1292,12 @@ /** * Determine whether the specified value instance is constant. */ -LLVMBool LLVMIsConstant(LLVMValueRef Val); +bool LLVMIsConstant(LLVMValueRef Val); /** * Determine whether a value instance is undefined. */ -LLVMBool LLVMIsUndef(LLVMValueRef Val); +bool LLVMIsUndef(LLVMValueRef Val); /** * Convert value instances between types. @@ -1457,7 +1457,7 @@ * * @see llvm::Constant::isNullValue() */ -LLVMBool LLVMIsNull(LLVMValueRef Val); +bool LLVMIsNull(LLVMValueRef Val); /** * Obtain a constant that is a constant pointer pointing to NULL for a @@ -1603,7 +1603,7 @@ * * @see ConstantDataSequential::getAsString() */ -LLVMBool LLVMIsConstantString(LLVMValueRef c); +bool LLVMIsConstantString(LLVMValueRef c); /** * Get the given constant data sequential as a string. @@ -1779,7 +1779,7 @@ */ LLVMModuleRef LLVMGetGlobalParent(LLVMValueRef Global); -LLVMBool LLVMIsDeclaration(LLVMValueRef Global); +bool LLVMIsDeclaration(LLVMValueRef Global); LLVMLinkage LLVMGetLinkage(LLVMValueRef Global); void LLVMSetLinkage(LLVMValueRef Global, LLVMLinkage Linkage); const char *LLVMGetSection(LLVMValueRef Global); @@ -1788,7 +1788,7 @@ void LLVMSetVisibility(LLVMValueRef Global, LLVMVisibility Viz); LLVMDLLStorageClass LLVMGetDLLStorageClass(LLVMValueRef Global); void LLVMSetDLLStorageClass(LLVMValueRef Global, LLVMDLLStorageClass Class); -LLVMBool LLVMHasUnnamedAddr(LLVMValueRef Global); +bool LLVMHasUnnamedAddr(LLVMValueRef Global); void LLVMSetUnnamedAddr(LLVMValueRef Global, LLVMBool HasUnnamedAddr); /** @@ -1841,13 +1841,13 @@ void LLVMDeleteGlobal(LLVMValueRef GlobalVar); LLVMValueRef LLVMGetInitializer(LLVMValueRef GlobalVar); void LLVMSetInitializer(LLVMValueRef GlobalVar, LLVMValueRef ConstantVal); -LLVMBool LLVMIsThreadLocal(LLVMValueRef GlobalVar); +bool LLVMIsThreadLocal(LLVMValueRef GlobalVar); void LLVMSetThreadLocal(LLVMValueRef GlobalVar, LLVMBool IsThreadLocal); -LLVMBool LLVMIsGlobalConstant(LLVMValueRef GlobalVar); +bool LLVMIsGlobalConstant(LLVMValueRef GlobalVar); void LLVMSetGlobalConstant(LLVMValueRef GlobalVar, LLVMBool IsConstant); LLVMThreadLocalMode LLVMGetThreadLocalMode(LLVMValueRef GlobalVar); void LLVMSetThreadLocalMode(LLVMValueRef GlobalVar, LLVMThreadLocalMode Mode); -LLVMBool LLVMIsExternallyInitialized(LLVMValueRef GlobalVar); +bool LLVMIsExternallyInitialized(LLVMValueRef GlobalVar); void LLVMSetExternallyInitialized(LLVMValueRef GlobalVar, LLVMBool IsExtInit); /** @@ -1893,7 +1893,7 @@ * * @see llvm::Function::hasPersonalityFn() */ -LLVMBool LLVMHasPersonalityFn(LLVMValueRef Fn); +bool LLVMHasPersonalityFn(LLVMValueRef Fn); /** * Obtain the personality function attached to the function. @@ -2195,7 +2195,7 @@ /** * Determine whether an LLVMValueRef is itself a basic block. */ -LLVMBool LLVMValueIsBasicBlock(LLVMValueRef Val); +bool LLVMValueIsBasicBlock(LLVMValueRef Val); /** * Convert an LLVMValueRef to an LLVMBasicBlockRef instance. @@ -2388,7 +2388,7 @@ /** * Determine whether an instruction has any metadata attached. */ -int LLVMHasMetadata(LLVMValueRef Val); +bool LLVMHasMetadata(LLVMValueRef Val); /** * Return metadata associated with an instruction value. @@ -2549,7 +2549,7 @@ * * @see llvm::CallInst::isTailCall() */ -LLVMBool LLVMIsTailCall(LLVMValueRef CallInst); +bool LLVMIsTailCall(LLVMValueRef CallInst); /** * Set whether a call instruction is a tail call. @@ -2637,7 +2637,7 @@ * * @see llvm::BranchInst::isConditional */ -LLVMBool LLVMIsConditional(LLVMValueRef Branch); +bool LLVMIsConditional(LLVMValueRef Branch); /** * Return the condition of a branch instruction. @@ -2700,7 +2700,7 @@ /** * Check whether the given GEP instruction is inbounds. */ -LLVMBool LLVMIsInBounds(LLVMValueRef GEP); +bool LLVMIsInBounds(LLVMValueRef GEP); /** * Set the given GEP instruction to be inbounds or not. @@ -2844,7 +2844,7 @@ void LLVMAddClause(LLVMValueRef LandingPad, LLVMValueRef ClauseVal); /* Get the 'cleanup' flag in the landingpad instruction */ -LLVMBool LLVMIsCleanup(LLVMValueRef LandingPad); +bool LLVMIsCleanup(LLVMValueRef LandingPad); /* Set the 'cleanup' flag in the landingpad instruction */ void LLVMSetCleanup(LLVMValueRef LandingPad, LLVMBool Val); @@ -2934,7 +2934,7 @@ const char *Name); LLVMValueRef LLVMBuildGlobalStringPtr(LLVMBuilderRef B, const char *Str, const char *Name); -LLVMBool LLVMGetVolatile(LLVMValueRef MemoryAccessInst); +bool LLVMGetVolatile(LLVMValueRef MemoryAccessInst); void LLVMSetVolatile(LLVMValueRef MemoryAccessInst, LLVMBool IsVolatile); LLVMAtomicOrdering LLVMGetOrdering(LLVMValueRef MemoryAccessInst); void LLVMSetOrdering(LLVMValueRef MemoryAccessInst, LLVMAtomicOrdering Ordering); @@ -3031,7 +3031,7 @@ LLVMAtomicOrdering FailureOrdering, LLVMBool SingleThread); -LLVMBool LLVMIsAtomicSingleThread(LLVMValueRef AtomicInst); +bool LLVMIsAtomicSingleThread(LLVMValueRef AtomicInst); void LLVMSetAtomicSingleThread(LLVMValueRef AtomicInst, LLVMBool SingleThread); LLVMAtomicOrdering LLVMGetCmpXchgSuccessOrdering(LLVMValueRef CmpXchgInst); @@ -3131,23 +3131,23 @@ passes scheduled in the pass manager. Returns 1 if any of the passes modified the module, 0 otherwise. @see llvm::PassManager::run(Module&) */ -LLVMBool LLVMRunPassManager(LLVMPassManagerRef PM, LLVMModuleRef M); +bool LLVMRunPassManager(LLVMPassManagerRef PM, LLVMModuleRef M); /** Initializes all of the function passes scheduled in the function pass manager. Returns 1 if any of the passes modified the module, 0 otherwise. @see llvm::FunctionPassManager::doInitialization */ -LLVMBool LLVMInitializeFunctionPassManager(LLVMPassManagerRef FPM); +bool LLVMInitializeFunctionPassManager(LLVMPassManagerRef FPM); /** Executes all of the function passes scheduled in the function pass manager on the provided function. Returns 1 if any of the passes modified the function, false otherwise. @see llvm::FunctionPassManager::run(Function&) */ -LLVMBool LLVMRunFunctionPassManager(LLVMPassManagerRef FPM, LLVMValueRef F); +bool LLVMRunFunctionPassManager(LLVMPassManagerRef FPM, LLVMValueRef F); /** Finalizes all of the function passes scheduled in in the function pass manager. Returns 1 if any of the passes modified the module, 0 otherwise. @see llvm::FunctionPassManager::doFinalization */ -LLVMBool LLVMFinalizeFunctionPassManager(LLVMPassManagerRef FPM); +bool LLVMFinalizeFunctionPassManager(LLVMPassManagerRef FPM); /** Frees the memory of a pass pipeline. For function pipelines, does not free the module provider. @@ -3177,7 +3177,7 @@ /** Check whether LLVM is executing in thread-safe mode or not. @see llvm::llvm_is_multithreaded */ -LLVMBool LLVMIsMultithreaded(void); +bool LLVMIsMultithreaded(void); /** * @} Index: include/llvm-c/Disassembler.h =================================================================== --- include/llvm-c/Disassembler.h +++ include/llvm-c/Disassembler.h @@ -215,7 +215,7 @@ * Set the disassembler's options. Returns 1 if it can set the Options and 0 * otherwise. */ -int LLVMSetDisasmOptions(LLVMDisasmContextRef DC, uint64_t Options); +bool LLVMSetDisasmOptions(LLVMDisasmContextRef DC, uint64_t Options); /* The option to produce marked up assembly. */ #define LLVMDisassembler_Option_UseMarkup 1 Index: include/llvm-c/Object.h =================================================================== --- include/llvm-c/Object.h +++ include/llvm-c/Object.h @@ -64,7 +64,7 @@ uint64_t LLVMGetSectionSize(LLVMSectionIteratorRef SI); const char *LLVMGetSectionContents(LLVMSectionIteratorRef SI); uint64_t LLVMGetSectionAddress(LLVMSectionIteratorRef SI); -LLVMBool LLVMGetSectionContainsSymbol(LLVMSectionIteratorRef SI, +bool LLVMGetSectionContainsSymbol(LLVMSectionIteratorRef SI, LLVMSymbolIteratorRef Sym); // Section Relocation iterators Index: include/llvm-c/Support.h =================================================================== --- include/llvm-c/Support.h +++ include/llvm-c/Support.h @@ -27,7 +27,7 @@ * * @see sys::DynamicLibrary::LoadLibraryPermanently() */ -LLVMBool LLVMLoadLibraryPermanently(const char* Filename); +bool LLVMLoadLibraryPermanently(const char* Filename); /** * This function parses the given arguments using the LLVM command line parser. Index: include/llvm-c/TargetMachine.h =================================================================== --- include/llvm-c/TargetMachine.h +++ include/llvm-c/TargetMachine.h @@ -79,13 +79,13 @@ const char *LLVMGetTargetDescription(LLVMTargetRef T); /** Returns if the target has a JIT */ -LLVMBool LLVMTargetHasJIT(LLVMTargetRef T); +bool LLVMTargetHasJIT(LLVMTargetRef T); /** Returns if the target has a TargetMachine associated */ -LLVMBool LLVMTargetHasTargetMachine(LLVMTargetRef T); +bool LLVMTargetHasTargetMachine(LLVMTargetRef T); /** Returns if the target as an ASM backend (required for emitting output) */ -LLVMBool LLVMTargetHasAsmBackend(LLVMTargetRef T); +bool LLVMTargetHasAsmBackend(LLVMTargetRef T); /*===-- Target Machine ----------------------------------------------------===*/ /** Creates a new llvm::TargetMachine. See llvm::Target::createTargetMachine */ @@ -125,11 +125,11 @@ /** Emits an asm or object file for the given module to the filename. This wraps several c++ only classes (among them a file stream). Returns any error in ErrorMessage. Use LLVMDisposeMessage to dispose the message. */ -LLVMBool LLVMTargetMachineEmitToFile(LLVMTargetMachineRef T, LLVMModuleRef M, +bool LLVMTargetMachineEmitToFile(LLVMTargetMachineRef T, LLVMModuleRef M, char *Filename, LLVMCodeGenFileType codegen, char **ErrorMessage); /** Compile the LLVM IR stored in \p M and store the result in \p OutMemBuf. */ -LLVMBool LLVMTargetMachineEmitToMemoryBuffer(LLVMTargetMachineRef T, LLVMModuleRef M, +bool LLVMTargetMachineEmitToMemoryBuffer(LLVMTargetMachineRef T, LLVMModuleRef M, LLVMCodeGenFileType codegen, char** ErrorMessage, LLVMMemoryBufferRef *OutMemBuf); /*===-- Triple ------------------------------------------------------------===*/ Index: include/llvm/ADT/APInt.h =================================================================== --- include/llvm/ADT/APInt.h +++ include/llvm/ADT/APInt.h @@ -1615,7 +1615,7 @@ static bool tcIsZero(const integerPart *, unsigned int); /// Extract the given bit of a bignum; returns 0 or 1. Zero-based. - static int tcExtractBit(const integerPart *, unsigned int bit); + static bool tcExtractBit(const integerPart *, unsigned int bit); /// Copy the bit vector of width srcBITS from SRC, starting at bit srcLSB, to /// DST, of dstCOUNT parts, such that the bit srcLSB becomes the least @@ -1684,7 +1684,7 @@ /// SCRATCH is a bignum of the same size as the operands and result for use by /// the routine; its contents need not be initialized and are destroyed. LHS, /// REMAINDER and SCRATCH must be distinct. - static int tcDivide(integerPart *lhs, const integerPart *rhs, + static bool tcDivide(integerPart *lhs, const integerPart *rhs, integerPart *remainder, integerPart *scratch, unsigned int parts); @@ -1708,7 +1708,7 @@ static int tcCompare(const integerPart *, const integerPart *, unsigned int); /// Increment a bignum in-place. Return the carry flag. - static integerPart tcIncrement(integerPart *, unsigned int); + static bool tcIncrement(integerPart *, unsigned int); /// Decrement a bignum in-place. Return the borrow flag. static integerPart tcDecrement(integerPart *, unsigned int); Index: include/llvm/Object/MachO.h =================================================================== --- include/llvm/Object/MachO.h +++ include/llvm/Object/MachO.h @@ -323,7 +323,7 @@ uint32_t getScatteredRelocationType( const MachO::any_relocation_info &RE) const; unsigned getAnyRelocationAddress(const MachO::any_relocation_info &RE) const; - unsigned getAnyRelocationPCRel(const MachO::any_relocation_info &RE) const; + bool getAnyRelocationPCRel(const MachO::any_relocation_info &RE) const; unsigned getAnyRelocationLength(const MachO::any_relocation_info &RE) const; unsigned getAnyRelocationType(const MachO::any_relocation_info &RE) const; SectionRef getAnyRelocationSection(const MachO::any_relocation_info &RE) const; Index: lib/AST/Decl.cpp =================================================================== --- lib/AST/Decl.cpp +++ lib/AST/Decl.cpp @@ -170,8 +170,7 @@ /// Does the given declaration have member specialization information, /// and if so, is it an explicit specialization? -template static typename -std::enable_if::value, bool>::type +template static bool isExplicitMemberSpecialization(const T *D) { if (const MemberSpecializationInfo *member = D->getMemberSpecializationInfo()) { Index: lib/AST/DeclPrinter.cpp =================================================================== --- lib/AST/DeclPrinter.cpp +++ lib/AST/DeclPrinter.cpp @@ -1013,10 +1013,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/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; } } Index: lib/AsmParser/LLParser.cpp =================================================================== --- lib/AsmParser/LLParser.cpp +++ lib/AsmParser/LLParser.cpp @@ -4863,7 +4863,7 @@ switch (Token) { default: return Error(Loc, "expected instruction opcode"); // Terminator Instructions. - case lltok::kw_unreachable: Inst = new UnreachableInst(Context); return false; + case lltok::kw_unreachable: Inst = new UnreachableInst(Context); return 0; case lltok::kw_ret: return ParseRet(Inst, BB, PFS); case lltok::kw_br: return ParseBr(Inst, PFS); case lltok::kw_switch: return ParseSwitch(Inst, PFS); @@ -4884,11 +4884,11 @@ bool NSW = EatIfPresent(lltok::kw_nsw); if (!NUW) NUW = EatIfPresent(lltok::kw_nuw); - if (ParseArithmetic(Inst, PFS, KeywordVal, 1)) return true; + if (ParseArithmetic(Inst, PFS, KeywordVal, 1)) return 1; if (NUW) cast(Inst)->setHasNoUnsignedWrap(true); if (NSW) cast(Inst)->setHasNoSignedWrap(true); - return false; + return 0; } case lltok::kw_fadd: case lltok::kw_fsub: @@ -4910,9 +4910,9 @@ case lltok::kw_ashr: { bool Exact = EatIfPresent(lltok::kw_exact); - if (ParseArithmetic(Inst, PFS, KeywordVal, 1)) return true; + if (ParseArithmetic(Inst, PFS, KeywordVal, 1)) return 1; if (Exact) cast(Inst)->setIsExact(true); - return false; + return 0; } case lltok::kw_urem: @@ -5671,7 +5671,7 @@ ParseToken(lltok::comma, "expected ',' after insertelement value") || ParseValue(Type::getLabelTy(Context), Op1, PFS) || ParseToken(lltok::rsquare, "expected ']' in phi value list")) - return true; + return 1; bool AteExtraComma = false; SmallVector, 16> PHIVals; @@ -5691,7 +5691,7 @@ ParseToken(lltok::comma, "expected ',' after insertelement value") || ParseValue(Type::getLabelTy(Context), Op1, PFS) || ParseToken(lltok::rsquare, "expected ']' in phi value list")) - return true; + return 1; } if (!Ty->isFirstClassType()) @@ -5891,7 +5891,7 @@ bool IsInAlloca = EatIfPresent(lltok::kw_inalloca); bool IsSwiftError = EatIfPresent(lltok::kw_swifterror); - if (ParseType(Ty, TyLoc)) return true; + if (ParseType(Ty, TyLoc)) return 1; if (Ty->isFunctionTy() || !PointerType::isValidElementType(Ty)) return Error(TyLoc, "invalid type for alloca"); @@ -5899,13 +5899,13 @@ bool AteExtraComma = false; if (EatIfPresent(lltok::comma)) { if (Lex.getKind() == lltok::kw_align) { - if (ParseOptionalAlignment(Alignment)) return true; + if (ParseOptionalAlignment(Alignment)) return 1; } else if (Lex.getKind() == lltok::MetadataVar) { AteExtraComma = true; } else { if (ParseTypeAndValue(Size, SizeLoc, PFS) || ParseOptionalCommaAlign(Alignment, AteExtraComma)) - return true; + return 1; } } @@ -5949,7 +5949,7 @@ ParseTypeAndValue(Val, Loc, PFS) || ParseScopeAndOrdering(isAtomic, Scope, Ordering) || ParseOptionalCommaAlign(Alignment, AteExtraComma)) - return true; + return 1; if (!Val->getType()->isPointerTy() || !Ty->isFirstClassType()) return Error(Loc, "load operand must be a pointer to a first class type"); @@ -5996,7 +5996,7 @@ ParseTypeAndValue(Ptr, PtrLoc, PFS) || ParseScopeAndOrdering(isAtomic, Scope, Ordering) || ParseOptionalCommaAlign(Alignment, AteExtraComma)) - return true; + return 1; if (!Ptr->getType()->isPointerTy()) return Error(PtrLoc, "store operand must be a pointer"); @@ -6039,7 +6039,7 @@ ParseTypeAndValue(New, NewLoc, PFS) || ParseScopeAndOrdering(true /*Always atomic*/, Scope, SuccessOrdering) || ParseOrdering(FailureOrdering)) - return true; + return 1; if (SuccessOrdering == AtomicOrdering::Unordered || FailureOrdering == AtomicOrdering::Unordered) @@ -6101,7 +6101,7 @@ ParseToken(lltok::comma, "expected ',' after atomicrmw address") || ParseTypeAndValue(Val, ValLoc, PFS) || ParseScopeAndOrdering(true /*Always atomic*/, Scope, Ordering)) - return true; + return 1; if (Ordering == AtomicOrdering::Unordered) return TokError("atomicrmw cannot be unordered"); @@ -6129,7 +6129,7 @@ AtomicOrdering Ordering = AtomicOrdering::NotAtomic; SynchronizationScope Scope = CrossThread; if (ParseScopeAndOrdering(true /*Always atomic*/, Scope, Ordering)) - return true; + return 1; if (Ordering == AtomicOrdering::Unordered) return TokError("fence cannot be unordered"); @@ -6154,7 +6154,7 @@ if (ParseType(Ty) || ParseToken(lltok::comma, "expected comma after getelementptr's type") || ParseTypeAndValue(Ptr, Loc, PFS)) - return true; + return 1; Type *BaseType = Ptr->getType(); PointerType *BasePointerType = dyn_cast(BaseType->getScalarType()); @@ -6177,7 +6177,7 @@ AteExtraComma = true; break; } - if (ParseTypeAndValue(Val, EltLoc, PFS)) return true; + if (ParseTypeAndValue(Val, EltLoc, PFS)) return 1; if (!Val->getType()->getScalarType()->isIntegerTy()) return Error(EltLoc, "getelementptr index must be an integer"); @@ -6211,7 +6211,7 @@ bool AteExtraComma; if (ParseTypeAndValue(Val, Loc, PFS) || ParseIndexList(Indices, AteExtraComma)) - return true; + return 1; if (!Val->getType()->isAggregateType()) return Error(Loc, "extractvalue operand must be aggregate type"); @@ -6232,7 +6232,7 @@ ParseToken(lltok::comma, "expected comma after insertvalue operand") || ParseTypeAndValue(Val1, Loc1, PFS) || ParseIndexList(Indices, AteExtraComma)) - return true; + return 1; if (!Val0->getType()->isAggregateType()) return Error(Loc0, "insertvalue operand must be aggregate type"); Index: lib/Bitcode/Writer/BitWriter.cpp =================================================================== --- lib/Bitcode/Writer/BitWriter.cpp +++ lib/Bitcode/Writer/BitWriter.cpp @@ -37,7 +37,7 @@ } int LLVMWriteBitcodeToFileHandle(LLVMModuleRef M, int FileHandle) { - return LLVMWriteBitcodeToFD(M, FileHandle, true, false); + return LLVMWriteBitcodeToFD(M, FileHandle, 1, 0); } LLVMMemoryBufferRef LLVMWriteBitcodeToMemoryBuffer(LLVMModuleRef M) { Index: lib/Bitcode/Writer/BitcodeWriter.cpp =================================================================== --- lib/Bitcode/Writer/BitcodeWriter.cpp +++ lib/Bitcode/Writer/BitcodeWriter.cpp @@ -1484,7 +1484,7 @@ SmallVectorImpl &Record, unsigned Abbrev) { assert(N->isDistinct() && "Expected distinct compile units"); - Record.push_back(/* IsDistinct */ true); + Record.push_back(/* IsDistinct */ 1); Record.push_back(N->getSourceLanguage()); Record.push_back(VE.getMetadataOrNullID(N->getFile())); Record.push_back(VE.getMetadataOrNullID(N->getRawProducer())); Index: lib/CodeGen/CGAtomic.cpp =================================================================== --- lib/CodeGen/CGAtomic.cpp +++ lib/CodeGen/CGAtomic.cpp @@ -642,7 +642,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); @@ -971,7 +971,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 @@ -6959,7 +6959,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}); } @@ -7220,7 +7220,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}); } @@ -7231,7 +7231,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/CGOpenMPRuntime.cpp =================================================================== --- lib/CodeGen/CGOpenMPRuntime.cpp +++ lib/CodeGen/CGOpenMPRuntime.cpp @@ -1931,7 +1931,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)); @@ -2515,7 +2515,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); } @@ -3051,7 +3051,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())); @@ -3783,7 +3783,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"); @@ -5617,7 +5617,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/SelectionDAG/DAGCombiner.cpp =================================================================== --- lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -591,7 +591,7 @@ if (Depth > 6) return 0; switch (Op.getOpcode()) { - default: return false; + default: return 0; case ISD::ConstantFP: // Don't invert constant FP values after legalize. The negated constant // isn't necessarily legal. Index: lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp =================================================================== --- lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp +++ lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp @@ -1558,8 +1558,8 @@ // reduction scheduler. struct bu_ls_rr_sort : public queue_sort { enum { - IsBottomUp = true, - HasReadyFilter = false + IsBottomUp = 1, + HasReadyFilter = 0 }; RegReductionPQBase *SPQ; @@ -1571,8 +1571,8 @@ // src_ls_rr_sort - Priority function for source order scheduler. struct src_ls_rr_sort : public queue_sort { enum { - IsBottomUp = true, - HasReadyFilter = false + IsBottomUp = 1, + HasReadyFilter = 0 }; RegReductionPQBase *SPQ; @@ -1585,8 +1585,8 @@ // hybrid_ls_rr_sort - Priority function for hybrid scheduler. struct hybrid_ls_rr_sort : public queue_sort { enum { - IsBottomUp = true, - HasReadyFilter = false + IsBottomUp = 1, + HasReadyFilter = 0 }; RegReductionPQBase *SPQ; @@ -1602,8 +1602,8 @@ // scheduler. struct ilp_ls_rr_sort : public queue_sort { enum { - IsBottomUp = true, - HasReadyFilter = false + IsBottomUp = 1, + HasReadyFilter = 0 }; RegReductionPQBase *SPQ; Index: lib/CodeGen/SelectionDAG/SelectionDAG.cpp =================================================================== --- lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -5252,7 +5252,7 @@ FoldingSetNodeID ID; AddNodeIDNode(ID, ISD::STORE, VTs, Ops); ID.AddInteger(VT.getRawBits()); - ID.AddInteger(encodeMemSDNodeFlags(false, ISD::UNINDEXED, MMO->isVolatile(), + ID.AddInteger(encodeMemSDNodeFlags(0, ISD::UNINDEXED, MMO->isVolatile(), MMO->isNonTemporal(), MMO->isInvariant())); ID.AddInteger(MMO->getPointerInfo().getAddrSpace()); void *IP = nullptr; @@ -5322,7 +5322,7 @@ FoldingSetNodeID ID; AddNodeIDNode(ID, ISD::STORE, VTs, Ops); ID.AddInteger(SVT.getRawBits()); - ID.AddInteger(encodeMemSDNodeFlags(true, ISD::UNINDEXED, MMO->isVolatile(), + ID.AddInteger(encodeMemSDNodeFlags(1, ISD::UNINDEXED, MMO->isVolatile(), MMO->isNonTemporal(), MMO->isInvariant())); ID.AddInteger(MMO->getPointerInfo().getAddrSpace()); void *IP = nullptr; @@ -5405,7 +5405,7 @@ FoldingSetNodeID ID; AddNodeIDNode(ID, ISD::MSTORE, VTs, Ops); ID.AddInteger(VT.getRawBits()); - ID.AddInteger(encodeMemSDNodeFlags(false, ISD::UNINDEXED, MMO->isVolatile(), + ID.AddInteger(encodeMemSDNodeFlags(0, ISD::UNINDEXED, MMO->isVolatile(), MMO->isNonTemporal(), MMO->isInvariant())); ID.AddInteger(MMO->getPointerInfo().getAddrSpace()); void *IP = nullptr; @@ -5468,7 +5468,7 @@ FoldingSetNodeID ID; AddNodeIDNode(ID, ISD::MSCATTER, VTs, Ops); ID.AddInteger(VT.getRawBits()); - ID.AddInteger(encodeMemSDNodeFlags(false, ISD::UNINDEXED, MMO->isVolatile(), + ID.AddInteger(encodeMemSDNodeFlags(0, ISD::UNINDEXED, MMO->isVolatile(), MMO->isNonTemporal(), MMO->isInvariant())); ID.AddInteger(MMO->getPointerInfo().getAddrSpace()); Index: lib/CodeGen/SplitKit.h =================================================================== --- lib/CodeGen/SplitKit.h +++ lib/CodeGen/SplitKit.h @@ -295,7 +295,7 @@ /// Idx. RegAssignMap RegAssign; - typedef PointerIntPair ValueForcePair; + typedef PointerIntPair ValueForcePair; typedef DenseMap, ValueForcePair> ValueMap; /// Values - keep track of the mapping from parent values to values in the new Index: lib/ExecutionEngine/Interpreter/Execution.cpp =================================================================== --- lib/ExecutionEngine/Interpreter/Execution.cpp +++ lib/ExecutionEngine/Interpreter/Execution.cpp @@ -392,8 +392,8 @@ // in vector case mask out NaN elements if (Ty->isVectorTy()) for( size_t _i=0; _idump(); } -LLVMBool LLVMPrintModuleToFile(LLVMModuleRef M, const char *Filename, +bool LLVMPrintModuleToFile(LLVMModuleRef M, const char *Filename, char **ErrorMessage) { std::error_code EC; raw_fd_ostream dest(Filename, EC, sys::fs::F_Text); @@ -300,7 +300,7 @@ llvm_unreachable("Unhandled TypeID."); } -LLVMBool LLVMTypeIsSized(LLVMTypeRef Ty) +bool LLVMTypeIsSized(LLVMTypeRef Ty) { return unwrap(Ty)->isSized(); } @@ -435,7 +435,7 @@ return wrap(FunctionType::get(unwrap(ReturnType), Tys, IsVarArg != 0)); } -LLVMBool LLVMIsFunctionVarArg(LLVMTypeRef FunctionTy) { +bool LLVMIsFunctionVarArg(LLVMTypeRef FunctionTy) { return unwrap(FunctionTy)->isVarArg(); } @@ -503,11 +503,11 @@ return wrap(Ty->getTypeAtIndex(i)); } -LLVMBool LLVMIsPackedStruct(LLVMTypeRef StructTy) { +bool LLVMIsPackedStruct(LLVMTypeRef StructTy) { return unwrap(StructTy)->isPacked(); } -LLVMBool LLVMIsOpaqueStruct(LLVMTypeRef StructTy) { +bool LLVMIsOpaqueStruct(LLVMTypeRef StructTy) { return unwrap(StructTy)->isOpaque(); } @@ -610,7 +610,7 @@ unwrap(OldVal)->replaceAllUsesWith(unwrap(NewVal)); } -int LLVMHasMetadata(LLVMValueRef Inst) { +bool LLVMHasMetadata(LLVMValueRef Inst) { return unwrap(Inst)->hasMetadata(); } @@ -747,17 +747,17 @@ return wrap(UndefValue::get(unwrap(Ty))); } -LLVMBool LLVMIsConstant(LLVMValueRef Ty) { +bool LLVMIsConstant(LLVMValueRef Ty) { return isa(unwrap(Ty)); } -LLVMBool LLVMIsNull(LLVMValueRef Val) { +bool LLVMIsNull(LLVMValueRef Val) { if (Constant *C = dyn_cast(unwrap(Val))) return C->isNullValue(); return false; } -LLVMBool LLVMIsUndef(LLVMValueRef Val) { +bool LLVMIsUndef(LLVMValueRef Val) { return isa(unwrap(Val)); } @@ -920,12 +920,12 @@ Type *Ty = cFP->getType(); if (Ty->isFloatTy()) { - *LosesInfo = false; + *LosesInfo = 0; return cFP->getValueAPF().convertToFloat(); } if (Ty->isDoubleTy()) { - *LosesInfo = false; + *LosesInfo = 0; return cFP->getValueAPF().convertToDouble(); } @@ -957,7 +957,7 @@ return wrap(unwrap(C)->getElementAsConstant(idx)); } -LLVMBool LLVMIsConstantString(LLVMValueRef C) { +bool LLVMIsConstantString(LLVMValueRef C) { return unwrap(C)->isString(); } @@ -1384,7 +1384,7 @@ return wrap(unwrap(Global)->getParent()); } -LLVMBool LLVMIsDeclaration(LLVMValueRef Global) { +bool LLVMIsDeclaration(LLVMValueRef Global) { return unwrap(Global)->isDeclaration(); } @@ -1509,7 +1509,7 @@ static_cast(Class)); } -LLVMBool LLVMHasUnnamedAddr(LLVMValueRef Global) { +bool LLVMHasUnnamedAddr(LLVMValueRef Global) { return unwrap(Global)->hasUnnamedAddr(); } @@ -1617,7 +1617,7 @@ ->setInitializer(unwrap(ConstantVal)); } -LLVMBool LLVMIsThreadLocal(LLVMValueRef GlobalVar) { +bool LLVMIsThreadLocal(LLVMValueRef GlobalVar) { return unwrap(GlobalVar)->isThreadLocal(); } @@ -1625,7 +1625,7 @@ unwrap(GlobalVar)->setThreadLocal(IsThreadLocal != 0); } -LLVMBool LLVMIsGlobalConstant(LLVMValueRef GlobalVar) { +bool LLVMIsGlobalConstant(LLVMValueRef GlobalVar) { return unwrap(GlobalVar)->isConstant(); } @@ -1672,7 +1672,7 @@ } } -LLVMBool LLVMIsExternallyInitialized(LLVMValueRef GlobalVar) { +bool LLVMIsExternallyInitialized(LLVMValueRef GlobalVar) { return unwrap(GlobalVar)->isExternallyInitialized(); } @@ -1738,7 +1738,7 @@ unwrap(Fn)->eraseFromParent(); } -LLVMBool LLVMHasPersonalityFn(LLVMValueRef Fn) { +bool LLVMHasPersonalityFn(LLVMValueRef Fn) { return unwrap(Fn)->hasPersonalityFn(); } @@ -1908,7 +1908,7 @@ return wrap(static_cast(unwrap(BB))); } -LLVMBool LLVMValueIsBasicBlock(LLVMValueRef Val) { +bool LLVMValueIsBasicBlock(LLVMValueRef Val) { return isa(unwrap(Val)); } @@ -2140,7 +2140,7 @@ /*--.. Operations on call instructions (only) ..............................--*/ -LLVMBool LLVMIsTailCall(LLVMValueRef Call) { +bool LLVMIsTailCall(LLVMValueRef Call) { return unwrap(Call)->isTailCall(); } @@ -2182,7 +2182,7 @@ /*--.. Operations on branch instructions (only) ............................--*/ -LLVMBool LLVMIsConditional(LLVMValueRef Branch) { +bool LLVMIsConditional(LLVMValueRef Branch) { return unwrap(Branch)->isConditional(); } @@ -2208,7 +2208,7 @@ /*--.. Operations on gep instructions (only) ...............................--*/ -LLVMBool LLVMIsInBounds(LLVMValueRef GEP) { +bool LLVMIsInBounds(LLVMValueRef GEP) { return unwrap(GEP)->isInBounds(); } @@ -2414,7 +2414,7 @@ addClause(cast(unwrap(ClauseVal))); } -LLVMBool LLVMIsCleanup(LLVMValueRef LandingPad) { +bool LLVMIsCleanup(LLVMValueRef LandingPad) { return unwrap(LandingPad)->isCleanup(); } @@ -2697,7 +2697,7 @@ return wrap(unwrap(B)->CreateGlobalStringPtr(Str, Name)); } -LLVMBool LLVMGetVolatile(LLVMValueRef MemAccessInst) { +bool LLVMGetVolatile(LLVMValueRef MemAccessInst) { Value *P = unwrap(MemAccessInst); if (LoadInst *LI = dyn_cast(P)) return LI->isVolatile(); @@ -2961,7 +2961,7 @@ } -LLVMBool LLVMIsAtomicSingleThread(LLVMValueRef AtomicInst) { +bool LLVMIsAtomicSingleThread(LLVMValueRef AtomicInst) { Value *P = unwrap(AtomicInst); if (AtomicRMWInst *I = dyn_cast(P)) @@ -3097,19 +3097,19 @@ reinterpret_cast(P)); } -LLVMBool LLVMRunPassManager(LLVMPassManagerRef PM, LLVMModuleRef M) { +bool LLVMRunPassManager(LLVMPassManagerRef PM, LLVMModuleRef M) { return unwrap(PM)->run(*unwrap(M)); } -LLVMBool LLVMInitializeFunctionPassManager(LLVMPassManagerRef FPM) { +bool LLVMInitializeFunctionPassManager(LLVMPassManagerRef FPM) { return unwrap(FPM)->doInitialization(); } -LLVMBool LLVMRunFunctionPassManager(LLVMPassManagerRef FPM, LLVMValueRef F) { +bool LLVMRunFunctionPassManager(LLVMPassManagerRef FPM, LLVMValueRef F) { return unwrap(FPM)->run(*unwrap(F)); } -LLVMBool LLVMFinalizeFunctionPassManager(LLVMPassManagerRef FPM) { +bool LLVMFinalizeFunctionPassManager(LLVMPassManagerRef FPM) { return unwrap(FPM)->doFinalization(); } @@ -3126,6 +3126,6 @@ void LLVMStopMultithreaded() { } -LLVMBool LLVMIsMultithreaded() { +bool LLVMIsMultithreaded() { return llvm_is_multithreaded(); } Index: lib/Lex/PPMacroExpansion.cpp =================================================================== --- lib/Lex/PPMacroExpansion.cpp +++ lib/Lex/PPMacroExpansion.cpp @@ -1725,7 +1725,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. @@ -1767,14 +1767,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/MC/MCContext.cpp =================================================================== --- lib/MC/MCContext.cpp +++ lib/MC/MCContext.cpp @@ -311,7 +311,7 @@ return new (ELFAllocator.Allocate()) MCSectionELF(I->getKey(), Type, Flags, SectionKind::getReadOnly(), - EntrySize, Group, true, nullptr, Associated); + EntrySize, Group, 1, nullptr, Associated); } MCSectionELF *MCContext::getELFSection(StringRef Section, unsigned Type, Index: lib/MC/MCDisassembler/Disassembler.cpp =================================================================== --- lib/MC/MCDisassembler/Disassembler.cpp +++ lib/MC/MCDisassembler/Disassembler.cpp @@ -286,7 +286,7 @@ // LLVMSetDisasmOptions() sets the disassembler's options. It returns 1 if it // can set all the Options and 0 otherwise. // -int LLVMSetDisasmOptions(LLVMDisasmContextRef DCR, uint64_t Options){ +bool LLVMSetDisasmOptions(LLVMDisasmContextRef DCR, uint64_t Options){ if (Options & LLVMDisassembler_Option_UseMarkup){ LLVMDisasmContext *DC = (LLVMDisasmContext *)DCR; MCInstPrinter *IP = DC->getIP(); Index: lib/MC/MCDisassembler/MCExternalSymbolizer.cpp =================================================================== --- lib/MC/MCDisassembler/MCExternalSymbolizer.cpp +++ lib/MC/MCDisassembler/MCExternalSymbolizer.cpp @@ -70,7 +70,7 @@ &ReferenceName); if (Name) { SymbolicOp.AddSymbol.Name = Name; - SymbolicOp.AddSymbol.Present = true; + SymbolicOp.AddSymbol.Present = 1; // If Name is a C++ symbol name put the human readable name in a comment. if(ReferenceType == LLVMDisassembler_ReferenceType_DeMangled_Name) cStream << ReferenceName; Index: lib/Object/MachOObjectFile.cpp =================================================================== --- lib/Object/MachOObjectFile.cpp +++ lib/Object/MachOObjectFile.cpp @@ -2000,7 +2000,7 @@ return getPlainRelocationAddress(RE); } -unsigned MachOObjectFile::getAnyRelocationPCRel( +bool MachOObjectFile::getAnyRelocationPCRel( const MachO::any_relocation_info &RE) const { if (isRelocationScattered(RE)) return getScatteredRelocationPCRel(this, RE); Index: lib/Object/Object.cpp =================================================================== --- lib/Object/Object.cpp +++ lib/Object/Object.cpp @@ -156,7 +156,7 @@ return (*unwrap(SI))->getAddress(); } -LLVMBool LLVMGetSectionContainsSymbol(LLVMSectionIteratorRef SI, +bool LLVMGetSectionContainsSymbol(LLVMSectionIteratorRef SI, LLVMSymbolIteratorRef Sym) { return (*unwrap(SI))->containsSymbol(**unwrap(Sym)); } Index: lib/Sema/Sema.cpp =================================================================== --- lib/Sema/Sema.cpp +++ lib/Sema/Sema.cpp @@ -18,7 +18,7 @@ #include "clang/AST/DeclCXX.h" #include "clang/AST/DeclFriend.h" #include "clang/AST/DeclObjC.h" -#include "clang/AST/Expr.h" +#include "clang/AST/Expr.h"` #include "clang/AST/ExprCXX.h" #include "clang/AST/StmtCXX.h" #include "clang/Basic/DiagnosticOptions.h" @@ -794,7 +794,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 @@ -4736,7 +4736,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)); @@ -4747,7 +4747,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)); @@ -5328,7 +5328,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), @@ -5337,7 +5337,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/SemaDecl.cpp =================================================================== --- lib/Sema/SemaDecl.cpp +++ lib/Sema/SemaDecl.cpp @@ -10870,7 +10870,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 @@ -4889,7 +4889,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 @@ -1623,7 +1623,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 @@ -4504,7 +4504,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); } @@ -4769,7 +4769,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/Serialization/ASTReader.cpp =================================================================== --- lib/Serialization/ASTReader.cpp +++ lib/Serialization/ASTReader.cpp @@ -5453,7 +5453,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/ASTWriter.cpp =================================================================== --- lib/Serialization/ASTWriter.cpp +++ lib/Serialization/ASTWriter.cpp @@ -4703,12 +4703,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/Support/APInt.cpp =================================================================== --- lib/Support/APInt.cpp +++ lib/Support/APInt.cpp @@ -2375,7 +2375,7 @@ } /* Extract the given bit of a bignum; returns 0 or 1. */ -int +bool APInt::tcExtractBit(const integerPart *parts, unsigned int bit) { return (parts[bit / integerPartWidth] & @@ -2691,7 +2691,7 @@ use by the routine; its contents need not be initialized and are destroyed. LHS, REMAINDER and SCRATCH must be distinct. */ -int +bool APInt::tcDivide(integerPart *lhs, const integerPart *rhs, integerPart *remainder, integerPart *srhs, unsigned int parts) @@ -2865,7 +2865,7 @@ } /* Increment a bignum in-place, return the carry flag. */ -integerPart +bool APInt::tcIncrement(integerPart *dst, unsigned int parts) { unsigned int i; Index: lib/Support/DynamicLibrary.cpp =================================================================== --- lib/Support/DynamicLibrary.cpp +++ lib/Support/DynamicLibrary.cpp @@ -175,7 +175,7 @@ // C API. //===----------------------------------------------------------------------===// -LLVMBool LLVMLoadLibraryPermanently(const char* Filename) { +bool LLVMLoadLibraryPermanently(const char* Filename) { return llvm::sys::DynamicLibrary::LoadLibraryPermanently(Filename); } Index: lib/Target/AArch64/AArch64ISelDAGToDAG.cpp =================================================================== --- lib/Target/AArch64/AArch64ISelDAGToDAG.cpp +++ lib/Target/AArch64/AArch64ISelDAGToDAG.cpp @@ -834,7 +834,7 @@ if (IsExtendedRegisterWorthFolding && RHS.getOpcode() == ISD::SHL && SelectExtendedSHL(RHS, Size, true, Offset, SignExtend)) { Base = LHS; - DoShift = CurDAG->getTargetConstant(true, dl, MVT::i32); + DoShift = CurDAG->getTargetConstant(1, dl, MVT::i32); return true; } @@ -842,12 +842,12 @@ if (IsExtendedRegisterWorthFolding && LHS.getOpcode() == ISD::SHL && SelectExtendedSHL(LHS, Size, true, Offset, SignExtend)) { Base = RHS; - DoShift = CurDAG->getTargetConstant(true, dl, MVT::i32); + DoShift = CurDAG->getTargetConstant(1, dl, MVT::i32); return true; } // There was no shift, whatever else we find. - DoShift = CurDAG->getTargetConstant(false, dl, MVT::i32); + DoShift = CurDAG->getTargetConstant(0, dl, MVT::i32); AArch64_AM::ShiftExtendType Ext = AArch64_AM::InvalidShiftExtend; // Try to match an unshifted extend on the LHS. @@ -947,7 +947,7 @@ if (IsExtendedRegisterWorthFolding && RHS.getOpcode() == ISD::SHL && SelectExtendedSHL(RHS, Size, false, Offset, SignExtend)) { Base = LHS; - DoShift = CurDAG->getTargetConstant(true, DL, MVT::i32); + DoShift = CurDAG->getTargetConstant(1, DL, MVT::i32); return true; } @@ -955,15 +955,15 @@ if (IsExtendedRegisterWorthFolding && LHS.getOpcode() == ISD::SHL && SelectExtendedSHL(LHS, Size, false, Offset, SignExtend)) { Base = RHS; - DoShift = CurDAG->getTargetConstant(true, DL, MVT::i32); + DoShift = CurDAG->getTargetConstant(1, DL, MVT::i32); return true; } // Match any non-shifted, non-extend, non-immediate add expression. Base = LHS; Offset = RHS; - SignExtend = CurDAG->getTargetConstant(false, DL, MVT::i32); - DoShift = CurDAG->getTargetConstant(false, DL, MVT::i32); + SignExtend = CurDAG->getTargetConstant(0, DL, MVT::i32); + DoShift = CurDAG->getTargetConstant(0, DL, MVT::i32); // Reg1 + Reg2 is free: no check needed. return true; } Index: lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp =================================================================== --- lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp +++ lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp @@ -418,7 +418,7 @@ } } -static unsigned isMatchingStore(MachineInstr *LoadInst, +static bool isMatchingStore(MachineInstr *LoadInst, MachineInstr *StoreInst) { unsigned LdOpc = LoadInst->getOpcode(); unsigned StOpc = StoreInst->getOpcode(); Index: lib/Target/AArch64/Disassembler/AArch64ExternalSymbolizer.cpp =================================================================== --- lib/Target/AArch64/Disassembler/AArch64ExternalSymbolizer.cpp +++ lib/Target/AArch64/Disassembler/AArch64ExternalSymbolizer.cpp @@ -78,7 +78,7 @@ Address, &ReferenceName); if (Name) { SymbolicOp.AddSymbol.Name = Name; - SymbolicOp.AddSymbol.Present = true; + SymbolicOp.AddSymbol.Present = 1; SymbolicOp.Value = 0; } else { SymbolicOp.Value = Address + Value; Index: lib/Target/AMDGPU/AMDILCFGStructurizer.cpp =================================================================== --- lib/Target/AMDGPU/AMDILCFGStructurizer.cpp +++ lib/Target/AMDGPU/AMDILCFGStructurizer.cpp @@ -509,7 +509,7 @@ MachineInstr *NewMI = MF->CreateMachineInstr(TII->get(NewOpcode), DL); MBB->insert(I, NewMI); MachineInstrBuilder MIB(*MF, NewMI); - MIB.addReg(OldMI->getOperand(1).getReg(), false); + MIB.addReg(OldMI->getOperand(1).getReg(), 0); SHOWNEWINSTR(NewMI); //erase later oldInstr->eraseFromParent(); } @@ -521,7 +521,7 @@ MachineInstr *NewInstr = MF->CreateMachineInstr(TII->get(NewOpcode), DL); //insert before blk->insert(I, NewInstr); - MachineInstrBuilder(*MF, NewInstr).addReg(RegNum, false); + MachineInstrBuilder(*MF, NewInstr).addReg(RegNum, 0); SHOWNEWINSTR(NewInstr); } @@ -531,7 +531,7 @@ MachineInstr *NewInstr = MF->CreateMachineInstr(TII->get(NewOpcode), DebugLoc()); MBB->push_back(NewInstr); - MachineInstrBuilder(*MF, NewInstr).addReg(RegNum, false); + MachineInstrBuilder(*MF, NewInstr).addReg(RegNum, 0); SHOWNEWINSTR(NewInstr); } Index: lib/Target/AMDGPU/R600InstrInfo.cpp =================================================================== --- lib/Target/AMDGPU/R600InstrInfo.cpp +++ lib/Target/AMDGPU/R600InstrInfo.cpp @@ -459,7 +459,7 @@ Swz[i] != R600InstrInfo::ALU_VEC_021_SCL_122) { // The value from output queue A (denoted by register OQAP) can // only be fetched during the first cycle. - return false; + return 0; } // OQAP does not count towards the normal read port restrictions continue; Index: lib/Target/AMDGPU/SIMachineScheduler.cpp =================================================================== --- lib/Target/AMDGPU/SIMachineScheduler.cpp +++ lib/Target/AMDGPU/SIMachineScheduler.cpp @@ -670,7 +670,7 @@ for (unsigned i = 0, e = DAGSize; i != e; ++i) { SUnit *SU = &DAG->SUnits[i]; if (DAG->IsHighLatencySU[SU->NodeNum]) { - unsigned CompatibleGroup = true; + unsigned CompatibleGroup = 1; unsigned ProposedColor = Color; for (unsigned j : FormingGroup) { // TODO: Currently CompatibleGroup will always be false, @@ -682,7 +682,7 @@ // this can be fixed. if (!DAG->canAddEdge(SU, &DAG->SUnits[j]) || !DAG->canAddEdge(&DAG->SUnits[j], SU)) - CompatibleGroup = false; + CompatibleGroup = 0; } if (!CompatibleGroup || ++Count == GroupSize) { FormingGroup.clear(); Index: lib/Target/ARM/ARMBaseInstrInfo.h =================================================================== --- lib/Target/ARM/ARMBaseInstrInfo.h +++ lib/Target/ARM/ARMBaseInstrInfo.h @@ -162,9 +162,9 @@ int &FrameIndex) const override; unsigned isStoreToStackSlot(const MachineInstr *MI, int &FrameIndex) const override; - unsigned isLoadFromStackSlotPostFE(const MachineInstr *MI, + bool isLoadFromStackSlotPostFE(const MachineInstr *MI, int &FrameIndex) const override; - unsigned isStoreToStackSlotPostFE(const MachineInstr *MI, + bool isStoreToStackSlotPostFE(const MachineInstr *MI, int &FrameIndex) const override; void copyToCPSR(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, Index: lib/Target/ARM/ARMBaseInstrInfo.cpp =================================================================== --- lib/Target/ARM/ARMBaseInstrInfo.cpp +++ lib/Target/ARM/ARMBaseInstrInfo.cpp @@ -1026,7 +1026,7 @@ return 0; } -unsigned ARMBaseInstrInfo::isStoreToStackSlotPostFE(const MachineInstr *MI, +bool ARMBaseInstrInfo::isStoreToStackSlotPostFE(const MachineInstr *MI, int &FrameIndex) const { const MachineMemOperand *Dummy; return MI->mayStore() && hasStoreToStackSlot(MI, Dummy, FrameIndex); @@ -1214,7 +1214,7 @@ return 0; } -unsigned ARMBaseInstrInfo::isLoadFromStackSlotPostFE(const MachineInstr *MI, +bool ARMBaseInstrInfo::isLoadFromStackSlotPostFE(const MachineInstr *MI, int &FrameIndex) const { const MachineMemOperand *Dummy; return MI->mayLoad() && hasLoadFromStackSlot(MI, Dummy, FrameIndex); Index: lib/Target/ARM/ARMConstantIslandPass.cpp =================================================================== --- lib/Target/ARM/ARMConstantIslandPass.cpp +++ lib/Target/ARM/ARMConstantIslandPass.cpp @@ -1640,14 +1640,14 @@ /// removeUnusedCPEntries - Remove constant pool entries whose refcounts /// are zero. bool ARMConstantIslands::removeUnusedCPEntries() { - unsigned MadeChange = false; + unsigned MadeChange = 0; for (unsigned i = 0, e = CPEntries.size(); i != e; ++i) { std::vector &CPEs = CPEntries[i]; for (unsigned j = 0, ee = CPEs.size(); j != ee; ++j) { if (CPEs[j].RefCount == 0 && CPEs[j].CPEMI) { removeDeadCPEMI(CPEs[j].CPEMI); CPEs[j].CPEMI = nullptr; - MadeChange = true; + MadeChange = 1; } } } Index: lib/Target/ARM/ARMFastISel.cpp =================================================================== --- lib/Target/ARM/ARMFastISel.cpp +++ lib/Target/ARM/ARMFastISel.cpp @@ -485,7 +485,7 @@ } // Require VFP2 for loading fp constants. - if (!Subtarget->hasVFP2()) return false; + if (!Subtarget->hasVFP2()) return 0; // MachineConstantPool wants an explicit alignment. unsigned Align = DL.getPrefTypeAlignment(CFP->getType()); Index: lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp =================================================================== --- lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp +++ lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp @@ -266,7 +266,7 @@ const MCSubtargetInfo &STI) const; /// getCCOutOpValue - Return encoding of the 's' bit. - unsigned getCCOutOpValue(const MCInst &MI, unsigned Op, + bool getCCOutOpValue(const MCInst &MI, unsigned Op, SmallVectorImpl &Fixups, const MCSubtargetInfo &STI) const { // The operand is either reg0 or CPSR. The 's' bit is encoded as '0' or Index: lib/Target/Hexagon/HexagonOptAddrMode.cpp =================================================================== --- lib/Target/Hexagon/HexagonOptAddrMode.cpp +++ lib/Target/Hexagon/HexagonOptAddrMode.cpp @@ -526,7 +526,7 @@ unsigned UseMOnum) { const MachineOperand ImmOp = TfrMI->getOperand(1); const MCInstrDesc &MID = UseMI->getDesc(); - unsigned Changed = false; + unsigned Changed = 0; if (MID.mayLoad()) Changed = changeLoad(UseMI, ImmOp, UseMOnum); else if (MID.mayStore()) Index: lib/Target/Hexagon/MCTargetDesc/HexagonMCCompound.cpp =================================================================== --- lib/Target/Hexagon/MCTargetDesc/HexagonMCCompound.cpp +++ lib/Target/Hexagon/MCTargetDesc/HexagonMCCompound.cpp @@ -96,7 +96,7 @@ case Hexagon::C2_cmpgt: case Hexagon::C2_cmpgtu: if (IsExtended) - return false; + return 0; DstReg = MI.getOperand(0).getReg(); Src1Reg = MI.getOperand(1).getReg(); Src2Reg = MI.getOperand(2).getReg(); @@ -109,7 +109,7 @@ case Hexagon::C2_cmpgti: case Hexagon::C2_cmpgtui: if (IsExtended) - return false; + return 0; // P0 = cmp.eq(Rs,#u2) DstReg = MI.getOperand(0).getReg(); SrcReg = MI.getOperand(1).getReg(); @@ -121,7 +121,7 @@ break; case Hexagon::A2_tfr: if (IsExtended) - return false; + return 0; // Rd = Rs DstReg = MI.getOperand(0).getReg(); SrcReg = MI.getOperand(1).getReg(); @@ -131,7 +131,7 @@ break; case Hexagon::A2_tfrsi: if (IsExtended) - return false; + return 0; // Rd = #u6 DstReg = MI.getOperand(0).getReg(); if (HexagonMCInstrInfo::minConstant(MI, 1) <= 63 && @@ -141,7 +141,7 @@ break; case Hexagon::S2_tstbit_i: if (IsExtended) - return false; + return 0; DstReg = MI.getOperand(0).getReg(); Src1Reg = MI.getOperand(1).getReg(); if ((Hexagon::P0 == DstReg || Hexagon::P1 == DstReg) && Index: lib/Target/Mips/MipsConstantIslandPass.cpp =================================================================== --- lib/Target/Mips/MipsConstantIslandPass.cpp +++ lib/Target/Mips/MipsConstantIslandPass.cpp @@ -1468,14 +1468,14 @@ /// removeUnusedCPEntries - Remove constant pool entries whose refcounts /// are zero. bool MipsConstantIslands::removeUnusedCPEntries() { - unsigned MadeChange = false; + unsigned MadeChange = 0; for (unsigned i = 0, e = CPEntries.size(); i != e; ++i) { std::vector &CPEs = CPEntries[i]; for (unsigned j = 0, ee = CPEs.size(); j != ee; ++j) { if (CPEs[j].RefCount == 0 && CPEs[j].CPEMI) { removeDeadCPEMI(CPEs[j].CPEMI); CPEs[j].CPEMI = nullptr; - MadeChange = true; + MadeChange = 1; } } } Index: lib/Target/PowerPC/MCTargetDesc/PPCMachObjectWriter.cpp =================================================================== --- lib/Target/PowerPC/MCTargetDesc/PPCMachObjectWriter.cpp +++ lib/Target/PowerPC/MCTargetDesc/PPCMachObjectWriter.cpp @@ -370,7 +370,7 @@ // struct relocation_info (8 bytes) MachO::any_relocation_info MRE; - makeRelocationInfo(MRE, FixupOffset, Index, IsPCRel, Log2Size, false, Type); + makeRelocationInfo(MRE, FixupOffset, Index, IsPCRel, Log2Size, 0, Type); Writer->addRelocation(RelSymbol, Fragment->getParent(), MRE); } Index: lib/Target/TargetMachineC.cpp =================================================================== --- lib/Target/TargetMachineC.cpp +++ lib/Target/TargetMachineC.cpp @@ -89,15 +89,15 @@ return unwrap(T)->getShortDescription(); } -LLVMBool LLVMTargetHasJIT(LLVMTargetRef T) { +bool LLVMTargetHasJIT(LLVMTargetRef T) { return unwrap(T)->hasJIT(); } -LLVMBool LLVMTargetHasTargetMachine(LLVMTargetRef T) { +bool LLVMTargetHasTargetMachine(LLVMTargetRef T) { return unwrap(T)->hasTargetMachine(); } -LLVMBool LLVMTargetHasAsmBackend(LLVMTargetRef T) { +bool LLVMTargetHasAsmBackend(LLVMTargetRef T) { return unwrap(T)->hasMCAsmBackend(); } @@ -174,7 +174,7 @@ return wrap(new DataLayout(unwrap(T)->createDataLayout())); } -static LLVMBool LLVMTargetMachineEmit(LLVMTargetMachineRef T, LLVMModuleRef M, +static bool LLVMTargetMachineEmit(LLVMTargetMachineRef T, LLVMModuleRef M, raw_pwrite_stream &OS, LLVMCodeGenFileType codegen, char **ErrorMessage) { @@ -208,7 +208,7 @@ return false; } -LLVMBool LLVMTargetMachineEmitToFile(LLVMTargetMachineRef T, LLVMModuleRef M, +bool LLVMTargetMachineEmitToFile(LLVMTargetMachineRef T, LLVMModuleRef M, char* Filename, LLVMCodeGenFileType codegen, char** ErrorMessage) { std::error_code EC; raw_fd_ostream dest(Filename, EC, sys::fs::F_None); @@ -221,7 +221,7 @@ return Result; } -LLVMBool LLVMTargetMachineEmitToMemoryBuffer(LLVMTargetMachineRef T, +bool LLVMTargetMachineEmitToMemoryBuffer(LLVMTargetMachineRef T, LLVMModuleRef M, LLVMCodeGenFileType codegen, char** ErrorMessage, LLVMMemoryBufferRef *OutMemBuf) { SmallString<0> CodeString; Index: lib/Target/X86/Disassembler/X86DisassemblerDecoder.cpp =================================================================== --- lib/Target/X86/Disassembler/X86DisassemblerDecoder.cpp +++ lib/Target/X86/Disassembler/X86DisassemblerDecoder.cpp @@ -76,7 +76,7 @@ * ModR/M extensions and escapes. * @return - true if the ModR/M byte is required, false otherwise. */ -static int modRMRequired(OpcodeType type, +static bool modRMRequired(OpcodeType type, InstructionContext insnContext, uint16_t opcode) { const struct ContextDecision* decision = nullptr; Index: lib/Target/X86/X86FrameLowering.cpp =================================================================== --- lib/Target/X86/X86FrameLowering.cpp +++ lib/Target/X86/X86FrameLowering.cpp @@ -2694,7 +2694,7 @@ if (UsedReg == FramePtr) { // ADD $offset, %ebp - unsigned ADDri = getADDriOpcode(false, EndOffset); + unsigned ADDri = getADDriOpcode(0, EndOffset); BuildMI(MBB, MBBI, DL, TII.get(ADDri), FramePtr) .addReg(FramePtr) .addImm(EndOffset) Index: lib/Transforms/IPO/MergeFunctions.cpp =================================================================== --- lib/Transforms/IPO/MergeFunctions.cpp +++ lib/Transforms/IPO/MergeFunctions.cpp @@ -144,7 +144,7 @@ /// few symbols without a name. class GlobalNumberState { struct Config : ValueMapConfig { - enum { FollowRAUW = false }; + enum { FollowRAUW = 0 }; }; // Each GlobalValue is mapped to an identifier. The Config ensures when RAUW // occurs, the mapping does not change. Tracking changes is unnecessary, and Index: lib/Transforms/Scalar/GVN.cpp =================================================================== --- lib/Transforms/Scalar/GVN.cpp +++ lib/Transforms/Scalar/GVN.cpp @@ -1429,9 +1429,9 @@ MapVector PredLoads; DenseMap FullyAvailableBlocks; for (const AvailableValueInBlock &AV : ValuesPerBlock) - FullyAvailableBlocks[AV.BB] = true; + FullyAvailableBlocks[AV.BB] = 1; for (BasicBlock *UnavailableBB : UnavailableBlocks) - FullyAvailableBlocks[UnavailableBB] = false; + FullyAvailableBlocks[UnavailableBB] = 0; SmallVector CriticalEdgePred; for (BasicBlock *Pred : predecessors(LoadBB)) { Index: lib/Transforms/Scalar/LoopInstSimplify.cpp =================================================================== --- lib/Transforms/Scalar/LoopInstSimplify.cpp +++ lib/Transforms/Scalar/LoopInstSimplify.cpp @@ -97,7 +97,7 @@ VisitStack.clear(); Visited.clear(); - VisitStack.push_back(WorklistItem(L->getHeader(), false)); + VisitStack.push_back(WorklistItem(L->getHeader(), 0)); while (!VisitStack.empty()) { WorklistItem Item = VisitStack.pop_back_val(); @@ -153,7 +153,7 @@ const Loop *SuccLoop = LI->getLoopFor(SuccBB); if (SuccLoop && SuccLoop->getHeader() == SuccBB && L->contains(SuccLoop)) { - VisitStack.push_back(WorklistItem(SuccBB, true)); + VisitStack.push_back(WorklistItem(SuccBB, 1)); SmallVector SubLoopExitBlocks; SuccLoop->getExitBlocks(SubLoopExitBlocks); @@ -161,7 +161,7 @@ for (unsigned i = 0; i < SubLoopExitBlocks.size(); ++i) { BasicBlock *ExitBB = SubLoopExitBlocks[i]; if (LI->getLoopFor(ExitBB) == L && Visited.insert(ExitBB).second) - VisitStack.push_back(WorklistItem(ExitBB, false)); + VisitStack.push_back(WorklistItem(ExitBB, 0)); } continue; @@ -172,7 +172,7 @@ if (IsExitBlock) continue; - VisitStack.push_back(WorklistItem(SuccBB, false)); + VisitStack.push_back(WorklistItem(SuccBB, 0)); } } Index: lib/Transforms/Scalar/LoopUnrollPass.cpp =================================================================== --- lib/Transforms/Scalar/LoopUnrollPass.cpp +++ lib/Transforms/Scalar/LoopUnrollPass.cpp @@ -433,7 +433,7 @@ bool IsFree = Analyzer.visit(I); bool Inserted = InstCostMap.insert({&I, (int)Iteration, (unsigned)IsFree, - /*IsCounted*/ false}).second; + /*IsCounted*/ 0}).second; (void)Inserted; assert(Inserted && "Cannot have a state for an unvisited instruction!"); Index: tools/libclang/CIndex.cpp =================================================================== --- tools/libclang/CIndex.cpp +++ tools/libclang/CIndex.cpp @@ -3352,7 +3352,7 @@ return nullptr; } -unsigned clang_Cursor_isMacroFunctionLike(CXCursor C) { +bool clang_Cursor_isMacroFunctionLike(CXCursor C) { const IdentifierInfo *II = getMacroIdentifier(C); if (!II) { return false; @@ -3364,7 +3364,7 @@ return false; } -unsigned clang_Cursor_isMacroBuiltin(CXCursor C) { +bool clang_Cursor_isMacroBuiltin(CXCursor C) { const IdentifierInfo *II = getMacroIdentifier(C); if (!II) { return false; @@ -3376,7 +3376,7 @@ return false; } -unsigned clang_Cursor_isFunctionInlined(CXCursor C) { +bool clang_Cursor_isFunctionInlined(CXCursor C) { const Decl *D = getCursorDecl(C); const FunctionDecl *FD = dyn_cast_or_null(D); if (!FD) { @@ -3885,7 +3885,7 @@ return 0; } -int clang_File_isEqual(CXFile file1, CXFile file2) { +bool clang_File_isEqual(CXFile file1, CXFile file2) { if (file1 == file2) return true; @@ -3973,7 +3973,7 @@ extern "C" { -unsigned clang_visitChildren(CXCursor parent, +bool clang_visitChildren(CXCursor parent, CXCursorVisitor visitor, CXClientData client_data) { CursorVisitor CursorVis(getCursorTU(parent), visitor, client_data, @@ -5000,7 +5000,7 @@ return MakeCXCursorInvalid(CXCursor_InvalidFile); } -unsigned clang_equalCursors(CXCursor X, CXCursor Y) { +bool clang_equalCursors(CXCursor X, CXCursor Y) { // Clear out the "FirstInDeclGroup" part in a declaration cursor, since we // can't set consistently. For example, when visiting a DeclStmt we will set // it but we don't set it on the result of clang_getCursorDefinition for @@ -5025,40 +5025,40 @@ std::make_pair(C.kind, C.data[Index])); } -unsigned clang_isInvalid(enum CXCursorKind K) { +bool clang_isInvalid(enum CXCursorKind K) { return K >= CXCursor_FirstInvalid && K <= CXCursor_LastInvalid; } -unsigned clang_isDeclaration(enum CXCursorKind K) { +bool clang_isDeclaration(enum CXCursorKind K) { return (K >= CXCursor_FirstDecl && K <= CXCursor_LastDecl) || (K >= CXCursor_FirstExtraDecl && K <= CXCursor_LastExtraDecl); } -unsigned clang_isReference(enum CXCursorKind K) { +bool clang_isReference(enum CXCursorKind K) { return K >= CXCursor_FirstRef && K <= CXCursor_LastRef; } -unsigned clang_isExpression(enum CXCursorKind K) { +bool clang_isExpression(enum CXCursorKind K) { return K >= CXCursor_FirstExpr && K <= CXCursor_LastExpr; } -unsigned clang_isStatement(enum CXCursorKind K) { +bool clang_isStatement(enum CXCursorKind K) { return K >= CXCursor_FirstStmt && K <= CXCursor_LastStmt; } -unsigned clang_isAttribute(enum CXCursorKind K) { +bool clang_isAttribute(enum CXCursorKind K) { return K >= CXCursor_FirstAttr && K <= CXCursor_LastAttr; } -unsigned clang_isTranslationUnit(enum CXCursorKind K) { +bool clang_isTranslationUnit(enum CXCursorKind K) { return K == CXCursor_TranslationUnit; } -unsigned clang_isPreprocessing(enum CXCursorKind K) { +bool clang_isPreprocessing(enum CXCursorKind K) { return K >= CXCursor_FirstPreprocessing && K <= CXCursor_LastPreprocessing; } -unsigned clang_isUnexposed(enum CXCursorKind K) { +bool clang_isUnexposed(enum CXCursorKind K) { switch (K) { case CXCursor_UnexposedDecl: case CXCursor_UnexposedExpr: Index: tools/libclang/CXComment.cpp =================================================================== --- tools/libclang/CXComment.cpp +++ tools/libclang/CXComment.cpp @@ -106,7 +106,7 @@ return createCXComment(*(C->child_begin() + ChildIdx), CXC.TranslationUnit); } -unsigned clang_Comment_isWhitespace(CXComment CXC) { +bool clang_Comment_isWhitespace(CXComment CXC) { const Comment *C = getASTNode(CXC); if (!C) return false; @@ -120,7 +120,7 @@ return false; } -unsigned clang_InlineContentComment_hasTrailingNewline(CXComment CXC) { +bool clang_InlineContentComment_hasTrailingNewline(CXComment CXC) { const InlineContentComment *ICC = getASTNodeAs(CXC); if (!ICC) return false; @@ -192,7 +192,7 @@ return cxstring::createRef(HTC->getTagName()); } -unsigned clang_HTMLStartTagComment_isSelfClosing(CXComment CXC) { +bool clang_HTMLStartTagComment_isSelfClosing(CXComment CXC) { const HTMLStartTagComment *HST = getASTNodeAs(CXC); if (!HST) return false; @@ -266,7 +266,7 @@ return cxstring::createRef(PCC->getParamNameAsWritten()); } -unsigned clang_ParamCommandComment_isParamIndexValid(CXComment CXC) { +bool clang_ParamCommandComment_isParamIndexValid(CXComment CXC) { const ParamCommandComment *PCC = getASTNodeAs(CXC); if (!PCC) return false; @@ -282,7 +282,7 @@ return PCC->getParamIndex(); } -unsigned clang_ParamCommandComment_isDirectionExplicit(CXComment CXC) { +bool clang_ParamCommandComment_isDirectionExplicit(CXComment CXC) { const ParamCommandComment *PCC = getASTNodeAs(CXC); if (!PCC) return false; @@ -317,7 +317,7 @@ return cxstring::createRef(TPCC->getParamNameAsWritten()); } -unsigned clang_TParamCommandComment_isParamPositionValid(CXComment CXC) { +bool clang_TParamCommandComment_isParamPositionValid(CXComment CXC) { const TParamCommandComment *TPCC = getASTNodeAs(CXC); if (!TPCC) return false; 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/CXSourceLocation.cpp =================================================================== --- tools/libclang/CXSourceLocation.cpp +++ tools/libclang/CXSourceLocation.cpp @@ -45,7 +45,7 @@ return Result; } -unsigned clang_equalLocations(CXSourceLocation loc1, CXSourceLocation loc2) { +bool clang_equalLocations(CXSourceLocation loc1, CXSourceLocation loc2) { return (loc1.ptr_data[0] == loc2.ptr_data[0] && loc1.ptr_data[1] == loc2.ptr_data[1] && loc1.int_data == loc2.int_data); @@ -74,7 +74,7 @@ return Result; } -unsigned clang_equalRanges(CXSourceRange range1, CXSourceRange range2) { +bool clang_equalRanges(CXSourceRange range1, CXSourceRange range2) { return range1.ptr_data[0] == range2.ptr_data[0] && range1.ptr_data[1] == range2.ptr_data[1] && range1.begin_int_data == range2.begin_int_data Index: tools/libclang/CXType.cpp =================================================================== --- tools/libclang/CXType.cpp +++ tools/libclang/CXType.cpp @@ -333,17 +333,17 @@ TU); } -unsigned clang_isConstQualifiedType(CXType CT) { +bool clang_isConstQualifiedType(CXType CT) { QualType T = GetQualType(CT); return T.isLocalConstQualified(); } -unsigned clang_isVolatileQualifiedType(CXType CT) { +bool clang_isVolatileQualifiedType(CXType CT) { QualType T = GetQualType(CT); return T.isLocalVolatileQualified(); } -unsigned clang_isRestrictQualifiedType(CXType CT) { +bool clang_isRestrictQualifiedType(CXType CT) { QualType T = GetQualType(CT); return T.isLocalRestrictQualified(); } @@ -500,7 +500,7 @@ return cxstring::createRef(s); } -unsigned clang_equalTypes(CXType A, CXType B) { +bool clang_equalTypes(CXType A, CXType B) { return A.data[0] == B.data[0] && A.data[1] == B.data[1]; } @@ -954,7 +954,7 @@ return MakeCXType(A.getAsType(), GetTU(CT)); } -unsigned clang_Type_visitFields(CXType PT, +bool clang_Type_visitFields(CXType PT, CXFieldVisitor visitor, CXClientData client_data){ CXCursor PC = clang_getTypeDeclaration(PT); Index: tools/libclang/Indexing.cpp =================================================================== --- tools/libclang/Indexing.cpp +++ tools/libclang/Indexing.cpp @@ -688,7 +688,7 @@ extern "C" { -int clang_index_isEntityObjCContainerKind(CXIdxEntityKind K) { +bool clang_index_isEntityObjCContainerKind(CXIdxEntityKind K) { return CXIdxEntity_ObjCClass <= K && K <= CXIdxEntity_ObjCCategory; } Index: tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp =================================================================== --- tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp +++ tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp @@ -766,7 +766,7 @@ CurStreamTypeType CurStreamType; if (openBitcodeFile(InputFilename, StreamBuffer, StreamFile, Stream, CurStreamType)) - return true; + return 1; // Read block info from BlockInfoFilename, if specified. // The block info must be a top-level block. @@ -777,7 +777,7 @@ CurStreamTypeType BlockInfoStreamType; if (openBitcodeFile(BlockInfoFilename, BlockInfoBuffer, BlockInfoFile, BlockInfoCursor, BlockInfoStreamType)) - return true; + return 1; while (!BlockInfoCursor.AtEndOfStream()) { unsigned Code = BlockInfoCursor.ReadCode(); @@ -808,7 +808,7 @@ unsigned BlockID = Stream.ReadSubBlockID(); if (ParseBlock(Stream, BlockID, 0, CurStreamType)) - return true; + return 1; ++NumTopBlocks; } Index: tools/llvm-c-test/echo.cpp =================================================================== --- tools/llvm-c-test/echo.cpp +++ tools/llvm-c-test/echo.cpp @@ -259,7 +259,7 @@ if (LLVMIsAConstantInt(Cst)) { check_value_kind(Cst, LLVMConstantIntValueKind); return LLVMConstInt(TypeCloner(M).Clone(Cst), - LLVMConstIntGetZExtValue(Cst), false); + LLVMConstIntGetZExtValue(Cst), 0); } // Try zeroinitializer Index: tools/llvm-mc/llvm-mc.cpp =================================================================== --- tools/llvm-mc/llvm-mc.cpp +++ tools/llvm-mc/llvm-mc.cpp @@ -229,7 +229,7 @@ DwarfDebugProducer += getenv("DEBUG_PRODUCER"); } -static int AsLexInput(SourceMgr &SrcMgr, MCAsmInfo &MAI, +static bool AsLexInput(SourceMgr &SrcMgr, MCAsmInfo &MAI, raw_ostream &OS) { AsmLexer Lexer(MAI); Index: tools/llvm-nm/llvm-nm.cpp =================================================================== --- tools/llvm-nm/llvm-nm.cpp +++ tools/llvm-nm/llvm-nm.cpp @@ -240,7 +240,7 @@ std::make_tuple(B.Name, B.Size, B.Address); } -static char isSymbolList64Bit(SymbolicFile &Obj) { +static bool isSymbolList64Bit(SymbolicFile &Obj) { if (isa(Obj)) { IRObjectFile *IRobj = dyn_cast(&Obj); Module &M = IRobj->getModule(); Index: tools/llvm-pdbdump/llvm-pdbdump.cpp =================================================================== --- tools/llvm-pdbdump/llvm-pdbdump.cpp +++ tools/llvm-pdbdump/llvm-pdbdump.cpp @@ -542,7 +542,7 @@ auto Compilands = GlobalScope->findAllChildren(); CompilandDumper Dumper(Printer); while (auto Compiland = Compilands->getNext()) - Dumper.start(*Compiland, true); + Dumper.start(*Compiland, 1); Printer.Unindent(); } Index: unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp =================================================================== --- unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp +++ unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp @@ -265,7 +265,7 @@ Options.OptLevel = 2; // Just ensure that this field still exists. - Options.NoFramePointerElim = false; + Options.NoFramePointerElim = 0; } void useRoundTripSectionMemoryManager() { Index: unittests/IR/ValueMapTest.cpp =================================================================== --- unittests/IR/ValueMapTest.cpp +++ unittests/IR/ValueMapTest.cpp @@ -212,7 +212,7 @@ template struct NoFollow : ValueMapConfig { - enum { FollowRAUW = false }; + enum { FollowRAUW = 0 }; }; TYPED_TEST(ValueMapTest, NoFollowRAUW) { Index: unittests/Support/CommandLineTest.cpp =================================================================== --- unittests/Support/CommandLineTest.cpp +++ unittests/Support/CommandLineTest.cpp @@ -26,7 +26,7 @@ const char *old_value = getenv(name); EXPECT_EQ(nullptr, old_value) << old_value; #if HAVE_SETENV - setenv(name, value, true); + setenv(name, value, 1); #else # define SKIP_ENVIRONMENT_TESTS #endif 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) { Index: utils/TableGen/CTagsEmitter.cpp =================================================================== --- utils/TableGen/CTagsEmitter.cpp +++ utils/TableGen/CTagsEmitter.cpp @@ -33,7 +33,7 @@ public: Tag(const std::string &Name, const SMLoc Location) : Id(&Name), Loc(Location) {} - int operator<(const Tag &B) const { return *Id < *B.Id; } + bool operator<(const Tag &B) const { return *Id < *B.Id; } void emit(raw_ostream &OS) const { const MemoryBuffer *CurMB = SrcMgr.getMemoryBuffer(SrcMgr.FindBufferContainingLoc(Loc));