Prazek updated this revision to Diff 56250.
Prazek added a comment.
Herald added a reviewer: tstellarAMD.
Herald added subscribers: jfb, mzolotukhin, dsanders, arsenm, MatzeB.
It seems that is doing it's work right now.
I will have to change some places to post it to llvm like:
- changing functions return type to bool
- removng comparasion with bool for bools
http://reviews.llvm.org/D19105
Files:
clang-tidy/misc/ThrowByValueCatchByReferenceCheck.cpp
clang-tidy/readability/ImplicitBoolCastCheck.cpp
lib/AST/DeclPrinter.cpp
lib/AST/DeclarationName.cpp
lib/AsmParser/LLParser.cpp
lib/Bitcode/Writer/BitWriter.cpp
lib/Bitcode/Writer/BitcodeWriter.cpp
lib/CodeGen/CGAtomic.cpp
lib/CodeGen/CGBuiltin.cpp
lib/CodeGen/CGOpenMPRuntime.cpp
lib/CodeGen/MachineScheduler.cpp
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
lib/CodeGen/SelectionDAG/SelectionDAG.cpp
lib/CodeGen/SplitKit.cpp
lib/DebugInfo/Symbolize/DIPrinter.cpp
lib/Driver/Tools.cpp
lib/ExecutionEngine/Interpreter/Execution.cpp
lib/IR/Core.cpp
lib/Lex/PPMacroExpansion.cpp
lib/MC/MCContext.cpp
lib/MC/MCDisassembler/MCExternalSymbolizer.cpp
lib/Sema/Sema.cpp
lib/Sema/SemaChecking.cpp
lib/Sema/SemaDecl.cpp
lib/Sema/SemaDeclAttr.cpp
lib/Sema/SemaDeclCXX.cpp
lib/Sema/SemaDeclObjC.cpp
lib/Sema/SemaOpenMP.cpp
lib/Serialization/ASTReader.cpp
lib/Serialization/ASTWriter.cpp
lib/Support/APInt.cpp
lib/Target/AArch64/AArch64ISelDAGToDAG.cpp
lib/Target/AArch64/Disassembler/AArch64ExternalSymbolizer.cpp
lib/Target/AMDGPU/AMDILCFGStructurizer.cpp
lib/Target/AMDGPU/R600InstrInfo.cpp
lib/Target/AMDGPU/SIMachineScheduler.cpp
lib/Target/ARM/ARMConstantIslandPass.cpp
lib/Target/ARM/ARMFastISel.cpp
lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp
lib/Target/Hexagon/Disassembler/HexagonDisassembler.cpp
lib/Target/Hexagon/HexagonOptAddrMode.cpp
lib/Target/Hexagon/MCTargetDesc/HexagonAsmBackend.cpp
lib/Target/Hexagon/MCTargetDesc/HexagonMCChecker.cpp
lib/Target/Hexagon/MCTargetDesc/HexagonMCCompound.cpp
lib/Target/Hexagon/MCTargetDesc/HexagonMCShuffler.cpp
lib/Target/Hexagon/MCTargetDesc/HexagonShuffler.cpp
lib/Target/Mips/MipsConstantIslandPass.cpp
lib/Target/PowerPC/MCTargetDesc/PPCMachObjectWriter.cpp
lib/Target/TargetMachineC.cpp
lib/Target/X86/X86FrameLowering.cpp
lib/Transforms/IPO/GlobalOpt.cpp
lib/Transforms/IPO/MergeFunctions.cpp
lib/Transforms/InstCombine/InstCombineCompares.cpp
lib/Transforms/Scalar/GVN.cpp
lib/Transforms/Scalar/LoopInstSimplify.cpp
lib/Transforms/Utils/SimplifyCFG.cpp
tools/libclang/CIndex.cpp
tools/libclang/CXComment.cpp
tools/libclang/CXCursor.cpp
tools/libclang/CXIndexDataConsumer.cpp
tools/libclang/CXType.cpp
tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp
tools/llvm-c-test/echo.cpp
tools/llvm-nm/llvm-nm.cpp
tools/llvm-pdbdump/llvm-pdbdump.cpp
tools/llvm-symbolizer/llvm-symbolizer.cpp
unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp
unittests/IR/ValueMapTest.cpp
unittests/Support/CommandLineTest.cpp
unittests/libclang/LibclangTest.cpp
Index: clang-tidy/readability/ImplicitBoolCastCheck.cpp
===================================================================
--- clang-tidy/readability/ImplicitBoolCastCheck.cpp
+++ clang-tidy/readability/ImplicitBoolCastCheck.cpp
@@ -250,20 +250,20 @@
if (!Context.getLangOpts().CPlusPlus11 &&
(DestinationType->isPointerType() ||
DestinationType->isMemberPointerType()) &&
- BoolLiteralExpression->getValue() == false) {
+ BoolLiteralExpression->getValue() == 0) {
return "0";
}
if (DestinationType->isFloatingType()) {
- if (BoolLiteralExpression->getValue() == true) {
+ if (BoolLiteralExpression->getValue() == 1) {
return Context.hasSameType(DestinationType, Context.FloatTy) ? "1.0f"
: "1.0";
}
return Context.hasSameType(DestinationType, Context.FloatTy) ? "0.0f"
: "0.0";
}
- if (BoolLiteralExpression->getValue() == true) {
+ if (BoolLiteralExpression->getValue() == 1) {
return DestinationType->isUnsignedIntegerType() ? "1u" : "1";
}
return DestinationType->isUnsignedIntegerType() ? "0u" : "0";
Index: clang-tidy/misc/ThrowByValueCatchByReferenceCheck.cpp
===================================================================
--- clang-tidy/misc/ThrowByValueCatchByReferenceCheck.cpp
+++ clang-tidy/misc/ThrowByValueCatchByReferenceCheck.cpp
@@ -33,7 +33,7 @@
void ThrowByValueCatchByReferenceCheck::storeOptions(
ClangTidyOptions::OptionMap &Opts) {
- Options.store(Opts, "CheckThrowTemporaries", true);
+ Options.store(Opts, "CheckThrowTemporaries", 1);
}
void ThrowByValueCatchByReferenceCheck::check(
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: tools/libclang/CXType.cpp
===================================================================
--- tools/libclang/CXType.cpp
+++ tools/libclang/CXType.cpp
@@ -955,27 +955,27 @@
CXClientData client_data){
CXCursor PC = clang_getTypeDeclaration(PT);
if (clang_isInvalid(PC.kind))
- return false;
+ return 0;
const RecordDecl *RD =
dyn_cast_or_null<RecordDecl>(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){
const FieldDecl *FD = dyn_cast_or_null<FieldDecl>((*I));
// 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/CXIndexDataConsumer.cpp
===================================================================
--- tools/libclang/CXIndexDataConsumer.cpp
+++ tools/libclang/CXIndexDataConsumer.cpp
@@ -498,7 +498,7 @@
const_cast<FileEntry *>(File)),
/*module=*/nullptr,
getIndexLoc(SourceLocation()),
- /*isImplicit=*/false
+ /*isImplicit=*/0
};
CXIdxClientASTFile astFile = CB.importedASTFile(ClientData, &Info);
(void)astFile;
Index: tools/libclang/CXCursor.cpp
===================================================================
--- tools/libclang/CXCursor.cpp
+++ tools/libclang/CXCursor.cpp
@@ -1468,13 +1468,13 @@
if (const ObjCMessageExpr *MsgE = dyn_cast<ObjCMessageExpr>(E)) {
if (MsgE->getReceiverKind() != ObjCMessageExpr::Instance)
- return false;
+ return 0;
if (auto *RecE = dyn_cast<ObjCMessageExpr>(
MsgE->getInstanceReceiver()->IgnoreParenCasts())) {
if (RecE->getMethodFamily() == OMF_alloc)
- return false;
+ return 0;
}
- return true;
+ return 1;
}
const MemberExpr *ME = nullptr;
Index: tools/libclang/CXComment.cpp
===================================================================
--- tools/libclang/CXComment.cpp
+++ tools/libclang/CXComment.cpp
@@ -109,21 +109,21 @@
unsigned clang_Comment_isWhitespace(CXComment CXC) {
const Comment *C = getASTNode(CXC);
if (!C)
- return false;
+ return 0;
if (const TextComment *TC = dyn_cast<TextComment>(C))
return TC->isWhitespace();
if (const ParagraphComment *PC = dyn_cast<ParagraphComment>(C))
return PC->isWhitespace();
- return false;
+ return 0;
}
unsigned clang_InlineContentComment_hasTrailingNewline(CXComment CXC) {
const InlineContentComment *ICC = getASTNodeAs<InlineContentComment>(CXC);
if (!ICC)
- return false;
+ return 0;
return ICC->hasTrailingNewline();
}
@@ -195,7 +195,7 @@
unsigned clang_HTMLStartTagComment_isSelfClosing(CXComment CXC) {
const HTMLStartTagComment *HST = getASTNodeAs<HTMLStartTagComment>(CXC);
if (!HST)
- return false;
+ return 0;
return HST->isSelfClosing();
}
@@ -269,7 +269,7 @@
unsigned clang_ParamCommandComment_isParamIndexValid(CXComment CXC) {
const ParamCommandComment *PCC = getASTNodeAs<ParamCommandComment>(CXC);
if (!PCC)
- return false;
+ return 0;
return PCC->isParamIndexValid();
}
@@ -285,7 +285,7 @@
unsigned clang_ParamCommandComment_isDirectionExplicit(CXComment CXC) {
const ParamCommandComment *PCC = getASTNodeAs<ParamCommandComment>(CXC);
if (!PCC)
- return false;
+ return 0;
return PCC->isDirectionExplicit();
}
@@ -320,7 +320,7 @@
unsigned clang_TParamCommandComment_isParamPositionValid(CXComment CXC) {
const TParamCommandComment *TPCC = getASTNodeAs<TParamCommandComment>(CXC);
if (!TPCC)
- return false;
+ return 0;
return TPCC->isPositionValid();
}
Index: tools/libclang/CIndex.cpp
===================================================================
--- tools/libclang/CIndex.cpp
+++ tools/libclang/CIndex.cpp
@@ -3355,32 +3355,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<FunctionDecl>(D);
if (!FD) {
- return false;
+ return 0;
}
return FD->isInlined();
}
@@ -3887,10 +3887,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<FileEntry *>(file1);
FileEntry *FEnt2 = static_cast<FileEntry *>(file2);
@@ -5064,9 +5064,9 @@
case CXCursor_UnexposedExpr:
case CXCursor_UnexposedStmt:
case CXCursor_UnexposedAttr:
- return true;
+ return 1;
default:
- return false;
+ return 0;
}
}
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<ClassTemplatePartialSpecializationDecl*>()) {
- 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/Serialization/ASTReader.cpp
===================================================================
--- lib/Serialization/ASTReader.cpp
+++ lib/Serialization/ASTReader.cpp
@@ -5450,7 +5450,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/Sema/SemaOpenMP.cpp
===================================================================
--- lib/Sema/SemaOpenMP.cpp
+++ lib/Sema/SemaOpenMP.cpp
@@ -4484,7 +4484,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);
}
@@ -4749,7 +4749,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/SemaDeclObjC.cpp
===================================================================
--- lib/Sema/SemaDeclObjC.cpp
+++ lib/Sema/SemaDeclObjC.cpp
@@ -1623,7 +1623,7 @@
if (auto objcClass = corrected.getCorrectionDeclAs<ObjCInterfaceDecl>()) {
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/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<TypeDecl>()) {
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/SemaDeclAttr.cpp
===================================================================
--- lib/Sema/SemaDeclAttr.cpp
+++ lib/Sema/SemaDeclAttr.cpp
@@ -4882,7 +4882,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/SemaDecl.cpp
===================================================================
--- lib/Sema/SemaDecl.cpp
+++ lib/Sema/SemaDecl.cpp
@@ -10845,7 +10845,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/SemaChecking.cpp
===================================================================
--- lib/Sema/SemaChecking.cpp
+++ lib/Sema/SemaChecking.cpp
@@ -4477,7 +4477,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));
@@ -4488,7 +4488,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));
@@ -5069,16 +5069,16 @@
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),
FixItHint::CreateReplacement(
getSpecifierRange(startSpecifier, specifierLen), os.str()));
} 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/Sema.cpp
===================================================================
--- lib/Sema/Sema.cpp
+++ lib/Sema/Sema.cpp
@@ -787,7 +787,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/Lex/PPMacroExpansion.cpp
===================================================================
--- lib/Lex/PPMacroExpansion.cpp
+++ lib/Lex/PPMacroExpansion.cpp
@@ -1686,9 +1686,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<bool>(II->getName())
@@ -1724,7 +1724,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.
@@ -1766,14 +1766,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/Driver/Tools.cpp
===================================================================
--- lib/Driver/Tools.cpp
+++ lib/Driver/Tools.cpp
@@ -2019,7 +2019,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/CodeGen/CGOpenMPRuntime.cpp
===================================================================
--- lib/CodeGen/CGOpenMPRuntime.cpp
+++ lib/CodeGen/CGOpenMPRuntime.cpp
@@ -1926,7 +1926,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));
@@ -2486,7 +2486,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);
}
@@ -3022,7 +3022,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()));
@@ -3601,7 +3601,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");
@@ -5432,7 +5432,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/CGBuiltin.cpp
===================================================================
--- lib/CodeGen/CGBuiltin.cpp
+++ lib/CodeGen/CGBuiltin.cpp
@@ -6915,7 +6915,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});
}
@@ -7176,7 +7176,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});
}
@@ -7187,7 +7187,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/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/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/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: 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/IR/ValueMapTest.cpp
===================================================================
--- unittests/IR/ValueMapTest.cpp
+++ unittests/IR/ValueMapTest.cpp
@@ -212,7 +212,7 @@
template<typename KeyT>
struct NoFollow : ValueMapConfig<KeyT> {
- enum { FollowRAUW = false };
+ enum { FollowRAUW = 0 };
};
TYPED_TEST(ValueMapTest, NoFollowRAUW) {
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: tools/llvm-symbolizer/llvm-symbolizer.cpp
===================================================================
--- tools/llvm-symbolizer/llvm-symbolizer.cpp
+++ tools/llvm-symbolizer/llvm-symbolizer.cpp
@@ -180,7 +180,7 @@
if (ClPrintAddress) {
outs() << "0x";
outs().write_hex(ModuleOffset);
- StringRef Delimiter = (ClPrettyPrint == true) ? ": " : "\n";
+ StringRef Delimiter = (ClPrettyPrint == 1) ? ": " : "\n";
outs() << Delimiter;
}
if (IsData) {
Index: tools/llvm-pdbdump/llvm-pdbdump.cpp
===================================================================
--- tools/llvm-pdbdump/llvm-pdbdump.cpp
+++ tools/llvm-pdbdump/llvm-pdbdump.cpp
@@ -412,7 +412,7 @@
auto Compilands = GlobalScope->findAllChildren<PDBSymbolCompiland>();
CompilandDumper Dumper(Printer);
while (auto Compiland = Compilands->getNext())
- Dumper.start(*Compiland, true);
+ Dumper.start(*Compiland, 1);
Printer.Unindent();
}
Index: tools/llvm-nm/llvm-nm.cpp
===================================================================
--- tools/llvm-nm/llvm-nm.cpp
+++ tools/llvm-nm/llvm-nm.cpp
@@ -222,12 +222,12 @@
IRObjectFile *IRobj = dyn_cast<IRObjectFile>(&Obj);
Module &M = IRobj->getModule();
if (M.getTargetTriple().empty())
- return false;
+ return 0;
Triple T(M.getTargetTriple());
return T.isArch64Bit();
}
if (isa<COFFObjectFile>(Obj))
- return false;
+ return 0;
if (MachOObjectFile *MachO = dyn_cast<MachOObjectFile>(&Obj))
return MachO->is64Bit();
return cast<ELFObjectFileBase>(Obj).getBytesInAddress() == 8;
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-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: lib/Transforms/Utils/SimplifyCFG.cpp
===================================================================
--- lib/Transforms/Utils/SimplifyCFG.cpp
+++ lib/Transforms/Utils/SimplifyCFG.cpp
@@ -1811,7 +1811,7 @@
}
// Recurse, simplifying any other constants.
- return FoldCondBranchOnPHI(BI, DL) | true;
+ return FoldCondBranchOnPHI(BI, DL) | 1;
}
return false;
@@ -3065,7 +3065,7 @@
ICI->eraseFromParent();
}
// BB is now empty, so it is likely to simplify away.
- return SimplifyCFG(BB, TTI, BonusInstThreshold, AC) | true;
+ return SimplifyCFG(BB, TTI, BonusInstThreshold, AC) | 1;
}
// Ok, the block is reachable from the default dest. If the constant we're
@@ -3081,7 +3081,7 @@
ICI->replaceAllUsesWith(V);
ICI->eraseFromParent();
// BB is now empty, so it is likely to simplify away.
- return SimplifyCFG(BB, TTI, BonusInstThreshold, AC) | true;
+ return SimplifyCFG(BB, TTI, BonusInstThreshold, AC) | 1;
}
// The use of the icmp has to be in the 'end' block, by the only PHI node in
@@ -4900,12 +4900,12 @@
// see if that predecessor totally determines the outcome of this switch.
if (BasicBlock *OnlyPred = BB->getSinglePredecessor())
if (SimplifyEqualityComparisonWithOnlyPredecessor(SI, OnlyPred, Builder))
- return SimplifyCFG(BB, TTI, BonusInstThreshold, AC) | true;
+ return SimplifyCFG(BB, TTI, BonusInstThreshold, AC) | 1;
Value *Cond = SI->getCondition();
if (SelectInst *Select = dyn_cast<SelectInst>(Cond))
if (SimplifySwitchOnSelect(SI, Select))
- return SimplifyCFG(BB, TTI, BonusInstThreshold, AC) | true;
+ return SimplifyCFG(BB, TTI, BonusInstThreshold, AC) | 1;
// If the block only contains the switch, see if we can fold the block
// away into any preds.
@@ -4915,25 +4915,25 @@
++BBI;
if (SI == &*BBI)
if (FoldValueComparisonIntoPredecessors(SI, Builder))
- return SimplifyCFG(BB, TTI, BonusInstThreshold, AC) | true;
+ return SimplifyCFG(BB, TTI, BonusInstThreshold, AC) | 1;
}
// Try to transform the switch into an icmp and a branch.
if (TurnSwitchRangeIntoICmp(SI, Builder))
- return SimplifyCFG(BB, TTI, BonusInstThreshold, AC) | true;
+ return SimplifyCFG(BB, TTI, BonusInstThreshold, AC) | 1;
// Remove unreachable cases.
if (EliminateDeadSwitchCases(SI, AC, DL))
- return SimplifyCFG(BB, TTI, BonusInstThreshold, AC) | true;
+ return SimplifyCFG(BB, TTI, BonusInstThreshold, AC) | 1;
if (SwitchToSelect(SI, Builder, AC, DL))
- return SimplifyCFG(BB, TTI, BonusInstThreshold, AC) | true;
+ return SimplifyCFG(BB, TTI, BonusInstThreshold, AC) | 1;
if (ForwardSwitchConditionToPHI(SI))
- return SimplifyCFG(BB, TTI, BonusInstThreshold, AC) | true;
+ return SimplifyCFG(BB, TTI, BonusInstThreshold, AC) | 1;
if (SwitchToLookupTable(SI, Builder, DL, TTI))
- return SimplifyCFG(BB, TTI, BonusInstThreshold, AC) | true;
+ return SimplifyCFG(BB, TTI, BonusInstThreshold, AC) | 1;
return false;
}
@@ -4970,7 +4970,7 @@
if (SelectInst *SI = dyn_cast<SelectInst>(IBI->getAddress())) {
if (SimplifyIndirectBrOnSelect(IBI, SI))
- return SimplifyCFG(BB, TTI, BonusInstThreshold, AC) | true;
+ return SimplifyCFG(BB, TTI, BonusInstThreshold, AC) | 1;
}
return Changed;
}
@@ -5095,7 +5095,7 @@
// predecessor and use logical operations to update the incoming value
// for PHI nodes in common successor.
if (FoldBranchToCommonDest(BI, BonusInstThreshold))
- return SimplifyCFG(BB, TTI, BonusInstThreshold, AC) | true;
+ return SimplifyCFG(BB, TTI, BonusInstThreshold, AC) | 1;
return false;
}
@@ -5120,7 +5120,7 @@
// switch.
if (BasicBlock *OnlyPred = BB->getSinglePredecessor())
if (SimplifyEqualityComparisonWithOnlyPredecessor(BI, OnlyPred, Builder))
- return SimplifyCFG(BB, TTI, BonusInstThreshold, AC) | true;
+ return SimplifyCFG(BB, TTI, BonusInstThreshold, AC) | 1;
// This block must be empty, except for the setcond inst, if it exists.
// Ignore dbg intrinsics.
@@ -5130,14 +5130,14 @@
++I;
if (&*I == BI) {
if (FoldValueComparisonIntoPredecessors(BI, Builder))
- return SimplifyCFG(BB, TTI, BonusInstThreshold, AC) | true;
+ return SimplifyCFG(BB, TTI, BonusInstThreshold, AC) | 1;
} else if (&*I == cast<Instruction>(BI->getCondition())){
++I;
// Ignore dbg intrinsics.
while (isa<DbgInfoIntrinsic>(I))
++I;
if (&*I == BI && FoldValueComparisonIntoPredecessors(BI, Builder))
- return SimplifyCFG(BB, TTI, BonusInstThreshold, AC) | true;
+ return SimplifyCFG(BB, TTI, BonusInstThreshold, AC) | 1;
}
}
@@ -5149,56 +5149,56 @@
// branches to us and one of our successors, fold the comparison into the
// predecessor and use logical operations to pick the right destination.
if (FoldBranchToCommonDest(BI, BonusInstThreshold))
- return SimplifyCFG(BB, TTI, BonusInstThreshold, AC) | true;
+ return SimplifyCFG(BB, TTI, BonusInstThreshold, AC) | 1;
// We have a conditional branch to two blocks that are only reachable
// from BI. We know that the condbr dominates the two blocks, so see if
// there is any identical code in the "then" and "else" blocks. If so, we
// can hoist it up to the branching block.
if (BI->getSuccessor(0)->getSinglePredecessor()) {
if (BI->getSuccessor(1)->getSinglePredecessor()) {
if (HoistThenElseCodeToIf(BI, TTI))
- return SimplifyCFG(BB, TTI, BonusInstThreshold, AC) | true;
+ return SimplifyCFG(BB, TTI, BonusInstThreshold, AC) | 1;
} else {
// If Successor #1 has multiple preds, we may be able to conditionally
// execute Successor #0 if it branches to Successor #1.
TerminatorInst *Succ0TI = BI->getSuccessor(0)->getTerminator();
if (Succ0TI->getNumSuccessors() == 1 &&
Succ0TI->getSuccessor(0) == BI->getSuccessor(1))
if (SpeculativelyExecuteBB(BI, BI->getSuccessor(0), TTI))
- return SimplifyCFG(BB, TTI, BonusInstThreshold, AC) | true;
+ return SimplifyCFG(BB, TTI, BonusInstThreshold, AC) | 1;
}
} else if (BI->getSuccessor(1)->getSinglePredecessor()) {
// If Successor #0 has multiple preds, we may be able to conditionally
// execute Successor #1 if it branches to Successor #0.
TerminatorInst *Succ1TI = BI->getSuccessor(1)->getTerminator();
if (Succ1TI->getNumSuccessors() == 1 &&
Succ1TI->getSuccessor(0) == BI->getSuccessor(0))
if (SpeculativelyExecuteBB(BI, BI->getSuccessor(1), TTI))
- return SimplifyCFG(BB, TTI, BonusInstThreshold, AC) | true;
+ return SimplifyCFG(BB, TTI, BonusInstThreshold, AC) | 1;
}
// If this is a branch on a phi node in the current block, thread control
// through this block if any PHI node entries are constants.
if (PHINode *PN = dyn_cast<PHINode>(BI->getCondition()))
if (PN->getParent() == BI->getParent())
if (FoldCondBranchOnPHI(BI, DL))
- return SimplifyCFG(BB, TTI, BonusInstThreshold, AC) | true;
+ return SimplifyCFG(BB, TTI, BonusInstThreshold, AC) | 1;
// Scan predecessor blocks for conditional branches.
for (pred_iterator PI = pred_begin(BB), E = pred_end(BB); PI != E; ++PI)
if (BranchInst *PBI = dyn_cast<BranchInst>((*PI)->getTerminator()))
if (PBI != BI && PBI->isConditional())
if (SimplifyCondBranchToCondBranch(PBI, BI, DL))
- return SimplifyCFG(BB, TTI, BonusInstThreshold, AC) | true;
+ return SimplifyCFG(BB, TTI, BonusInstThreshold, AC) | 1;
// Look for diamond patterns.
if (MergeCondStores)
if (BasicBlock *PrevBB = allPredecessorsComeFromSameSource(BB))
if (BranchInst *PBI = dyn_cast<BranchInst>(PrevBB->getTerminator()))
if (PBI != BI && PBI->isConditional())
if (mergeConditionalStores(PBI, BI))
- return SimplifyCFG(BB, TTI, BonusInstThreshold, AC) | true;
+ return SimplifyCFG(BB, TTI, BonusInstThreshold, AC) | 1;
return false;
}
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,15 +153,15 @@
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<BasicBlock*, 8> SubLoopExitBlocks;
SuccLoop->getExitBlocks(SubLoopExitBlocks);
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/GVN.cpp
===================================================================
--- lib/Transforms/Scalar/GVN.cpp
+++ lib/Transforms/Scalar/GVN.cpp
@@ -1418,9 +1418,9 @@
MapVector<BasicBlock *, Value *> PredLoads;
DenseMap<BasicBlock*, char> 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<BasicBlock *, 4> CriticalEdgePred;
for (BasicBlock *Pred : predecessors(LoadBB)) {
Index: lib/Transforms/InstCombine/InstCombineCompares.cpp
===================================================================
--- lib/Transforms/InstCombine/InstCombineCompares.cpp
+++ lib/Transforms/InstCombine/InstCombineCompares.cpp
@@ -1584,7 +1584,7 @@
bool isTrueIfPositive = ICI.getPredicate() == ICmpInst::ICMP_SGT;
// If so, the new one isn't.
- isTrueIfPositive ^= true;
+ isTrueIfPositive ^= 1;
if (isTrueIfPositive)
return new ICmpInst(ICmpInst::ICMP_SGT, CompareVal,
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<GlobalValue*> {
- 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/IPO/GlobalOpt.cpp
===================================================================
--- lib/Transforms/IPO/GlobalOpt.cpp
+++ lib/Transforms/IPO/GlobalOpt.cpp
@@ -2498,7 +2498,7 @@
++NumCXXDtorsRemoved;
- Changed |= true;
+ Changed |= 1;
}
return Changed;
Index: lib/Target/X86/X86FrameLowering.cpp
===================================================================
--- lib/Target/X86/X86FrameLowering.cpp
+++ lib/Target/X86/X86FrameLowering.cpp
@@ -2682,7 +2682,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/Target/TargetMachineC.cpp
===================================================================
--- lib/Target/TargetMachineC.cpp
+++ lib/Target/TargetMachineC.cpp
@@ -200,22 +200,22 @@
if (TM->addPassesToEmitFile(pass, OS, ft)) {
error = "TargetMachine can't emit a file of this type";
*ErrorMessage = strdup(error.c_str());
- return true;
+ return 1;
}
pass.run(*Mod);
OS.flush();
- return false;
+ return 0;
}
LLVMBool 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);
if (EC) {
*ErrorMessage = strdup(EC.message().c_str());
- return true;
+ return 1;
}
bool Result = LLVMTargetMachineEmit(T, M, dest, codegen, ErrorMessage);
dest.flush();
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/Mips/MipsConstantIslandPass.cpp
===================================================================
--- lib/Target/Mips/MipsConstantIslandPass.cpp
+++ lib/Target/Mips/MipsConstantIslandPass.cpp
@@ -1478,14 +1478,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<CPEntry> &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/Hexagon/MCTargetDesc/HexagonShuffler.cpp
===================================================================
--- lib/Target/Hexagon/MCTargetDesc/HexagonShuffler.cpp
+++ lib/Target/Hexagon/MCTargetDesc/HexagonShuffler.cpp
@@ -359,7 +359,7 @@
}
bool validateSlots = true;
- if (bOnlySlot3 == false && pSlot3Cnt == 1 && slot3ISJ != end()) {
+ if (bOnlySlot3 == 0 && pSlot3Cnt == 1 && slot3ISJ != end()) {
// save off slot mask of instruction marked with A_PREFER_SLOT3
// and then pin it to slot #3
unsigned saveUnits = slot3ISJ->Core.getUnits();
@@ -370,7 +370,7 @@
// see if things ok with that instruction being pinned to slot #3
bool bFail = false;
- for (iterator I = begin(); I != end() && bFail != true; ++I)
+ for (iterator I = begin(); I != end() && bFail != 1; ++I)
if (!AuctionCore.bid(I->Core.getUnits()))
bFail = true;
Index: lib/Target/Hexagon/MCTargetDesc/HexagonMCShuffler.cpp
===================================================================
--- lib/Target/Hexagon/MCTargetDesc/HexagonMCShuffler.cpp
+++ lib/Target/Hexagon/MCTargetDesc/HexagonMCShuffler.cpp
@@ -191,7 +191,7 @@
break;
}
- if (doneShuffling == false) {
+ if (doneShuffling == 0) {
HexagonMCShuffler MCS(MCII, STI, MCB);
doneShuffling = MCS.reshuffleTo(MCB); // shuffle
shuffleError = MCS.getError();
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/Hexagon/MCTargetDesc/HexagonMCChecker.cpp
===================================================================
--- lib/Target/Hexagon/MCTargetDesc/HexagonMCChecker.cpp
+++ lib/Target/Hexagon/MCTargetDesc/HexagonMCChecker.cpp
@@ -467,7 +467,7 @@
}
}
// Warn on an unused temporary definition.
- if (vHistFound == false) {
+ if (vHistFound == 0) {
errInfo.setWarning(HexagonMCErrInfo::CHECK_WARN_TEMPORARY, R);
addErrInfo(errInfo);
return true;
Index: lib/Target/Hexagon/MCTargetDesc/HexagonAsmBackend.cpp
===================================================================
--- lib/Target/Hexagon/MCTargetDesc/HexagonAsmBackend.cpp
+++ lib/Target/Hexagon/MCTargetDesc/HexagonAsmBackend.cpp
@@ -562,7 +562,7 @@
MCInst &MCI = const_cast<MCInst &>(HexagonMCInstrInfo::instruction(
MCB, Fixup.getOffset() / HEXAGON_INSTR_SIZE));
bool Relaxable = isInstRelaxable(MCI);
- if (Relaxable == false)
+ if (Relaxable == 0)
return false;
// If we cannot resolve the fixup value, it requires relaxation.
if (!Resolved) {
Index: lib/Target/Hexagon/HexagonOptAddrMode.cpp
===================================================================
--- lib/Target/Hexagon/HexagonOptAddrMode.cpp
+++ lib/Target/Hexagon/HexagonOptAddrMode.cpp
@@ -523,7 +523,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/Disassembler/HexagonDisassembler.cpp
===================================================================
--- lib/Target/Hexagon/Disassembler/HexagonDisassembler.cpp
+++ lib/Target/Hexagon/Disassembler/HexagonDisassembler.cpp
@@ -162,7 +162,7 @@
*CurrentBundle = &MI;
MI = HexagonMCInstrInfo::createBundle();
- while (Result == Success && Complete == false) {
+ while (Result == Success && Complete == 0) {
if (Bytes.size() < HEXAGON_INSTR_SIZE)
return MCDisassembler::Fail;
MCInst *Inst = new (getContext()) MCInst;
Index: lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp
===================================================================
--- lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp
+++ lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp
@@ -631,7 +631,7 @@
getContext(), MCB,
&Check);
- while (Check.getNextErrInfo() == true) {
+ while (Check.getNextErrInfo() == 1) {
unsigned Reg = Check.getErrRegister();
Twine R(RI->getName(Reg));
@@ -928,7 +928,7 @@
SMLoc ExprLoc = L;
// Make sure we have a number (false is returned if expression is a number)
- if (getParser().parseExpression(Value) == false) {
+ if (getParser().parseExpression(Value) == 0) {
// Make sure this is a number that is in range
const MCConstantExpr *MCE = dyn_cast<MCConstantExpr>(Value);
uint64_t IntValue = MCE->getValue();
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/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<CPEntry> &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/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/AMDGPU/R600InstrInfo.cpp
===================================================================
--- lib/Target/AMDGPU/R600InstrInfo.cpp
+++ lib/Target/AMDGPU/R600InstrInfo.cpp
@@ -456,7 +456,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/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/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/AArch64/AArch64ISelDAGToDAG.cpp
===================================================================
--- lib/Target/AArch64/AArch64ISelDAGToDAG.cpp
+++ lib/Target/AArch64/AArch64ISelDAGToDAG.cpp
@@ -832,20 +832,20 @@
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;
}
// Try to match a shifted extend on the LHS.
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.
@@ -945,23 +945,23 @@
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;
}
// Try to match a shifted extend on the LHS.
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/Support/APInt.cpp
===================================================================
--- lib/Support/APInt.cpp
+++ lib/Support/APInt.cpp
@@ -2703,7 +2703,7 @@
shiftCount = tcMSB(rhs, parts) + 1;
if (shiftCount == 0)
- return true;
+ return 1;
shiftCount = parts * integerPartWidth - shiftCount;
n = shiftCount / integerPartWidth;
@@ -2735,7 +2735,7 @@
}
}
- return false;
+ return 0;
}
/* Shift a bignum left COUNT bits in-place. Shifted in bits are zero.
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/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/IR/Core.cpp
===================================================================
--- lib/IR/Core.cpp
+++ lib/IR/Core.cpp
@@ -224,19 +224,19 @@
raw_fd_ostream dest(Filename, EC, sys::fs::F_Text);
if (EC) {
*ErrorMessage = strdup(EC.message().c_str());
- return true;
+ return 1;
}
unwrap(M)->print(dest, nullptr);
dest.close();
if (dest.has_error()) {
*ErrorMessage = strdup("Error printing to file");
- return true;
+ return 1;
}
- return false;
+ return 0;
}
char *LLVMPrintModuleToString(LLVMModuleRef M) {
@@ -759,7 +759,7 @@
LLVMBool LLVMIsNull(LLVMValueRef Val) {
if (Constant *C = dyn_cast<Constant>(unwrap(Val)))
return C->isNullValue();
- return false;
+ return 0;
}
LLVMBool LLVMIsUndef(LLVMValueRef Val) {
@@ -925,12 +925,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();
}
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; _i<Src1.AggregateVal.size(); _i++)
- if (DestMask.AggregateVal[_i].IntVal == false)
- Dest.AggregateVal[_i].IntVal = APInt(1,false);
+ if (DestMask.AggregateVal[_i].IntVal == 0)
+ Dest.AggregateVal[_i].IntVal = APInt(1,0);
return Dest;
}
Index: lib/DebugInfo/Symbolize/DIPrinter.cpp
===================================================================
--- lib/DebugInfo/Symbolize/DIPrinter.cpp
+++ lib/DebugInfo/Symbolize/DIPrinter.cpp
@@ -61,7 +61,7 @@
if (FunctionName == kDILineInfoBadString)
FunctionName = kBadString;
- StringRef Delimiter = (PrintPretty == true) ? " at " : "\n";
+ StringRef Delimiter = (PrintPretty == 1) ? " at " : "\n";
StringRef Prefix = (PrintPretty && Inlined) ? " (inlined by) " : "";
OS << Prefix << FunctionName << Delimiter;
}
Index: lib/CodeGen/SplitKit.cpp
===================================================================
--- lib/CodeGen/SplitKit.cpp
+++ lib/CodeGen/SplitKit.cpp
@@ -382,7 +382,7 @@
// Use insert for lookup, so we can add missing values with a second lookup.
std::pair<ValueMap::iterator, bool> InsP =
Values.insert(std::make_pair(std::make_pair(RegIdx, ParentVNI->id),
- ValueForcePair(VNI, false)));
+ ValueForcePair(VNI, 0)));
// This was the first time (RegIdx, ParentVNI) was mapped.
// Keep it as a simple def without any liveness.
@@ -412,7 +412,7 @@
// ParentVNI was either unmapped or already complex mapped. Either way, just
// set the force bit.
if (!VNI) {
- VFP.setInt(true);
+ VFP.setInt(1);
return;
}
@@ -422,7 +422,7 @@
LiveInterval *LI = &LIS.getInterval(Edit->get(RegIdx));
LI->addSegment(LiveInterval::Segment(Def, Def.getDeadSlot(), VNI));
// Mark as complex mapped, forced.
- VFP = ValueForcePair(nullptr, true);
+ VFP = ValueForcePair(nullptr, 1);
}
VNInfo *SplitEditor::defFromParent(unsigned RegIdx,
Index: lib/CodeGen/SelectionDAG/SelectionDAG.cpp
===================================================================
--- lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -5211,7 +5211,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;
@@ -5281,7 +5281,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;
@@ -5364,7 +5364,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;
@@ -5427,7 +5427,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/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/DAGCombiner.cpp
===================================================================
--- lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -590,7 +590,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/MachineScheduler.cpp
===================================================================
--- lib/CodeGen/MachineScheduler.cpp
+++ lib/CodeGen/MachineScheduler.cpp
@@ -2365,7 +2365,7 @@
// skip PostRA scheduling.
if (!OtherResLimited) {
if (IsPostRA || (RemLatency + CurrZone.getCurrCycle() > Rem.CriticalPath)) {
- Policy.ReduceLatency |= true;
+ Policy.ReduceLatency |= 1;
DEBUG(dbgs() << " " << CurrZone.Available.getName()
<< " RemainingLatency " << RemLatency << " + "
<< CurrZone.getCurrCycle() << "c > CritPath "
Index: lib/Bitcode/Writer/BitcodeWriter.cpp
===================================================================
--- lib/Bitcode/Writer/BitcodeWriter.cpp
+++ lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -1329,7 +1329,7 @@
SmallVectorImpl<uint64_t> &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/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/AsmParser/LLParser.cpp
===================================================================
--- lib/AsmParser/LLParser.cpp
+++ lib/AsmParser/LLParser.cpp
@@ -4877,7 +4877,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);
@@ -4898,11 +4898,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<BinaryOperator>(Inst)->setHasNoUnsignedWrap(true);
if (NSW) cast<BinaryOperator>(Inst)->setHasNoSignedWrap(true);
- return false;
+ return 0;
}
case lltok::kw_fadd:
case lltok::kw_fsub:
@@ -4924,9 +4924,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<BinaryOperator>(Inst)->setIsExact(true);
- return false;
+ return 0;
}
case lltok::kw_urem:
@@ -5685,7 +5685,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<std::pair<Value*, BasicBlock*>, 16> PHIVals;
@@ -5705,7 +5705,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())
@@ -5905,21 +5905,21 @@
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");
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;
}
}
@@ -5963,7 +5963,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");
@@ -6010,7 +6010,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");
@@ -6053,7 +6053,7 @@
ParseTypeAndValue(New, NewLoc, PFS) ||
ParseScopeAndOrdering(true /*Always atomic*/, Scope, SuccessOrdering) ||
ParseOrdering(FailureOrdering))
- return true;
+ return 1;
if (SuccessOrdering == AtomicOrdering::Unordered ||
FailureOrdering == AtomicOrdering::Unordered)
@@ -6115,7 +6115,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");
@@ -6143,7 +6143,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");
@@ -6168,7 +6168,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<PointerType>(BaseType->getScalarType());
@@ -6191,7 +6191,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");
@@ -6225,7 +6225,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");
@@ -6246,7 +6246,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");
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits