forked from OSchip/llvm-project
Fix parameter name comments using clang-tidy. NFC.
This patch applies clang-tidy's bugprone-argument-comment tool to LLVM, clang and lld source trees. Here is how I created this patch: $ git clone https://github.com/llvm/llvm-project.git $ cd llvm-project $ mkdir build $ cd build $ cmake -GNinja -DCMAKE_BUILD_TYPE=Debug \ -DLLVM_ENABLE_PROJECTS='clang;lld;clang-tools-extra' \ -DCMAKE_EXPORT_COMPILE_COMMANDS=On -DLLVM_ENABLE_LLD=On \ -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ ../llvm $ ninja $ parallel clang-tidy -checks='-*,bugprone-argument-comment' \ -config='{CheckOptions: [{key: StrictMode, value: 1}]}' -fix \ ::: ../llvm/lib/**/*.{cpp,h} ../clang/lib/**/*.{cpp,h} ../lld/**/*.{cpp,h} llvm-svn: 366177
This commit is contained in:
parent
bb479ca311
commit
49a3ad21d6
|
@ -514,7 +514,7 @@ MigrationProcess::MigrationProcess(
|
|||
IntrusiveRefCntPtr<DiagnosticsEngine> Diags(
|
||||
new DiagnosticsEngine(DiagID, &CI.getDiagnosticOpts(),
|
||||
DiagClient, /*ShouldOwnClient=*/false));
|
||||
Remapper.initFromDisk(outputDir, *Diags, /*ignoreIfFilesChanges=*/true);
|
||||
Remapper.initFromDisk(outputDir, *Diags, /*ignoreIfFilesChanged=*/true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -110,7 +110,7 @@ public:
|
|||
if (!Summaries)
|
||||
Summaries.reset(new RetainSummaryManager(Ctx,
|
||||
/*TrackNSCFObjects=*/true,
|
||||
/*TrackOSObjects=*/false));
|
||||
/*trackOSObjects=*/false));
|
||||
return *Summaries;
|
||||
}
|
||||
|
||||
|
@ -216,7 +216,7 @@ ObjCMigrateAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) {
|
|||
|
||||
bool ObjCMigrateAction::BeginInvocation(CompilerInstance &CI) {
|
||||
Remapper.initFromDisk(MigrateDir, CI.getDiagnostics(),
|
||||
/*ignoreIfFilesChanges=*/true);
|
||||
/*ignoreIfFilesChanged=*/true);
|
||||
CompInst = &CI;
|
||||
CI.getDiagnostics().setIgnoreAllWarnings(true);
|
||||
return true;
|
||||
|
|
|
@ -269,7 +269,7 @@ static void checkAllAtProps(MigrationContext &MigrateCtx,
|
|||
StringRef toAttr = "strong";
|
||||
if (hasWeak) {
|
||||
if (canApplyWeak(MigrateCtx.Pass.Ctx, IndProps.front()->getType(),
|
||||
/*AllowOnUnkwownClass=*/true))
|
||||
/*AllowOnUnknownClass=*/true))
|
||||
toAttr = "weak";
|
||||
else
|
||||
toAttr = "unsafe_unretained";
|
||||
|
|
|
@ -2201,7 +2201,7 @@ APValue SourceLocExpr::EvaluateInContext(const ASTContext &Ctx,
|
|||
case SourceLocExpr::Line:
|
||||
case SourceLocExpr::Column: {
|
||||
llvm::APSInt IntVal(Ctx.getIntWidth(Ctx.UnsignedIntTy),
|
||||
/*IsUnsigned=*/true);
|
||||
/*isUnsigned=*/true);
|
||||
IntVal = getIdentKind() == SourceLocExpr::Line ? PLoc.getLine()
|
||||
: PLoc.getColumn();
|
||||
return APValue(IntVal);
|
||||
|
|
|
@ -3787,7 +3787,7 @@ recurse:
|
|||
if (TypeSourceInfo *ScopeInfo = PDE->getScopeTypeInfo()) {
|
||||
if (Qualifier) {
|
||||
mangleUnresolvedPrefix(Qualifier,
|
||||
/*Recursive=*/true);
|
||||
/*recursive=*/true);
|
||||
mangleUnresolvedTypeOrSimpleId(ScopeInfo->getType());
|
||||
Out << 'E';
|
||||
} else {
|
||||
|
|
|
@ -379,7 +379,7 @@ public:
|
|||
|
||||
auto hasDefaultCXXMethodCC = [](ASTContext &C, const CXXMethodDecl *MD) {
|
||||
auto DefaultCC = C.getDefaultCallingConvention(/*IsVariadic=*/false,
|
||||
/*IsCSSMethod=*/true);
|
||||
/*IsCXXMethod=*/true);
|
||||
auto CC = MD->getType()->getAs<FunctionProtoType>()->getCallConv();
|
||||
return CC == DefaultCC;
|
||||
};
|
||||
|
|
|
@ -142,7 +142,7 @@ static ScanfSpecifierResult ParseScanfSpecifier(FormatStringHandler &H,
|
|||
}
|
||||
|
||||
// Look for the length modifier.
|
||||
if (ParseLengthModifier(FS, I, E, LO, /*scanf=*/true) && I == E) {
|
||||
if (ParseLengthModifier(FS, I, E, LO, /*IsScanf=*/true) && I == E) {
|
||||
// No more characters left?
|
||||
H.HandleIncompleteSpecifier(Start, E - Start);
|
||||
return true;
|
||||
|
|
|
@ -4080,7 +4080,7 @@ CXXRecordDecl *MemberPointerType::getMostRecentCXXRecordDecl() const {
|
|||
void clang::FixedPointValueToString(SmallVectorImpl<char> &Str,
|
||||
llvm::APSInt Val, unsigned Scale) {
|
||||
FixedPointSemantics FXSema(Val.getBitWidth(), Scale, Val.isSigned(),
|
||||
/*isSaturated=*/false,
|
||||
/*hasUnsignedPadding=*/false);
|
||||
/*IsSaturated=*/false,
|
||||
/*HasUnsignedPadding=*/false);
|
||||
APFixedPoint(Val, FXSema).toString(Str);
|
||||
}
|
||||
|
|
|
@ -1272,7 +1272,7 @@ ThisAdjustment ItaniumVTableBuilder::ComputeThisAdjustment(
|
|||
// We don't have vcall offsets for this virtual base, go ahead and
|
||||
// build them.
|
||||
VCallAndVBaseOffsetBuilder Builder(MostDerivedClass, MostDerivedClass,
|
||||
/*FinalOverriders=*/nullptr,
|
||||
/*Overriders=*/nullptr,
|
||||
BaseSubobject(Offset.VirtualBase,
|
||||
CharUnits::Zero()),
|
||||
/*BaseIsVirtual=*/true,
|
||||
|
@ -2245,7 +2245,7 @@ ItaniumVTableContext::getVirtualBaseOffsetOffset(const CXXRecordDecl *RD,
|
|||
if (I != VirtualBaseClassOffsetOffsets.end())
|
||||
return I->second;
|
||||
|
||||
VCallAndVBaseOffsetBuilder Builder(RD, RD, /*FinalOverriders=*/nullptr,
|
||||
VCallAndVBaseOffsetBuilder Builder(RD, RD, /*Overriders=*/nullptr,
|
||||
BaseSubobject(RD, CharUnits::Zero()),
|
||||
/*BaseIsVirtual=*/false,
|
||||
/*OffsetInLayoutClass=*/CharUnits::Zero());
|
||||
|
|
|
@ -293,7 +293,7 @@ static CallExpr *create_call_once_lambda_call(ASTContext &C, ASTMaker M,
|
|||
|
||||
return CXXOperatorCallExpr::Create(
|
||||
/*AstContext=*/C, OO_Call, callOperatorDeclRef,
|
||||
/*args=*/CallArgs,
|
||||
/*Args=*/CallArgs,
|
||||
/*QualType=*/C.VoidTy,
|
||||
/*ExprValueType=*/VK_RValue,
|
||||
/*SourceLocation=*/SourceLocation(), FPOptions());
|
||||
|
@ -465,10 +465,10 @@ static Stmt *create_call_once(ASTContext &C, const FunctionDecl *D) {
|
|||
auto *Out =
|
||||
IfStmt::Create(C, SourceLocation(),
|
||||
/* IsConstexpr=*/false,
|
||||
/* init=*/nullptr,
|
||||
/* var=*/nullptr,
|
||||
/* cond=*/FlagCheck,
|
||||
/* then=*/M.makeCompound({CallbackCall, FlagAssignment}));
|
||||
/* Init=*/nullptr,
|
||||
/* Var=*/nullptr,
|
||||
/* Cond=*/FlagCheck,
|
||||
/* Then=*/M.makeCompound({CallbackCall, FlagAssignment}));
|
||||
|
||||
return Out;
|
||||
}
|
||||
|
@ -511,7 +511,7 @@ static Stmt *create_dispatch_once(ASTContext &C, const FunctionDecl *D) {
|
|||
CallExpr *CE = CallExpr::Create(
|
||||
/*ASTContext=*/C,
|
||||
/*StmtClass=*/M.makeLvalueToRvalue(/*Expr=*/Block),
|
||||
/*args=*/None,
|
||||
/*Args=*/None,
|
||||
/*QualType=*/C.VoidTy,
|
||||
/*ExprValueType=*/VK_RValue,
|
||||
/*SourceLocation=*/SourceLocation());
|
||||
|
@ -549,10 +549,10 @@ static Stmt *create_dispatch_once(ASTContext &C, const FunctionDecl *D) {
|
|||
// (5) Create the 'if' statement.
|
||||
auto *If = IfStmt::Create(C, SourceLocation(),
|
||||
/* IsConstexpr=*/false,
|
||||
/* init=*/nullptr,
|
||||
/* var=*/nullptr,
|
||||
/* cond=*/GuardCondition,
|
||||
/* then=*/CS);
|
||||
/* Init=*/nullptr,
|
||||
/* Var=*/nullptr,
|
||||
/* Cond=*/GuardCondition,
|
||||
/* Then=*/CS);
|
||||
return If;
|
||||
}
|
||||
|
||||
|
@ -657,8 +657,8 @@ static Stmt *create_OSAtomicCompareAndSwap(ASTContext &C, const FunctionDecl *D)
|
|||
/// Construct the If.
|
||||
auto *If = IfStmt::Create(C, SourceLocation(),
|
||||
/* IsConstexpr=*/false,
|
||||
/* init=*/nullptr,
|
||||
/* var=*/nullptr, Comparison, Body,
|
||||
/* Init=*/nullptr,
|
||||
/* Var=*/nullptr, Comparison, Body,
|
||||
SourceLocation(), Else);
|
||||
|
||||
return If;
|
||||
|
|
|
@ -2931,8 +2931,8 @@ CFGBlock *CFGBuilder::VisitIfStmt(IfStmt *I) {
|
|||
|
||||
// Add the successors. If we know that specific branches are
|
||||
// unreachable, inform addSuccessor() of that knowledge.
|
||||
addSuccessor(Block, ThenBlock, /* isReachable = */ !KnownVal.isFalse());
|
||||
addSuccessor(Block, ElseBlock, /* isReachable = */ !KnownVal.isTrue());
|
||||
addSuccessor(Block, ThenBlock, /* IsReachable = */ !KnownVal.isFalse());
|
||||
addSuccessor(Block, ElseBlock, /* IsReachable = */ !KnownVal.isTrue());
|
||||
|
||||
// Add the condition as the last statement in the new block. This may
|
||||
// create new blocks as the condition may contain control-flow. Any newly
|
||||
|
|
|
@ -190,12 +190,12 @@ void APFixedPoint::toString(llvm::SmallVectorImpl<char> &Str) const {
|
|||
llvm::APInt FractPartMask = llvm::APInt::getAllOnesValue(Scale).zext(Width);
|
||||
llvm::APInt RadixInt = llvm::APInt(Width, 10);
|
||||
|
||||
IntPart.toString(Str, /*radix=*/10);
|
||||
IntPart.toString(Str, /*Radix=*/10);
|
||||
Str.push_back('.');
|
||||
do {
|
||||
(FractPart * RadixInt)
|
||||
.lshr(Scale)
|
||||
.toString(Str, /*radix=*/10, Val.isSigned());
|
||||
.toString(Str, /*Radix=*/10, Val.isSigned());
|
||||
FractPart = (FractPart * RadixInt) & FractPartMask;
|
||||
} while (FractPart != 0);
|
||||
}
|
||||
|
|
|
@ -263,7 +263,7 @@ public:
|
|||
Addr.getElementType(), Addr.getPointer(), Idx0, Idx1, Name));
|
||||
llvm::APInt Offset(
|
||||
DL.getIndexSizeInBits(Addr.getType()->getPointerAddressSpace()), 0,
|
||||
/*IsSigned=*/true);
|
||||
/*isSigned=*/true);
|
||||
if (!GEP->accumulateConstantOffset(DL, Offset))
|
||||
llvm_unreachable("offset of GEP with constants is always computable");
|
||||
return Address(GEP, Addr.getAlignment().alignmentAtOffset(
|
||||
|
|
|
@ -589,7 +589,7 @@ CodeGenFunction::emitBuiltinObjectSize(const Expr *E, unsigned Type,
|
|||
auto DIter = LocalDeclMap.find(D);
|
||||
assert(DIter != LocalDeclMap.end());
|
||||
|
||||
return EmitLoadOfScalar(DIter->second, /*volatile=*/false,
|
||||
return EmitLoadOfScalar(DIter->second, /*Volatile=*/false,
|
||||
getContext().getSizeType(), E->getBeginLoc());
|
||||
}
|
||||
}
|
||||
|
@ -719,7 +719,7 @@ static llvm::Value *EmitX86BitTestIntrinsic(CodeGenFunction &CGF,
|
|||
llvm::FunctionType::get(CGF.Int8Ty, {IntPtrType, IntType}, false);
|
||||
|
||||
llvm::InlineAsm *IA =
|
||||
llvm::InlineAsm::get(FTy, Asm, Constraints, /*SideEffects=*/true);
|
||||
llvm::InlineAsm::get(FTy, Asm, Constraints, /*hasSideEffects=*/true);
|
||||
return CGF.Builder.CreateCall(IA, {BitBase, BitPos});
|
||||
}
|
||||
|
||||
|
@ -1063,7 +1063,7 @@ Value *CodeGenFunction::EmitMSVCBuiltinExpr(MSVCIntrin BuiltinID,
|
|||
}
|
||||
llvm::FunctionType *FTy = llvm::FunctionType::get(VoidTy, {Int32Ty}, false);
|
||||
llvm::InlineAsm *IA =
|
||||
llvm::InlineAsm::get(FTy, Asm, Constraints, /*SideEffects=*/true);
|
||||
llvm::InlineAsm::get(FTy, Asm, Constraints, /*hasSideEffects=*/true);
|
||||
llvm::AttributeList NoReturnAttr = llvm::AttributeList::get(
|
||||
getLLVMContext(), llvm::AttributeList::FunctionIndex,
|
||||
llvm::Attribute::NoReturn);
|
||||
|
@ -5999,9 +5999,9 @@ Value *CodeGenFunction::EmitARMBuiltinExpr(unsigned BuiltinID,
|
|||
|
||||
llvm::InlineAsm *Emit =
|
||||
IsThumb ? InlineAsm::get(FTy, ".inst.n 0x" + utohexstr(ZExtValue), "",
|
||||
/*SideEffects=*/true)
|
||||
/*hasSideEffects=*/true)
|
||||
: InlineAsm::get(FTy, ".inst 0x" + utohexstr(ZExtValue), "",
|
||||
/*SideEffects=*/true);
|
||||
/*hasSideEffects=*/true);
|
||||
|
||||
return Builder.CreateCall(Emit);
|
||||
}
|
||||
|
@ -12120,7 +12120,7 @@ Value *CodeGenFunction::EmitX86BuiltinExpr(unsigned BuiltinID,
|
|||
// This syscall signals a driver assertion failure in x86 NT kernels.
|
||||
llvm::FunctionType *FTy = llvm::FunctionType::get(VoidTy, false);
|
||||
llvm::InlineAsm *IA =
|
||||
llvm::InlineAsm::get(FTy, "int $$0x2c", "", /*SideEffects=*/true);
|
||||
llvm::InlineAsm::get(FTy, "int $$0x2c", "", /*hasSideEffects=*/true);
|
||||
llvm::AttributeList NoReturnAttr = llvm::AttributeList::get(
|
||||
getLLVMContext(), llvm::AttributeList::FunctionIndex,
|
||||
llvm::Attribute::NoReturn);
|
||||
|
|
|
@ -239,7 +239,7 @@ llvm::FunctionCallee CodeGenModule::getAddrAndTypeOfCXXStructor(
|
|||
|
||||
llvm::Constant *Ptr = GetOrCreateLLVMFunction(
|
||||
getMangledName(GD), FnType, GD, /*ForVTable=*/false, DontDefer,
|
||||
/*isThunk=*/false, /*ExtraAttrs=*/llvm::AttributeList(), IsForDefinition);
|
||||
/*IsThunk=*/false, /*ExtraAttrs=*/llvm::AttributeList(), IsForDefinition);
|
||||
return {FnType, Ptr};
|
||||
}
|
||||
|
||||
|
|
|
@ -291,7 +291,7 @@ llvm::GlobalValue::LinkageTypes CGCXXABI::getCXXDestructorLinkage(
|
|||
GVALinkage Linkage, const CXXDestructorDecl *Dtor, CXXDtorType DT) const {
|
||||
// Delegate back to CGM by default.
|
||||
return CGM.getLLVMLinkageForDeclarator(Dtor, Linkage,
|
||||
/*isConstantVariable=*/false);
|
||||
/*IsConstantVariable=*/false);
|
||||
}
|
||||
|
||||
bool CGCXXABI::NeedsVTTParameter(GlobalDecl GD) {
|
||||
|
|
|
@ -1810,7 +1810,7 @@ void CodeGenModule::ConstructDefaultFnAttrList(StringRef Name, bool HasOptnone,
|
|||
void CodeGenModule::AddDefaultFnAttrs(llvm::Function &F) {
|
||||
llvm::AttrBuilder FuncAttrs;
|
||||
ConstructDefaultFnAttrList(F.getName(), F.hasOptNone(),
|
||||
/* AttrOnCallsite = */ false, FuncAttrs);
|
||||
/* AttrOnCallSite = */ false, FuncAttrs);
|
||||
F.addAttributes(llvm::AttributeList::FunctionIndex, FuncAttrs);
|
||||
}
|
||||
|
||||
|
@ -2490,7 +2490,7 @@ void CodeGenFunction::EmitFunctionProlog(const CGFunctionInfo &FI,
|
|||
assert(NumIRArgs == 1);
|
||||
auto AI = FnArgs[FirstIRArg];
|
||||
AI->setName(Arg->getName() + ".coerce");
|
||||
CreateCoercedStore(AI, Ptr, /*DestIsVolatile=*/false, *this);
|
||||
CreateCoercedStore(AI, Ptr, /*DstIsVolatile=*/false, *this);
|
||||
}
|
||||
|
||||
// Match to what EmitParmDecl is expecting for this type.
|
||||
|
@ -3537,7 +3537,7 @@ RValue CallArg::getRValue(CodeGenFunction &CGF) const {
|
|||
void CallArg::copyInto(CodeGenFunction &CGF, Address Addr) const {
|
||||
LValue Dst = CGF.MakeAddrLValue(Addr, Ty);
|
||||
if (!HasLV && RV.isScalar())
|
||||
CGF.EmitStoreOfScalar(RV.getScalarVal(), Dst, /*init=*/true);
|
||||
CGF.EmitStoreOfScalar(RV.getScalarVal(), Dst, /*isInit=*/true);
|
||||
else if (!HasLV && RV.isComplex())
|
||||
CGF.EmitStoreOfComplex(RV.getComplexVal(), Dst, /*init=*/true);
|
||||
else {
|
||||
|
|
|
@ -405,7 +405,7 @@ struct CallCoroEnd final : public EHScopeStack::Cleanup {
|
|||
if (Bundles.empty()) {
|
||||
// Otherwise, (landingpad model), create a conditional branch that leads
|
||||
// either to a cleanup block or a block with EH resume instruction.
|
||||
auto *ResumeBB = CGF.getEHResumeBlock(/*cleanup=*/true);
|
||||
auto *ResumeBB = CGF.getEHResumeBlock(/*isCleanup=*/true);
|
||||
auto *CleanupContBB = CGF.createBasicBlock("cleanup.cont");
|
||||
CGF.Builder.CreateCondBr(CoroEnd, ResumeBB, CleanupContBB);
|
||||
CGF.EmitBlock(CleanupContBB);
|
||||
|
|
|
@ -176,7 +176,7 @@ void CodeGenFunction::EmitVarDecl(const VarDecl &D) {
|
|||
return;
|
||||
|
||||
llvm::GlobalValue::LinkageTypes Linkage =
|
||||
CGM.getLLVMLinkageVarDefinition(&D, /*isConstant=*/false);
|
||||
CGM.getLLVMLinkageVarDefinition(&D, /*IsConstant=*/false);
|
||||
|
||||
// FIXME: We need to force the emission/use of a guard variable for
|
||||
// some variables even if we can constant-evaluate them because
|
||||
|
|
|
@ -32,7 +32,7 @@ static llvm::FunctionCallee getFreeExceptionFn(CodeGenModule &CGM) {
|
|||
// void __cxa_free_exception(void *thrown_exception);
|
||||
|
||||
llvm::FunctionType *FTy =
|
||||
llvm::FunctionType::get(CGM.VoidTy, CGM.Int8PtrTy, /*IsVarArgs=*/false);
|
||||
llvm::FunctionType::get(CGM.VoidTy, CGM.Int8PtrTy, /*isVarArg=*/false);
|
||||
|
||||
return CGM.CreateRuntimeFunction(FTy, "__cxa_free_exception");
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ static llvm::FunctionCallee getUnexpectedFn(CodeGenModule &CGM) {
|
|||
// void __cxa_call_unexpected(void *thrown_exception);
|
||||
|
||||
llvm::FunctionType *FTy =
|
||||
llvm::FunctionType::get(CGM.VoidTy, CGM.Int8PtrTy, /*IsVarArgs=*/false);
|
||||
llvm::FunctionType::get(CGM.VoidTy, CGM.Int8PtrTy, /*isVarArg=*/false);
|
||||
|
||||
return CGM.CreateRuntimeFunction(FTy, "__cxa_call_unexpected");
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ llvm::FunctionCallee CodeGenModule::getTerminateFn() {
|
|||
// void __terminate();
|
||||
|
||||
llvm::FunctionType *FTy =
|
||||
llvm::FunctionType::get(VoidTy, /*IsVarArgs=*/false);
|
||||
llvm::FunctionType::get(VoidTy, /*isVarArg=*/false);
|
||||
|
||||
StringRef name;
|
||||
|
||||
|
@ -75,7 +75,7 @@ llvm::FunctionCallee CodeGenModule::getTerminateFn() {
|
|||
static llvm::FunctionCallee getCatchallRethrowFn(CodeGenModule &CGM,
|
||||
StringRef Name) {
|
||||
llvm::FunctionType *FTy =
|
||||
llvm::FunctionType::get(CGM.VoidTy, CGM.Int8PtrTy, /*IsVarArgs=*/false);
|
||||
llvm::FunctionType::get(CGM.VoidTy, CGM.Int8PtrTy, /*isVarArg=*/false);
|
||||
|
||||
return CGM.CreateRuntimeFunction(FTy, Name);
|
||||
}
|
||||
|
|
|
@ -2031,7 +2031,7 @@ void CodeGenFunction::EmitStoreThroughBitfieldLValue(RValue Src, LValue Dst,
|
|||
|
||||
// Cast the source to the storage type and shift it into place.
|
||||
SrcVal = Builder.CreateIntCast(SrcVal, Ptr.getElementType(),
|
||||
/*IsSigned=*/false);
|
||||
/*isSigned=*/false);
|
||||
llvm::Value *MaskedVal = SrcVal;
|
||||
|
||||
// See if there are other bits in the bitfield's storage we'll need to load
|
||||
|
@ -2611,7 +2611,7 @@ LValue CodeGenFunction::EmitDeclRefLValue(const DeclRefExpr *E) {
|
|||
// some reason; most likely, because it's in an outer function.
|
||||
} else if (VD->isStaticLocal()) {
|
||||
addr = Address(CGM.getOrCreateStaticVarDecl(
|
||||
*VD, CGM.getLLVMLinkageVarDefinition(VD, /*isConstant=*/false)),
|
||||
*VD, CGM.getLLVMLinkageVarDefinition(VD, /*IsConstant=*/false)),
|
||||
getContext().getDeclAlign(VD));
|
||||
|
||||
// No other cases for now.
|
||||
|
@ -3749,7 +3749,7 @@ LValue CodeGenFunction::EmitOMPArraySectionExpr(const OMPArraySectionExpr *E,
|
|||
Idx = Builder.CreateNSWMul(Idx, NumElements);
|
||||
EltPtr = emitArraySubscriptGEP(*this, Base, Idx, VLA->getElementType(),
|
||||
!getLangOpts().isSignedOverflowDefined(),
|
||||
/*SignedIndices=*/false, E->getExprLoc());
|
||||
/*signedIndices=*/false, E->getExprLoc());
|
||||
} else if (const Expr *Array = isSimpleArrayDecayOperand(E->getBase())) {
|
||||
// If this is A[i] where A is an array, the frontend will have decayed the
|
||||
// base to be a ArrayToPointerDecay implicit cast. While correct, it is
|
||||
|
@ -3769,7 +3769,7 @@ LValue CodeGenFunction::EmitOMPArraySectionExpr(const OMPArraySectionExpr *E,
|
|||
EltPtr = emitArraySubscriptGEP(
|
||||
*this, ArrayLV.getAddress(), {CGM.getSize(CharUnits::Zero()), Idx},
|
||||
ResultExprTy, !getLangOpts().isSignedOverflowDefined(),
|
||||
/*SignedIndices=*/false, E->getExprLoc());
|
||||
/*signedIndices=*/false, E->getExprLoc());
|
||||
BaseInfo = ArrayLV.getBaseInfo();
|
||||
TBAAInfo = CGM.getTBAAInfoForSubobject(ArrayLV, ResultExprTy);
|
||||
} else {
|
||||
|
@ -3778,7 +3778,7 @@ LValue CodeGenFunction::EmitOMPArraySectionExpr(const OMPArraySectionExpr *E,
|
|||
IsLowerBound);
|
||||
EltPtr = emitArraySubscriptGEP(*this, Base, Idx, ResultExprTy,
|
||||
!getLangOpts().isSignedOverflowDefined(),
|
||||
/*SignedIndices=*/false, E->getExprLoc());
|
||||
/*signedIndices=*/false, E->getExprLoc());
|
||||
}
|
||||
|
||||
return MakeAddrLValue(EltPtr, ResultExprTy, BaseInfo, TBAAInfo);
|
||||
|
@ -4867,7 +4867,7 @@ RValue CodeGenFunction::EmitCall(QualType CalleeType, const CGCallee &OrigCallee
|
|||
E->getDirectCallee(), /*ParamsToSkip*/ 0, Order);
|
||||
|
||||
const CGFunctionInfo &FnInfo = CGM.getTypes().arrangeFreeFunctionCall(
|
||||
Args, FnType, /*isChainCall=*/Chain);
|
||||
Args, FnType, /*ChainCall=*/Chain);
|
||||
|
||||
// C99 6.5.2.2p6:
|
||||
// If the expression that denotes the called function has a type
|
||||
|
|
|
@ -1277,7 +1277,7 @@ static RValue EmitNewDeleteCall(CodeGenFunction &CGF,
|
|||
CGCallee Callee = CGCallee::forDirect(CalleePtr, GlobalDecl(CalleeDecl));
|
||||
RValue RV =
|
||||
CGF.EmitCall(CGF.CGM.getTypes().arrangeFreeFunctionCall(
|
||||
Args, CalleeType, /*chainCall=*/false),
|
||||
Args, CalleeType, /*ChainCall=*/false),
|
||||
Callee, ReturnValueSlot(), Args, &CallOrInvoke);
|
||||
|
||||
/// C++1y [expr.new]p10:
|
||||
|
|
|
@ -1878,7 +1878,7 @@ ConstantLValueEmitter::tryEmitBase(const APValue::LValueBase &base) {
|
|||
|
||||
if (VD->isLocalVarDecl()) {
|
||||
return CGM.getOrCreateStaticVarDecl(
|
||||
*VD, CGM.getLLVMLinkageVarDefinition(VD, /*isConstant=*/false));
|
||||
*VD, CGM.getLLVMLinkageVarDefinition(VD, /*IsConstant=*/false));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3735,7 +3735,7 @@ void CodeGenModule::emitAtAvailableLinkGuard() {
|
|||
llvm::FunctionType *CheckFTy = llvm::FunctionType::get(VoidTy, {}, false);
|
||||
llvm::FunctionCallee CFLinkCheckFuncRef = CreateRuntimeFunction(
|
||||
CheckFTy, "__clang_at_available_requires_core_foundation_framework",
|
||||
llvm::AttributeList(), /*IsLocal=*/true);
|
||||
llvm::AttributeList(), /*Local=*/true);
|
||||
llvm::Function *CFLinkCheckFunc =
|
||||
cast<llvm::Function>(CFLinkCheckFuncRef.getCallee()->stripPointerCasts());
|
||||
if (CFLinkCheckFunc->empty()) {
|
||||
|
|
|
@ -2898,7 +2898,7 @@ Address CGOpenMPRuntime::getAddrOfArtificialThreadPrivate(CodeGenFunction &CGF,
|
|||
getThreadID(CGF, SourceLocation()),
|
||||
CGF.Builder.CreatePointerBitCastOrAddrSpaceCast(GAddr, CGM.VoidPtrTy),
|
||||
CGF.Builder.CreateIntCast(CGF.getTypeSize(VarType), CGM.SizeTy,
|
||||
/*IsSigned=*/false),
|
||||
/*isSigned=*/false),
|
||||
getOrCreateInternalVariable(
|
||||
CGM.VoidPtrPtrTy, Twine(Name).concat(Suffix).concat(CacheSuffix))};
|
||||
return Address(
|
||||
|
@ -5254,7 +5254,7 @@ void CGOpenMPRuntime::emitTaskCall(CodeGenFunction &CGF, SourceLocation Loc,
|
|||
if (const auto *ASE =
|
||||
dyn_cast<OMPArraySectionExpr>(E->IgnoreParenImpCasts())) {
|
||||
LValue UpAddrLVal =
|
||||
CGF.EmitOMPArraySectionExpr(ASE, /*LowerBound=*/false);
|
||||
CGF.EmitOMPArraySectionExpr(ASE, /*IsLowerBound=*/false);
|
||||
llvm::Value *UpAddr =
|
||||
CGF.Builder.CreateConstGEP1_32(UpAddrLVal.getPointer(), /*Idx0=*/1);
|
||||
llvm::Value *LowIntPtr =
|
||||
|
@ -6293,7 +6293,7 @@ llvm::Value *CGOpenMPRuntime::emitTaskReductionInit(
|
|||
LValue FlagsLVal = CGF.EmitLValueForField(ElemLVal, FlagsFD);
|
||||
if (DelayedCreation) {
|
||||
CGF.EmitStoreOfScalar(
|
||||
llvm::ConstantInt::get(CGM.Int32Ty, /*V=*/1, /*IsSigned=*/true),
|
||||
llvm::ConstantInt::get(CGM.Int32Ty, /*V=*/1, /*isSigned=*/true),
|
||||
FlagsLVal);
|
||||
} else
|
||||
CGF.EmitNullInitialization(FlagsLVal.getAddress(), FlagsLVal.getType());
|
||||
|
@ -6649,7 +6649,7 @@ emitNumTeamsForTargetDirective(CodeGenFunction &CGF,
|
|||
CGF.EmitScalarExpr(NumTeams,
|
||||
/*IgnoreResultAssign*/ true);
|
||||
return Bld.CreateIntCast(NumTeamsVal, CGF.Int32Ty,
|
||||
/*IsSigned=*/true);
|
||||
/*isSigned=*/true);
|
||||
}
|
||||
return Bld.getInt32(0);
|
||||
}
|
||||
|
@ -6673,7 +6673,7 @@ emitNumTeamsForTargetDirective(CodeGenFunction &CGF,
|
|||
CGF.EmitScalarExpr(NumTeams,
|
||||
/*IgnoreResultAssign*/ true);
|
||||
return Bld.CreateIntCast(NumTeamsVal, CGF.Int32Ty,
|
||||
/*IsSigned=*/true);
|
||||
/*isSigned=*/true);
|
||||
}
|
||||
return Bld.getInt32(0);
|
||||
}
|
||||
|
@ -6801,7 +6801,7 @@ static llvm::Value *getNumThreads(CodeGenFunction &CGF, const CapturedStmt *CS,
|
|||
}
|
||||
NumThreads = CGF.EmitScalarExpr(NumThreadsClause->getNumThreads());
|
||||
NumThreads = CGF.Builder.CreateIntCast(NumThreads, CGF.Int32Ty,
|
||||
/*IsSigned=*/false);
|
||||
/*isSigned=*/false);
|
||||
if (DefaultThreadLimitVal)
|
||||
NumThreads = CGF.Builder.CreateSelect(
|
||||
CGF.Builder.CreateICmpULT(DefaultThreadLimitVal, NumThreads),
|
||||
|
@ -6875,7 +6875,7 @@ emitNumThreadsForTargetDirective(CodeGenFunction &CGF,
|
|||
llvm::Value *ThreadLimit = CGF.EmitScalarExpr(
|
||||
ThreadLimitClause->getThreadLimit(), /*IgnoreResultAssign=*/true);
|
||||
ThreadLimitVal =
|
||||
Bld.CreateIntCast(ThreadLimit, CGF.Int32Ty, /*IsSigned=*/false);
|
||||
Bld.CreateIntCast(ThreadLimit, CGF.Int32Ty, /*isSigned=*/false);
|
||||
}
|
||||
if (isOpenMPTeamsDirective(Dir->getDirectiveKind()) &&
|
||||
!isOpenMPDistributeDirective(Dir->getDirectiveKind())) {
|
||||
|
@ -6902,7 +6902,7 @@ emitNumThreadsForTargetDirective(CodeGenFunction &CGF,
|
|||
llvm::Value *ThreadLimit = CGF.EmitScalarExpr(
|
||||
ThreadLimitClause->getThreadLimit(), /*IgnoreResultAssign=*/true);
|
||||
ThreadLimitVal =
|
||||
Bld.CreateIntCast(ThreadLimit, CGF.Int32Ty, /*IsSigned=*/false);
|
||||
Bld.CreateIntCast(ThreadLimit, CGF.Int32Ty, /*isSigned=*/false);
|
||||
}
|
||||
const CapturedStmt *CS = D.getInnermostCapturedStmt();
|
||||
if (llvm::Value *NumThreads = getNumThreads(CGF, CS, ThreadLimitVal))
|
||||
|
@ -6925,7 +6925,7 @@ emitNumThreadsForTargetDirective(CodeGenFunction &CGF,
|
|||
llvm::Value *ThreadLimit = CGF.EmitScalarExpr(
|
||||
ThreadLimitClause->getThreadLimit(), /*IgnoreResultAssign=*/true);
|
||||
ThreadLimitVal =
|
||||
Bld.CreateIntCast(ThreadLimit, CGF.Int32Ty, /*IsSigned=*/false);
|
||||
Bld.CreateIntCast(ThreadLimit, CGF.Int32Ty, /*isSigned=*/false);
|
||||
}
|
||||
return getNumThreads(CGF, D.getInnermostCapturedStmt(), ThreadLimitVal);
|
||||
case OMPD_target_parallel:
|
||||
|
@ -6963,7 +6963,7 @@ emitNumThreadsForTargetDirective(CodeGenFunction &CGF,
|
|||
llvm::Value *ThreadLimit = CGF.EmitScalarExpr(
|
||||
ThreadLimitClause->getThreadLimit(), /*IgnoreResultAssign=*/true);
|
||||
ThreadLimitVal =
|
||||
Bld.CreateIntCast(ThreadLimit, CGF.Int32Ty, /*IsSigned=*/false);
|
||||
Bld.CreateIntCast(ThreadLimit, CGF.Int32Ty, /*isSigned=*/false);
|
||||
}
|
||||
if (D.hasClausesOfKind<OMPNumThreadsClause>()) {
|
||||
CodeGenFunction::RunCleanupsScope NumThreadsScope(CGF);
|
||||
|
@ -6971,7 +6971,7 @@ emitNumThreadsForTargetDirective(CodeGenFunction &CGF,
|
|||
llvm::Value *NumThreads = CGF.EmitScalarExpr(
|
||||
NumThreadsClause->getNumThreads(), /*IgnoreResultAssign=*/true);
|
||||
NumThreadsVal =
|
||||
Bld.CreateIntCast(NumThreads, CGF.Int32Ty, /*IsSigned=*/false);
|
||||
Bld.CreateIntCast(NumThreads, CGF.Int32Ty, /*isSigned=*/false);
|
||||
ThreadLimitVal = ThreadLimitVal
|
||||
? Bld.CreateSelect(Bld.CreateICmpULT(NumThreadsVal,
|
||||
ThreadLimitVal),
|
||||
|
@ -7865,7 +7865,7 @@ public:
|
|||
llvm::Value *CHAddr = CGF.Builder.CreatePointerCast(HAddr, CGF.VoidPtrTy);
|
||||
llvm::Value *Diff = CGF.Builder.CreatePtrDiff(CHAddr, CLAddr);
|
||||
llvm::Value *Size = CGF.Builder.CreateIntCast(Diff, CGF.Int64Ty,
|
||||
/*isSinged=*/false);
|
||||
/*isSigned=*/false);
|
||||
Sizes.push_back(Size);
|
||||
// Map type is always TARGET_PARAM
|
||||
Types.push_back(OMP_MAP_TARGET_PARAM);
|
||||
|
@ -8416,7 +8416,7 @@ public:
|
|||
CGF.Builder.CreateMemCpy(
|
||||
CGF.MakeNaturalAlignAddrLValue(Addr, ElementType).getAddress(),
|
||||
Address(CV, CGF.getContext().getTypeAlignInChars(ElementType)),
|
||||
CurSizes.back(), /*isVolatile=*/false);
|
||||
CurSizes.back(), /*IsVolatile=*/false);
|
||||
// Use new global variable as the base pointers.
|
||||
CurBasePointers.push_back(Addr);
|
||||
CurPointers.push_back(Addr);
|
||||
|
|
|
@ -3603,7 +3603,7 @@ static void emitSimpleAtomicStore(CodeGenFunction &CGF, bool IsSeqCst,
|
|||
CGF.EmitAtomicStore(RVal, LVal,
|
||||
IsSeqCst ? llvm::AtomicOrdering::SequentiallyConsistent
|
||||
: llvm::AtomicOrdering::Monotonic,
|
||||
LVal.isVolatile(), /*IsInit=*/false);
|
||||
LVal.isVolatile(), /*isInit=*/false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4095,7 +4095,7 @@ static void emitCommonOMPTargetDirective(CodeGenFunction &CGF,
|
|||
// Emit calculation of the iterations count.
|
||||
llvm::Value *NumIterations = CGF.EmitScalarExpr(D.getNumIterations());
|
||||
NumIterations = CGF.Builder.CreateIntCast(NumIterations, CGF.Int64Ty,
|
||||
/*IsSigned=*/false);
|
||||
/*isSigned=*/false);
|
||||
return NumIterations;
|
||||
};
|
||||
if (IsOffloadEntry)
|
||||
|
|
|
@ -59,7 +59,7 @@ CodeGen::arrangeFreeFunctionCall(CodeGenModule &CGM,
|
|||
FunctionType::ExtInfo info,
|
||||
RequiredArgs args) {
|
||||
return CGM.getTypes().arrangeLLVMFunctionInfo(
|
||||
returnType, /*IsInstanceMethod=*/false, /*IsChainCall=*/false, argTypes,
|
||||
returnType, /*instanceMethod=*/false, /*chainCall=*/false, argTypes,
|
||||
info, {}, args);
|
||||
}
|
||||
|
||||
|
|
|
@ -1199,7 +1199,7 @@ CodeGenModule::getFunctionLinkage(GlobalDecl GD) {
|
|||
return llvm::GlobalValue::InternalLinkage;
|
||||
}
|
||||
|
||||
return getLLVMLinkageForDeclarator(D, Linkage, /*isConstantVariable=*/false);
|
||||
return getLLVMLinkageForDeclarator(D, Linkage, /*IsConstantVariable=*/false);
|
||||
}
|
||||
|
||||
llvm::ConstantInt *CodeGenModule::CreateCrossDsoCfiTypeId(llvm::Metadata *MD) {
|
||||
|
|
|
@ -1281,7 +1281,7 @@ std::string getCoverageSection(const CodeGenModule &CGM) {
|
|||
std::string normalizeFilename(StringRef Filename) {
|
||||
llvm::SmallString<256> Path(Filename);
|
||||
llvm::sys::fs::make_absolute(Path);
|
||||
llvm::sys::path::remove_dots(Path, /*remove_dot_dots=*/true);
|
||||
llvm::sys::path::remove_dots(Path, /*remove_dot_dot=*/true);
|
||||
return Path.str().str();
|
||||
}
|
||||
|
||||
|
|
|
@ -1138,7 +1138,7 @@ void ItaniumCXXABI::emitRethrow(CodeGenFunction &CGF, bool isNoReturn) {
|
|||
// void __cxa_rethrow();
|
||||
|
||||
llvm::FunctionType *FTy =
|
||||
llvm::FunctionType::get(CGM.VoidTy, /*IsVarArgs=*/false);
|
||||
llvm::FunctionType::get(CGM.VoidTy, /*isVarArg=*/false);
|
||||
|
||||
llvm::FunctionCallee Fn = CGM.CreateRuntimeFunction(FTy, "__cxa_rethrow");
|
||||
|
||||
|
@ -1152,7 +1152,7 @@ static llvm::FunctionCallee getAllocateExceptionFn(CodeGenModule &CGM) {
|
|||
// void *__cxa_allocate_exception(size_t thrown_size);
|
||||
|
||||
llvm::FunctionType *FTy =
|
||||
llvm::FunctionType::get(CGM.Int8PtrTy, CGM.SizeTy, /*IsVarArgs=*/false);
|
||||
llvm::FunctionType::get(CGM.Int8PtrTy, CGM.SizeTy, /*isVarArg=*/false);
|
||||
|
||||
return CGM.CreateRuntimeFunction(FTy, "__cxa_allocate_exception");
|
||||
}
|
||||
|
@ -1163,7 +1163,7 @@ static llvm::FunctionCallee getThrowFn(CodeGenModule &CGM) {
|
|||
|
||||
llvm::Type *Args[3] = { CGM.Int8PtrTy, CGM.Int8PtrTy, CGM.Int8PtrTy };
|
||||
llvm::FunctionType *FTy =
|
||||
llvm::FunctionType::get(CGM.VoidTy, Args, /*IsVarArgs=*/false);
|
||||
llvm::FunctionType::get(CGM.VoidTy, Args, /*isVarArg=*/false);
|
||||
|
||||
return CGM.CreateRuntimeFunction(FTy, "__cxa_throw");
|
||||
}
|
||||
|
@ -2402,7 +2402,7 @@ static bool isThreadWrapperReplaceable(const VarDecl *VD,
|
|||
static llvm::GlobalValue::LinkageTypes
|
||||
getThreadLocalWrapperLinkage(const VarDecl *VD, CodeGen::CodeGenModule &CGM) {
|
||||
llvm::GlobalValue::LinkageTypes VarLinkage =
|
||||
CGM.getLLVMLinkageVarDefinition(VD, /*isConstant=*/false);
|
||||
CGM.getLLVMLinkageVarDefinition(VD, /*IsConstant=*/false);
|
||||
|
||||
// For internal linkage variables, we don't need an external or weak wrapper.
|
||||
if (llvm::GlobalValue::isLocalLinkage(VarLinkage))
|
||||
|
@ -2780,7 +2780,7 @@ ItaniumRTTIBuilder::GetAddrOfExternalRTTIDescriptor(QualType Ty) {
|
|||
// RTTI, check if emitting vtables opportunistically need any adjustment.
|
||||
|
||||
GV = new llvm::GlobalVariable(CGM.getModule(), CGM.Int8PtrTy,
|
||||
/*Constant=*/true,
|
||||
/*isConstant=*/true,
|
||||
llvm::GlobalValue::ExternalLinkage, nullptr,
|
||||
Name);
|
||||
const CXXRecordDecl *RD = Ty->getAsCXXRecordDecl();
|
||||
|
@ -3385,7 +3385,7 @@ llvm::Constant *ItaniumRTTIBuilder::BuildTypeInfo(
|
|||
llvm::GlobalVariable *OldGV = M.getNamedGlobal(Name);
|
||||
llvm::GlobalVariable *GV =
|
||||
new llvm::GlobalVariable(M, Init->getType(),
|
||||
/*Constant=*/true, Linkage, Init, Name);
|
||||
/*isConstant=*/true, Linkage, Init, Name);
|
||||
|
||||
// If there's already an old global variable, replace it with the new one.
|
||||
if (OldGV) {
|
||||
|
@ -3906,7 +3906,7 @@ void ItaniumCXXABI::emitCXXStructor(GlobalDecl GD) {
|
|||
static llvm::FunctionCallee getBeginCatchFn(CodeGenModule &CGM) {
|
||||
// void *__cxa_begin_catch(void*);
|
||||
llvm::FunctionType *FTy = llvm::FunctionType::get(
|
||||
CGM.Int8PtrTy, CGM.Int8PtrTy, /*IsVarArgs=*/false);
|
||||
CGM.Int8PtrTy, CGM.Int8PtrTy, /*isVarArg=*/false);
|
||||
|
||||
return CGM.CreateRuntimeFunction(FTy, "__cxa_begin_catch");
|
||||
}
|
||||
|
@ -3914,7 +3914,7 @@ static llvm::FunctionCallee getBeginCatchFn(CodeGenModule &CGM) {
|
|||
static llvm::FunctionCallee getEndCatchFn(CodeGenModule &CGM) {
|
||||
// void __cxa_end_catch();
|
||||
llvm::FunctionType *FTy =
|
||||
llvm::FunctionType::get(CGM.VoidTy, /*IsVarArgs=*/false);
|
||||
llvm::FunctionType::get(CGM.VoidTy, /*isVarArg=*/false);
|
||||
|
||||
return CGM.CreateRuntimeFunction(FTy, "__cxa_end_catch");
|
||||
}
|
||||
|
@ -3922,7 +3922,7 @@ static llvm::FunctionCallee getEndCatchFn(CodeGenModule &CGM) {
|
|||
static llvm::FunctionCallee getGetExceptionPtrFn(CodeGenModule &CGM) {
|
||||
// void *__cxa_get_exception_ptr(void*);
|
||||
llvm::FunctionType *FTy = llvm::FunctionType::get(
|
||||
CGM.Int8PtrTy, CGM.Int8PtrTy, /*IsVarArgs=*/false);
|
||||
CGM.Int8PtrTy, CGM.Int8PtrTy, /*isVarArg=*/false);
|
||||
|
||||
return CGM.CreateRuntimeFunction(FTy, "__cxa_get_exception_ptr");
|
||||
}
|
||||
|
@ -4196,9 +4196,9 @@ void ItaniumCXXABI::emitBeginCatch(CodeGenFunction &CGF,
|
|||
/// This code is used only in C++.
|
||||
static llvm::FunctionCallee getClangCallTerminateFn(CodeGenModule &CGM) {
|
||||
llvm::FunctionType *fnTy =
|
||||
llvm::FunctionType::get(CGM.VoidTy, CGM.Int8PtrTy, /*IsVarArgs=*/false);
|
||||
llvm::FunctionType::get(CGM.VoidTy, CGM.Int8PtrTy, /*isVarArg=*/false);
|
||||
llvm::FunctionCallee fnRef = CGM.CreateRuntimeFunction(
|
||||
fnTy, "__clang_call_terminate", llvm::AttributeList(), /*IsLocal=*/true);
|
||||
fnTy, "__clang_call_terminate", llvm::AttributeList(), /*Local=*/true);
|
||||
llvm::Function *fn =
|
||||
cast<llvm::Function>(fnRef.getCallee()->stripPointerCasts());
|
||||
if (fn->empty()) {
|
||||
|
|
|
@ -352,7 +352,7 @@ public:
|
|||
? llvm::GlobalValue::LinkOnceODRLinkage
|
||||
: llvm::GlobalValue::InternalLinkage;
|
||||
auto *VDispMap = new llvm::GlobalVariable(
|
||||
CGM.getModule(), VDispMapTy, /*Constant=*/true, Linkage,
|
||||
CGM.getModule(), VDispMapTy, /*isConstant=*/true, Linkage,
|
||||
/*Initializer=*/Init, MangledName);
|
||||
return VDispMap;
|
||||
}
|
||||
|
@ -436,7 +436,7 @@ public:
|
|||
friend struct MSRTTIBuilder;
|
||||
|
||||
bool isImageRelative() const {
|
||||
return CGM.getTarget().getPointerWidth(/*AddressSpace=*/0) == 64;
|
||||
return CGM.getTarget().getPointerWidth(/*AddrSpace=*/0) == 64;
|
||||
}
|
||||
|
||||
// 5 routines for constructing the llvm types for MS RTTI structs.
|
||||
|
@ -730,7 +730,7 @@ public:
|
|||
// which describes the exception.
|
||||
llvm::Type *Args[] = {CGM.Int8PtrTy, getThrowInfoType()->getPointerTo()};
|
||||
llvm::FunctionType *FTy =
|
||||
llvm::FunctionType::get(CGM.VoidTy, Args, /*IsVarArgs=*/false);
|
||||
llvm::FunctionType::get(CGM.VoidTy, Args, /*isVarArg=*/false);
|
||||
llvm::FunctionCallee Throw =
|
||||
CGM.CreateRuntimeFunction(FTy, "_CxxThrowException");
|
||||
// _CxxThrowException is stdcall on 32-bit x86 platforms.
|
||||
|
@ -1313,7 +1313,7 @@ llvm::GlobalValue::LinkageTypes MicrosoftCXXABI::getCXXDestructorLinkage(
|
|||
// The base destructor most closely tracks the user-declared constructor, so
|
||||
// we delegate back to the normal declarator case.
|
||||
return CGM.getLLVMLinkageForDeclarator(Dtor, Linkage,
|
||||
/*isConstantVariable=*/false);
|
||||
/*IsConstantVariable=*/false);
|
||||
case Dtor_Complete:
|
||||
// The complete destructor is like an inline function, but it may be
|
||||
// imported and therefore must be exported as well. This requires changing
|
||||
|
@ -2250,7 +2250,7 @@ static void emitGlobalDtorWithTLRegDtor(CodeGenFunction &CGF, const VarDecl &VD,
|
|||
|
||||
// extern "C" int __tlregdtor(void (*f)(void));
|
||||
llvm::FunctionType *TLRegDtorTy = llvm::FunctionType::get(
|
||||
CGF.IntTy, DtorStub->getType(), /*IsVarArg=*/false);
|
||||
CGF.IntTy, DtorStub->getType(), /*isVarArg=*/false);
|
||||
|
||||
llvm::FunctionCallee TLRegDtor = CGF.CGM.CreateRuntimeFunction(
|
||||
TLRegDtorTy, "__tlregdtor", llvm::AttributeList(), /*Local=*/true);
|
||||
|
@ -2291,7 +2291,7 @@ void MicrosoftCXXABI::EmitThreadLocalInitFuncs(
|
|||
// pointers at start-up time and, eventually, at thread-creation time.
|
||||
auto AddToXDU = [&CGM](llvm::Function *InitFunc) {
|
||||
llvm::GlobalVariable *InitFuncPtr = new llvm::GlobalVariable(
|
||||
CGM.getModule(), InitFunc->getType(), /*IsConstant=*/true,
|
||||
CGM.getModule(), InitFunc->getType(), /*isConstant=*/true,
|
||||
llvm::GlobalVariable::InternalLinkage, InitFunc,
|
||||
Twine(InitFunc->getName(), "$initializer$"));
|
||||
InitFuncPtr->setSection(".CRT$XDU");
|
||||
|
@ -2340,7 +2340,7 @@ static ConstantAddress getInitThreadEpochPtr(CodeGenModule &CGM) {
|
|||
return ConstantAddress(GV, Align);
|
||||
auto *GV = new llvm::GlobalVariable(
|
||||
CGM.getModule(), CGM.IntTy,
|
||||
/*Constant=*/false, llvm::GlobalVariable::ExternalLinkage,
|
||||
/*isConstant=*/false, llvm::GlobalVariable::ExternalLinkage,
|
||||
/*Initializer=*/nullptr, VarName,
|
||||
/*InsertBefore=*/nullptr, llvm::GlobalVariable::GeneralDynamicTLSModel);
|
||||
GV->setAlignment(Align.getQuantity());
|
||||
|
@ -3400,7 +3400,7 @@ static llvm::GlobalVariable *getTypeInfoVTable(CodeGenModule &CGM) {
|
|||
if (auto VTable = CGM.getModule().getNamedGlobal(MangledName))
|
||||
return VTable;
|
||||
return new llvm::GlobalVariable(CGM.getModule(), CGM.Int8PtrTy,
|
||||
/*Constant=*/true,
|
||||
/*isConstant=*/true,
|
||||
llvm::GlobalVariable::ExternalLinkage,
|
||||
/*Initializer=*/nullptr, MangledName);
|
||||
}
|
||||
|
@ -3580,7 +3580,7 @@ llvm::GlobalVariable *MSRTTIBuilder::getClassHierarchyDescriptor() {
|
|||
|
||||
// Forward-declare the class hierarchy descriptor
|
||||
auto Type = ABI.getClassHierarchyDescriptorType();
|
||||
auto CHD = new llvm::GlobalVariable(Module, Type, /*Constant=*/true, Linkage,
|
||||
auto CHD = new llvm::GlobalVariable(Module, Type, /*isConstant=*/true, Linkage,
|
||||
/*Initializer=*/nullptr,
|
||||
MangledName);
|
||||
if (CHD->isWeakForLinker())
|
||||
|
@ -3619,7 +3619,7 @@ MSRTTIBuilder::getBaseClassArray(SmallVectorImpl<MSRTTIClass> &Classes) {
|
|||
auto *ArrType = llvm::ArrayType::get(PtrType, Classes.size() + 1);
|
||||
auto *BCA =
|
||||
new llvm::GlobalVariable(Module, ArrType,
|
||||
/*Constant=*/true, Linkage,
|
||||
/*isConstant=*/true, Linkage,
|
||||
/*Initializer=*/nullptr, MangledName);
|
||||
if (BCA->isWeakForLinker())
|
||||
BCA->setComdat(CGM.getModule().getOrInsertComdat(BCA->getName()));
|
||||
|
@ -3661,7 +3661,7 @@ MSRTTIBuilder::getBaseClassDescriptor(const MSRTTIClass &Class) {
|
|||
// Forward-declare the base class descriptor.
|
||||
auto Type = ABI.getBaseClassDescriptorType();
|
||||
auto BCD =
|
||||
new llvm::GlobalVariable(Module, Type, /*Constant=*/true, Linkage,
|
||||
new llvm::GlobalVariable(Module, Type, /*isConstant=*/true, Linkage,
|
||||
/*Initializer=*/nullptr, MangledName);
|
||||
if (BCD->isWeakForLinker())
|
||||
BCD->setComdat(CGM.getModule().getOrInsertComdat(BCD->getName()));
|
||||
|
@ -3707,7 +3707,7 @@ MSRTTIBuilder::getCompleteObjectLocator(const VPtrInfo &Info) {
|
|||
|
||||
// Forward-declare the complete object locator.
|
||||
llvm::StructType *Type = ABI.getCompleteObjectLocatorType();
|
||||
auto COL = new llvm::GlobalVariable(Module, Type, /*Constant=*/true, Linkage,
|
||||
auto COL = new llvm::GlobalVariable(Module, Type, /*isConstant=*/true, Linkage,
|
||||
/*Initializer=*/nullptr, MangledName);
|
||||
|
||||
// Initialize the CompleteObjectLocator.
|
||||
|
@ -3822,7 +3822,7 @@ llvm::Constant *MicrosoftCXXABI::getAddrOfRTTIDescriptor(QualType Type) {
|
|||
llvm::StructType *TypeDescriptorType =
|
||||
getTypeDescriptorType(TypeInfoString);
|
||||
auto *Var = new llvm::GlobalVariable(
|
||||
CGM.getModule(), TypeDescriptorType, /*Constant=*/false,
|
||||
CGM.getModule(), TypeDescriptorType, /*isConstant=*/false,
|
||||
getLinkageForRTTI(Type),
|
||||
llvm::ConstantStruct::get(TypeDescriptorType, Fields),
|
||||
MangledName);
|
||||
|
@ -4061,7 +4061,7 @@ llvm::Constant *MicrosoftCXXABI::getCatchableType(QualType T,
|
|||
};
|
||||
llvm::StructType *CTType = getCatchableTypeType();
|
||||
auto *GV = new llvm::GlobalVariable(
|
||||
CGM.getModule(), CTType, /*Constant=*/true, getLinkageForRTTI(T),
|
||||
CGM.getModule(), CTType, /*isConstant=*/true, getLinkageForRTTI(T),
|
||||
llvm::ConstantStruct::get(CTType, Fields), MangledName);
|
||||
GV->setUnnamedAddr(llvm::GlobalValue::UnnamedAddr::Global);
|
||||
GV->setSection(".xdata");
|
||||
|
@ -4179,7 +4179,7 @@ llvm::GlobalVariable *MicrosoftCXXABI::getCatchableTypeArray(QualType T) {
|
|||
getMangleContext().mangleCXXCatchableTypeArray(T, NumEntries, Out);
|
||||
}
|
||||
CTA = new llvm::GlobalVariable(
|
||||
CGM.getModule(), CTAType, /*Constant=*/true, getLinkageForRTTI(T),
|
||||
CGM.getModule(), CTAType, /*isConstant=*/true, getLinkageForRTTI(T),
|
||||
llvm::ConstantStruct::get(CTAType, Fields), MangledName);
|
||||
CTA->setUnnamedAddr(llvm::GlobalValue::UnnamedAddr::Global);
|
||||
CTA->setSection(".xdata");
|
||||
|
@ -4248,7 +4248,7 @@ llvm::GlobalVariable *MicrosoftCXXABI::getThrowInfo(QualType T) {
|
|||
PointerToCatchableTypes // CatchableTypeArray
|
||||
};
|
||||
auto *GV = new llvm::GlobalVariable(
|
||||
CGM.getModule(), TIType, /*Constant=*/true, getLinkageForRTTI(T),
|
||||
CGM.getModule(), TIType, /*isConstant=*/true, getLinkageForRTTI(T),
|
||||
llvm::ConstantStruct::get(TIType, Fields), StringRef(MangledName));
|
||||
GV->setUnnamedAddr(llvm::GlobalValue::UnnamedAddr::Global);
|
||||
GV->setSection(".xdata");
|
||||
|
|
|
@ -833,7 +833,7 @@ ABIArgInfo WebAssemblyABIInfo::classifyReturnType(QualType RetTy) const {
|
|||
|
||||
Address WebAssemblyABIInfo::EmitVAArg(CodeGenFunction &CGF, Address VAListAddr,
|
||||
QualType Ty) const {
|
||||
return emitVoidPtrVAArg(CGF, VAListAddr, Ty, /*Indirect=*/ false,
|
||||
return emitVoidPtrVAArg(CGF, VAListAddr, Ty, /*IsIndirect=*/ false,
|
||||
getContext().getTypeInfoInChars(Ty),
|
||||
CharUnits::fromQuantity(4),
|
||||
/*AllowHigherAlign=*/ true);
|
||||
|
|
|
@ -4023,9 +4023,9 @@ InputInfo Driver::BuildJobsForActionNoCache(
|
|||
Input.claim();
|
||||
if (Input.getOption().matches(options::OPT_INPUT)) {
|
||||
const char *Name = Input.getValue();
|
||||
return InputInfo(A, Name, /* BaseInput = */ Name);
|
||||
return InputInfo(A, Name, /* _BaseInput = */ Name);
|
||||
}
|
||||
return InputInfo(A, &Input, /* BaseInput = */ "");
|
||||
return InputInfo(A, &Input, /* _BaseInput = */ "");
|
||||
}
|
||||
|
||||
if (const BindArchAction *BAA = dyn_cast<BindArchAction>(A)) {
|
||||
|
|
|
@ -2971,7 +2971,7 @@ static void RenderObjCOptions(const ToolChain &TC, const Driver &D,
|
|||
// We default off for Objective-C, on for Objective-C++.
|
||||
if (Args.hasFlag(options::OPT_fobjc_arc_exceptions,
|
||||
options::OPT_fno_objc_arc_exceptions,
|
||||
/*default=*/types::isCXX(Input.getType())))
|
||||
/*Default=*/types::isCXX(Input.getType())))
|
||||
CmdArgs.push_back("-fobjc-arc-exceptions");
|
||||
}
|
||||
|
||||
|
@ -5702,7 +5702,7 @@ static EHFlags parseClangCLEHFlags(const Driver &D, const ArgList &Args) {
|
|||
// The default is that /GX is not specified.
|
||||
if (EHArgs.empty() &&
|
||||
Args.hasFlag(options::OPT__SLASH_GX, options::OPT__SLASH_GX_,
|
||||
/*default=*/false)) {
|
||||
/*Default=*/false)) {
|
||||
EH.Synch = true;
|
||||
EH.NoUnwindC = true;
|
||||
}
|
||||
|
@ -5771,13 +5771,13 @@ void Clang::AddClangCLArgs(const ArgList &Args, types::ID InputType,
|
|||
|
||||
// This controls whether or not we emit RTTI data for polymorphic types.
|
||||
if (Args.hasFlag(options::OPT__SLASH_GR_, options::OPT__SLASH_GR,
|
||||
/*default=*/false))
|
||||
/*Default=*/false))
|
||||
CmdArgs.push_back("-fno-rtti-data");
|
||||
|
||||
// This controls whether or not we emit stack-protector instrumentation.
|
||||
// In MSVC, Buffer Security Check (/GS) is on by default.
|
||||
if (Args.hasFlag(options::OPT__SLASH_GS, options::OPT__SLASH_GS_,
|
||||
/*default=*/true)) {
|
||||
/*Default=*/true)) {
|
||||
CmdArgs.push_back("-stack-protector");
|
||||
CmdArgs.push_back(Args.MakeArgString(Twine(LangOptions::SSPStrong)));
|
||||
}
|
||||
|
|
|
@ -626,11 +626,11 @@ std::unique_ptr<Command> visualstudio::Compiler::GetCommand(
|
|||
// FIXME: How can we ensure this stays in sync with relevant clang-cl options?
|
||||
|
||||
if (Args.hasFlag(options::OPT__SLASH_GR_, options::OPT__SLASH_GR,
|
||||
/*default=*/false))
|
||||
/*Default=*/false))
|
||||
CmdArgs.push_back("/GR-");
|
||||
|
||||
if (Args.hasFlag(options::OPT__SLASH_GS_, options::OPT__SLASH_GS,
|
||||
/*default=*/false))
|
||||
/*Default=*/false))
|
||||
CmdArgs.push_back("/GS-");
|
||||
|
||||
if (Arg *A = Args.getLastArg(options::OPT_ffunction_sections,
|
||||
|
|
|
@ -833,7 +833,7 @@ public:
|
|||
LineState State =
|
||||
Indenter->getInitialState(FirstIndent, FirstStartColumn, &Line, DryRun);
|
||||
while (State.NextToken) {
|
||||
formatChildren(State, /*Newline=*/false, DryRun, Penalty);
|
||||
formatChildren(State, /*NewLine=*/false, DryRun, Penalty);
|
||||
Indenter->addTokenToState(
|
||||
State, /*Newline=*/State.NextToken->MustBreakBefore, DryRun);
|
||||
}
|
||||
|
|
|
@ -139,7 +139,7 @@ GeneratePCHAction::CreateOutputFile(CompilerInstance &CI, StringRef InFile,
|
|||
std::unique_ptr<raw_pwrite_stream> OS =
|
||||
CI.createOutputFile(CI.getFrontendOpts().OutputFile, /*Binary=*/true,
|
||||
/*RemoveFileOnSignal=*/false, InFile,
|
||||
/*Extension=*/"", /*useTemporary=*/true);
|
||||
/*Extension=*/"", /*UseTemporary=*/true);
|
||||
if (!OS)
|
||||
return nullptr;
|
||||
|
||||
|
@ -215,7 +215,7 @@ GenerateModuleFromModuleMapAction::CreateOutputFile(CompilerInstance &CI,
|
|||
// We use a temporary to avoid race conditions.
|
||||
return CI.createOutputFile(CI.getFrontendOpts().OutputFile, /*Binary=*/true,
|
||||
/*RemoveFileOnSignal=*/false, InFile,
|
||||
/*Extension=*/"", /*useTemporary=*/true,
|
||||
/*Extension=*/"", /*UseTemporary=*/true,
|
||||
/*CreateMissingDirectories=*/true);
|
||||
}
|
||||
|
||||
|
|
|
@ -2428,7 +2428,7 @@ void RewriteModernObjC::SynthMsgSendFunctionDecl() {
|
|||
assert(!argT.isNull() && "Can't find 'SEL' type");
|
||||
ArgTys.push_back(argT);
|
||||
QualType msgSendType = getSimpleFunctionType(Context->getObjCIdType(),
|
||||
ArgTys, /*isVariadic=*/true);
|
||||
ArgTys, /*variadic=*/true);
|
||||
MsgSendFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
|
||||
SourceLocation(),
|
||||
SourceLocation(),
|
||||
|
@ -2442,7 +2442,7 @@ void RewriteModernObjC::SynthMsgSendSuperFunctionDecl() {
|
|||
SmallVector<QualType, 2> ArgTys;
|
||||
ArgTys.push_back(Context->VoidTy);
|
||||
QualType msgSendType = getSimpleFunctionType(Context->getObjCIdType(),
|
||||
ArgTys, /*isVariadic=*/true);
|
||||
ArgTys, /*variadic=*/true);
|
||||
MsgSendSuperFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
|
||||
SourceLocation(),
|
||||
SourceLocation(),
|
||||
|
@ -2461,7 +2461,7 @@ void RewriteModernObjC::SynthMsgSendStretFunctionDecl() {
|
|||
assert(!argT.isNull() && "Can't find 'SEL' type");
|
||||
ArgTys.push_back(argT);
|
||||
QualType msgSendType = getSimpleFunctionType(Context->getObjCIdType(),
|
||||
ArgTys, /*isVariadic=*/true);
|
||||
ArgTys, /*variadic=*/true);
|
||||
MsgSendStretFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
|
||||
SourceLocation(),
|
||||
SourceLocation(),
|
||||
|
@ -2477,7 +2477,7 @@ void RewriteModernObjC::SynthMsgSendSuperStretFunctionDecl() {
|
|||
SmallVector<QualType, 2> ArgTys;
|
||||
ArgTys.push_back(Context->VoidTy);
|
||||
QualType msgSendType = getSimpleFunctionType(Context->getObjCIdType(),
|
||||
ArgTys, /*isVariadic=*/true);
|
||||
ArgTys, /*variadic=*/true);
|
||||
MsgSendSuperStretFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
|
||||
SourceLocation(),
|
||||
SourceLocation(),
|
||||
|
@ -2497,7 +2497,7 @@ void RewriteModernObjC::SynthMsgSendFpretFunctionDecl() {
|
|||
assert(!argT.isNull() && "Can't find 'SEL' type");
|
||||
ArgTys.push_back(argT);
|
||||
QualType msgSendType = getSimpleFunctionType(Context->DoubleTy,
|
||||
ArgTys, /*isVariadic=*/true);
|
||||
ArgTys, /*variadic=*/true);
|
||||
MsgSendFpretFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
|
||||
SourceLocation(),
|
||||
SourceLocation(),
|
||||
|
|
|
@ -2335,7 +2335,7 @@ void RewriteObjC::SynthMsgSendFunctionDecl() {
|
|||
assert(!argT.isNull() && "Can't find 'SEL' type");
|
||||
ArgTys.push_back(argT);
|
||||
QualType msgSendType = getSimpleFunctionType(Context->getObjCIdType(),
|
||||
ArgTys, /*isVariadic=*/true);
|
||||
ArgTys, /*variadic=*/true);
|
||||
MsgSendFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
|
||||
SourceLocation(),
|
||||
SourceLocation(),
|
||||
|
@ -2357,7 +2357,7 @@ void RewriteObjC::SynthMsgSendSuperFunctionDecl() {
|
|||
assert(!argT.isNull() && "Can't find 'SEL' type");
|
||||
ArgTys.push_back(argT);
|
||||
QualType msgSendType = getSimpleFunctionType(Context->getObjCIdType(),
|
||||
ArgTys, /*isVariadic=*/true);
|
||||
ArgTys, /*variadic=*/true);
|
||||
MsgSendSuperFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
|
||||
SourceLocation(),
|
||||
SourceLocation(),
|
||||
|
@ -2376,7 +2376,7 @@ void RewriteObjC::SynthMsgSendStretFunctionDecl() {
|
|||
assert(!argT.isNull() && "Can't find 'SEL' type");
|
||||
ArgTys.push_back(argT);
|
||||
QualType msgSendType = getSimpleFunctionType(Context->getObjCIdType(),
|
||||
ArgTys, /*isVariadic=*/true);
|
||||
ArgTys, /*variadic=*/true);
|
||||
MsgSendStretFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
|
||||
SourceLocation(),
|
||||
SourceLocation(),
|
||||
|
@ -2400,7 +2400,7 @@ void RewriteObjC::SynthMsgSendSuperStretFunctionDecl() {
|
|||
assert(!argT.isNull() && "Can't find 'SEL' type");
|
||||
ArgTys.push_back(argT);
|
||||
QualType msgSendType = getSimpleFunctionType(Context->getObjCIdType(),
|
||||
ArgTys, /*isVariadic=*/true);
|
||||
ArgTys, /*variadic=*/true);
|
||||
MsgSendSuperStretFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
|
||||
SourceLocation(),
|
||||
SourceLocation(),
|
||||
|
@ -2420,7 +2420,7 @@ void RewriteObjC::SynthMsgSendFpretFunctionDecl() {
|
|||
assert(!argT.isNull() && "Can't find 'SEL' type");
|
||||
ArgTys.push_back(argT);
|
||||
QualType msgSendType = getSimpleFunctionType(Context->DoubleTy,
|
||||
ArgTys, /*isVariadic=*/true);
|
||||
ArgTys, /*variadic=*/true);
|
||||
MsgSendFpretFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
|
||||
SourceLocation(),
|
||||
SourceLocation(),
|
||||
|
|
|
@ -416,7 +416,7 @@ public:
|
|||
if (D->isThisDeclarationADefinition()) {
|
||||
TRY_DECL(D, IndexCtx.handleDecl(D));
|
||||
TRY_TO(handleReferencedProtocols(D->getReferencedProtocols(), D,
|
||||
/*superLoc=*/SourceLocation()));
|
||||
/*SuperLoc=*/SourceLocation()));
|
||||
TRY_TO(IndexCtx.indexDeclContext(D));
|
||||
} else {
|
||||
return IndexCtx.handleReference(D, D->getLocation(), nullptr,
|
||||
|
@ -466,7 +466,7 @@ public:
|
|||
CategoryLoc = D->getLocation();
|
||||
TRY_TO(IndexCtx.handleDecl(D, CategoryLoc));
|
||||
TRY_TO(handleReferencedProtocols(D->getReferencedProtocols(), D,
|
||||
/*superLoc=*/SourceLocation()));
|
||||
/*SuperLoc=*/SourceLocation()));
|
||||
TRY_TO(IndexCtx.indexDeclContext(D));
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -539,7 +539,7 @@ const FileEntry *DirectoryLookup::DoFrameworkLookup(
|
|||
|
||||
FrameworkName.append(Filename.begin()+SlashPos+1, Filename.end());
|
||||
const FileEntry *FE = FileMgr.getFile(FrameworkName,
|
||||
/*openFile=*/!SuggestedModule);
|
||||
/*OpenFile=*/!SuggestedModule);
|
||||
if (!FE) {
|
||||
// Check "/System/Library/Frameworks/Cocoa.framework/PrivateHeaders/file.h"
|
||||
const char *Private = "Private";
|
||||
|
@ -549,7 +549,7 @@ const FileEntry *DirectoryLookup::DoFrameworkLookup(
|
|||
SearchPath->insert(SearchPath->begin()+OrigSize, Private,
|
||||
Private+strlen(Private));
|
||||
|
||||
FE = FileMgr.getFile(FrameworkName, /*openFile=*/!SuggestedModule);
|
||||
FE = FileMgr.getFile(FrameworkName, /*OpenFile=*/!SuggestedModule);
|
||||
}
|
||||
|
||||
// If we found the header and are allowed to suggest a module, do so now.
|
||||
|
@ -1047,7 +1047,7 @@ LookupSubframeworkHeader(StringRef Filename,
|
|||
}
|
||||
|
||||
HeadersFilename.append(Filename.begin()+SlashPos+1, Filename.end());
|
||||
if (!(FE = FileMgr.getFile(HeadersFilename, /*openFile=*/true))) {
|
||||
if (!(FE = FileMgr.getFile(HeadersFilename, /*OpenFile=*/true))) {
|
||||
// Check ".../Frameworks/HIToolbox.framework/PrivateHeaders/HIToolbox.h"
|
||||
HeadersFilename = FrameworkName;
|
||||
HeadersFilename += "PrivateHeaders/";
|
||||
|
@ -1058,7 +1058,7 @@ LookupSubframeworkHeader(StringRef Filename,
|
|||
}
|
||||
|
||||
HeadersFilename.append(Filename.begin()+SlashPos+1, Filename.end());
|
||||
if (!(FE = FileMgr.getFile(HeadersFilename, /*openFile=*/true)))
|
||||
if (!(FE = FileMgr.getFile(HeadersFilename, /*OpenFile=*/true)))
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
|
|
@ -1419,7 +1419,7 @@ void Preprocessor::HandleMacroPublicDirective(Token &Tok) {
|
|||
|
||||
// Note that this macro has now been exported.
|
||||
appendMacroDirective(II, AllocateVisibilityMacroDirective(
|
||||
MacroNameTok.getLocation(), /*IsPublic=*/true));
|
||||
MacroNameTok.getLocation(), /*isPublic=*/true));
|
||||
}
|
||||
|
||||
/// Handle a #private directive.
|
||||
|
@ -1446,7 +1446,7 @@ void Preprocessor::HandleMacroPrivateDirective() {
|
|||
|
||||
// Note that this macro has now been marked private.
|
||||
appendMacroDirective(II, AllocateVisibilityMacroDirective(
|
||||
MacroNameTok.getLocation(), /*IsPublic=*/false));
|
||||
MacroNameTok.getLocation(), /*isPublic=*/false));
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
@ -1937,7 +1937,7 @@ Preprocessor::ImportAction Preprocessor::HandleHeaderIncludeOrImport(
|
|||
// and making the module loader convert it back again.
|
||||
ModuleLoadResult Imported = TheModuleLoader.loadModule(
|
||||
IncludeTok.getLocation(), Path, Module::Hidden,
|
||||
/*IsIncludeDirective=*/true);
|
||||
/*IsInclusionDirective=*/true);
|
||||
assert((Imported == nullptr || Imported == SuggestedModule.getModule()) &&
|
||||
"the imported module is different than the suggested one");
|
||||
|
||||
|
|
|
@ -1707,7 +1707,7 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) {
|
|||
|
||||
HasLexedNextToken = Tok.is(tok::string_literal);
|
||||
if (!FinishLexStringLiteral(Tok, WarningName, "'__has_warning'",
|
||||
/*MacroExpansion=*/false))
|
||||
/*AllowMacroExpansion=*/false))
|
||||
return false;
|
||||
|
||||
// FIXME: Should we accept "-R..." flags here, or should that be
|
||||
|
|
|
@ -1191,7 +1191,7 @@ public:
|
|||
|
||||
std::string WarningName;
|
||||
if (!PP.FinishLexStringLiteral(Tok, WarningName, "pragma diagnostic",
|
||||
/*MacroExpansion=*/false))
|
||||
/*AllowMacroExpansion=*/false))
|
||||
return;
|
||||
|
||||
if (Tok.isNot(tok::eod)) {
|
||||
|
@ -1389,7 +1389,7 @@ struct PragmaExecCharsetHandler : public PragmaHandler {
|
|||
std::string ExecCharset;
|
||||
if (!PP.FinishLexStringLiteral(Tok, ExecCharset,
|
||||
"pragma execution_character_set",
|
||||
/*MacroExpansion=*/false))
|
||||
/*AllowMacroExpansion=*/false))
|
||||
return;
|
||||
|
||||
// MSVC supports either of these, but nothing else.
|
||||
|
@ -1490,7 +1490,7 @@ public:
|
|||
|
||||
std::string MessageString;
|
||||
if (!PP.FinishLexStringLiteral(Tok, MessageString, PragmaKind(Kind),
|
||||
/*MacroExpansion=*/true))
|
||||
/*AllowMacroExpansion=*/true))
|
||||
return;
|
||||
|
||||
if (ExpectClosingParen) {
|
||||
|
@ -1540,7 +1540,7 @@ struct PragmaModuleImportHandler : public PragmaHandler {
|
|||
// If we have a non-empty module path, load the named module.
|
||||
Module *Imported =
|
||||
PP.getModuleLoader().loadModule(ImportLoc, ModuleName, Module::Hidden,
|
||||
/*IsIncludeDirective=*/false);
|
||||
/*IsInclusionDirective=*/false);
|
||||
if (!Imported)
|
||||
return;
|
||||
|
||||
|
@ -1666,7 +1666,7 @@ struct PragmaModuleLoadHandler : public PragmaHandler {
|
|||
|
||||
// Load the module, don't make it visible.
|
||||
PP.getModuleLoader().loadModule(Loc, ModuleName, Module::Hidden,
|
||||
/*IsIncludeDirective=*/false);
|
||||
/*IsInclusionDirective=*/false);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -1263,7 +1263,7 @@ bool Preprocessor::LexAfterModuleImport(Token &Result) {
|
|||
Imported = TheModuleLoader.loadModule(ModuleImportLoc,
|
||||
ModuleImportPath,
|
||||
Module::Hidden,
|
||||
/*IsIncludeDirective=*/false);
|
||||
/*IsInclusionDirective=*/false);
|
||||
if (Imported)
|
||||
makeModuleVisible(Imported, SemiLoc);
|
||||
}
|
||||
|
|
|
@ -1058,7 +1058,7 @@ bool Parser::ConsumeAndStoreInitializer(CachedTokens &Toks,
|
|||
case CIK_DefaultArgument:
|
||||
bool InvalidAsDeclaration = false;
|
||||
Result = TryParseParameterDeclarationClause(
|
||||
&InvalidAsDeclaration, /*VersusTemplateArgument=*/true);
|
||||
&InvalidAsDeclaration, /*VersusTemplateArg=*/true);
|
||||
// If this is an expression or a declaration with a missing
|
||||
// 'typename', assume it's not a declaration.
|
||||
if (Result == TPResult::Ambiguous && InvalidAsDeclaration)
|
||||
|
|
|
@ -3189,7 +3189,7 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS,
|
|||
Actions.getTypeName(*Next.getIdentifierInfo(), Next.getLocation(),
|
||||
getCurScope(), &SS, false, false, nullptr,
|
||||
/*IsCtorOrDtorName=*/false,
|
||||
/*WantNonTrivialSourceInfo=*/true,
|
||||
/*WantNontrivialTypeSourceInfo=*/true,
|
||||
isClassTemplateDeductionContext(DSContext));
|
||||
|
||||
// If the referenced identifier is not a type, then this declspec is
|
||||
|
|
|
@ -1208,9 +1208,9 @@ TypeResult Parser::ParseBaseTypeSpecifier(SourceLocation &BaseLoc,
|
|||
// We have an identifier; check whether it is actually a type.
|
||||
IdentifierInfo *CorrectedII = nullptr;
|
||||
ParsedType Type = Actions.getTypeName(
|
||||
*Id, IdLoc, getCurScope(), &SS, /*IsClassName=*/true, false, nullptr,
|
||||
*Id, IdLoc, getCurScope(), &SS, /*isClassName=*/true, false, nullptr,
|
||||
/*IsCtorOrDtorName=*/false,
|
||||
/*NonTrivialTypeSourceInfo=*/true,
|
||||
/*WantNontrivialTypeSourceInfo=*/true,
|
||||
/*IsClassTemplateDeductionContext*/ false, &CorrectedII);
|
||||
if (!Type) {
|
||||
Diag(IdLoc, diag::err_expected_class_name);
|
||||
|
|
|
@ -1770,7 +1770,7 @@ Parser::ParsePostfixExpressionSuffix(ExprResult LHS) {
|
|||
if (Tok.is(tok::code_completion)) {
|
||||
tok::TokenKind CorrectedOpKind =
|
||||
OpKind == tok::arrow ? tok::period : tok::arrow;
|
||||
ExprResult CorrectedLHS(/*IsInvalid=*/true);
|
||||
ExprResult CorrectedLHS(/*Invalid=*/true);
|
||||
if (getLangOpts().CPlusPlus && OrigLHS) {
|
||||
const bool DiagsAreSuppressed = Diags.getSuppressAllDiagnostics();
|
||||
Diags.setSuppressAllDiagnostics(true);
|
||||
|
@ -2052,7 +2052,7 @@ ExprResult Parser::ParseUnaryExprOrTypeTraitExpression() {
|
|||
if (isCastExpr)
|
||||
return Actions.ActOnUnaryExprOrTypeTraitExpr(OpTok.getLocation(),
|
||||
ExprKind,
|
||||
/*isType=*/true,
|
||||
/*IsType=*/true,
|
||||
CastTy.getAsOpaquePtr(),
|
||||
CastRange);
|
||||
|
||||
|
@ -2063,7 +2063,7 @@ ExprResult Parser::ParseUnaryExprOrTypeTraitExpression() {
|
|||
if (!Operand.isInvalid())
|
||||
Operand = Actions.ActOnUnaryExprOrTypeTraitExpr(OpTok.getLocation(),
|
||||
ExprKind,
|
||||
/*isType=*/false,
|
||||
/*IsType=*/false,
|
||||
Operand.get(),
|
||||
CastRange);
|
||||
return Operand;
|
||||
|
@ -3055,7 +3055,7 @@ ExprResult Parser::ParseBlockLiteralExpression() {
|
|||
/*IsAmbiguous=*/false,
|
||||
/*RParenLoc=*/NoLoc,
|
||||
/*ArgInfo=*/nullptr,
|
||||
/*NumArgs=*/0,
|
||||
/*NumParams=*/0,
|
||||
/*EllipsisLoc=*/NoLoc,
|
||||
/*RParenLoc=*/NoLoc,
|
||||
/*RefQualifierIsLvalueRef=*/true,
|
||||
|
|
|
@ -1334,10 +1334,10 @@ ExprResult Parser::ParseLambdaExpressionAfterIntroducer(
|
|||
|
||||
SourceLocation NoLoc;
|
||||
D.AddTypeInfo(DeclaratorChunk::getFunction(
|
||||
/*hasProto=*/true,
|
||||
/*isAmbiguous=*/false, LParenLoc, ParamInfo.data(),
|
||||
/*HasProto=*/true,
|
||||
/*IsAmbiguous=*/false, LParenLoc, ParamInfo.data(),
|
||||
ParamInfo.size(), EllipsisLoc, RParenLoc,
|
||||
/*RefQualifierIsLValueRef=*/true,
|
||||
/*RefQualifierIsLvalueRef=*/true,
|
||||
/*RefQualifierLoc=*/NoLoc, MutableLoc, ESpecType,
|
||||
ESpecRange, DynamicExceptions.data(),
|
||||
DynamicExceptionRanges.data(), DynamicExceptions.size(),
|
||||
|
@ -1394,14 +1394,14 @@ ExprResult Parser::ParseLambdaExpressionAfterIntroducer(
|
|||
|
||||
SourceLocation NoLoc;
|
||||
D.AddTypeInfo(DeclaratorChunk::getFunction(
|
||||
/*hasProto=*/true,
|
||||
/*isAmbiguous=*/false,
|
||||
/*HasProto=*/true,
|
||||
/*IsAmbiguous=*/false,
|
||||
/*LParenLoc=*/NoLoc,
|
||||
/*Params=*/nullptr,
|
||||
/*NumParams=*/0,
|
||||
/*EllipsisLoc=*/NoLoc,
|
||||
/*RParenLoc=*/NoLoc,
|
||||
/*RefQualifierIsLValueRef=*/true,
|
||||
/*RefQualifierIsLvalueRef=*/true,
|
||||
/*RefQualifierLoc=*/NoLoc, MutableLoc, EST_None,
|
||||
/*ESpecRange=*/SourceRange(),
|
||||
/*Exceptions=*/nullptr,
|
||||
|
@ -1701,7 +1701,7 @@ Parser::ParseCXXPseudoDestructor(Expr *Base, SourceLocation OpLoc,
|
|||
ParseUnqualifiedIdTemplateId(SS, SourceLocation(),
|
||||
Name, NameLoc,
|
||||
false, ObjectType, SecondTypeName,
|
||||
/*AssumeTemplateName=*/true))
|
||||
/*AssumeTemplateId=*/true))
|
||||
return ExprError();
|
||||
|
||||
return Actions.ActOnPseudoDestructorExpr(getCurScope(), Base, OpLoc, OpKind,
|
||||
|
@ -3061,7 +3061,7 @@ void Parser::ParseDirectNewDeclarator(Declarator &D) {
|
|||
MaybeParseCXX11Attributes(Attrs);
|
||||
|
||||
D.AddTypeInfo(DeclaratorChunk::getArray(0,
|
||||
/*static=*/false, /*star=*/false,
|
||||
/*isStatic=*/false, /*isStar=*/false,
|
||||
Size.get(), T.getOpenLocation(),
|
||||
T.getCloseLocation()),
|
||||
std::move(Attrs), T.getCloseLocation());
|
||||
|
|
|
@ -3194,15 +3194,15 @@ Parser::ParseObjCMessageExpressionBody(SourceLocation LBracLoc,
|
|||
if (SuperLoc.isValid())
|
||||
Actions.CodeCompleteObjCSuperMessage(getCurScope(), SuperLoc,
|
||||
KeyIdents,
|
||||
/*AtArgumentEpression=*/true);
|
||||
/*AtArgumentExpression=*/true);
|
||||
else if (ReceiverType)
|
||||
Actions.CodeCompleteObjCClassMessage(getCurScope(), ReceiverType,
|
||||
KeyIdents,
|
||||
/*AtArgumentEpression=*/true);
|
||||
/*AtArgumentExpression=*/true);
|
||||
else
|
||||
Actions.CodeCompleteObjCInstanceMessage(getCurScope(), ReceiverExpr,
|
||||
KeyIdents,
|
||||
/*AtArgumentEpression=*/true);
|
||||
/*AtArgumentExpression=*/true);
|
||||
|
||||
cutOffParsing();
|
||||
return ExprError();
|
||||
|
@ -3232,15 +3232,15 @@ Parser::ParseObjCMessageExpressionBody(SourceLocation LBracLoc,
|
|||
if (SuperLoc.isValid())
|
||||
Actions.CodeCompleteObjCSuperMessage(getCurScope(), SuperLoc,
|
||||
KeyIdents,
|
||||
/*AtArgumentEpression=*/false);
|
||||
/*AtArgumentExpression=*/false);
|
||||
else if (ReceiverType)
|
||||
Actions.CodeCompleteObjCClassMessage(getCurScope(), ReceiverType,
|
||||
KeyIdents,
|
||||
/*AtArgumentEpression=*/false);
|
||||
/*AtArgumentExpression=*/false);
|
||||
else
|
||||
Actions.CodeCompleteObjCInstanceMessage(getCurScope(), ReceiverExpr,
|
||||
KeyIdents,
|
||||
/*AtArgumentEpression=*/false);
|
||||
/*AtArgumentExpression=*/false);
|
||||
cutOffParsing();
|
||||
return ExprError();
|
||||
}
|
||||
|
|
|
@ -2491,7 +2491,7 @@ void PragmaDetectMismatchHandler::HandlePragma(Preprocessor &PP,
|
|||
std::string NameString;
|
||||
if (!PP.LexStringLiteral(Tok, NameString,
|
||||
"pragma detect_mismatch",
|
||||
/*MacroExpansion=*/true))
|
||||
/*AllowMacroExpansion=*/true))
|
||||
return;
|
||||
|
||||
// Read the comma followed by a second string literal.
|
||||
|
@ -2502,7 +2502,7 @@ void PragmaDetectMismatchHandler::HandlePragma(Preprocessor &PP,
|
|||
}
|
||||
|
||||
if (!PP.LexStringLiteral(Tok, ValueString, "pragma detect_mismatch",
|
||||
/*MacroExpansion=*/true))
|
||||
/*AllowMacroExpansion=*/true))
|
||||
return;
|
||||
|
||||
if (Tok.isNot(tok::r_paren)) {
|
||||
|
@ -2584,7 +2584,7 @@ void PragmaCommentHandler::HandlePragma(Preprocessor &PP,
|
|||
std::string ArgumentString;
|
||||
if (Tok.is(tok::comma) && !PP.LexStringLiteral(Tok, ArgumentString,
|
||||
"pragma comment",
|
||||
/*MacroExpansion=*/true))
|
||||
/*AllowMacroExpansion=*/true))
|
||||
return;
|
||||
|
||||
// FIXME: warn that 'exestr' is deprecated.
|
||||
|
|
|
@ -303,7 +303,7 @@ Decl *Parser::ParseSingleDeclarationAfterTemplate(
|
|||
return ParseFunctionDefinition(
|
||||
DeclaratorInfo, ParsedTemplateInfo(&FakedParamLists,
|
||||
/*isSpecialization=*/true,
|
||||
/*LastParamListWasEmpty=*/true),
|
||||
/*lastParameterListWasEmpty=*/true),
|
||||
&LateParsedAttrs);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2044,7 +2044,7 @@ static TryCastResult TryReinterpretCast(Sema &Self, ExprResult &SrcExpr,
|
|||
|
||||
if (!CStyle) {
|
||||
Self.CheckCompatibleReinterpretCast(SrcType, DestType,
|
||||
/*isDereference=*/false, OpRange);
|
||||
/*IsDereference=*/false, OpRange);
|
||||
}
|
||||
|
||||
// C++ 5.2.10p10: [...] a reference cast reinterpret_cast<T&>(x) has the
|
||||
|
@ -2881,7 +2881,7 @@ ExprResult Sema::BuildCStyleCastExpr(SourceLocation LPLoc,
|
|||
Op.OpRange = SourceRange(LPLoc, CastExpr->getEndLoc());
|
||||
|
||||
if (getLangOpts().CPlusPlus) {
|
||||
Op.CheckCXXCStyleCast(/*FunctionalStyle=*/ false,
|
||||
Op.CheckCXXCStyleCast(/*FunctionalCast=*/ false,
|
||||
isa<InitListExpr>(CastExpr));
|
||||
} else {
|
||||
Op.CheckCStyleCast();
|
||||
|
@ -2908,7 +2908,7 @@ ExprResult Sema::BuildCXXFunctionalCastExpr(TypeSourceInfo *CastTypeInfo,
|
|||
Op.DestRange = CastTypeInfo->getTypeLoc().getSourceRange();
|
||||
Op.OpRange = SourceRange(Op.DestRange.getBegin(), CastExpr->getEndLoc());
|
||||
|
||||
Op.CheckCXXCStyleCast(/*FunctionalStyle=*/true, /*ListInit=*/false);
|
||||
Op.CheckCXXCStyleCast(/*FunctionalCast=*/true, /*ListInit=*/false);
|
||||
if (Op.SrcExpr.isInvalid())
|
||||
return ExprError();
|
||||
|
||||
|
|
|
@ -11391,7 +11391,7 @@ CheckImplicitConversion(Sema &S, Expr *E, QualType T, SourceLocation CC,
|
|||
if (Overflowed) {
|
||||
S.DiagRuntimeBehavior(E->getExprLoc(), E,
|
||||
S.PDiag(diag::warn_impcast_fixed_point_range)
|
||||
<< Value.toString(/*radix=*/10) << T
|
||||
<< Value.toString(/*Radix=*/10) << T
|
||||
<< E->getSourceRange()
|
||||
<< clang::SourceRange(CC));
|
||||
return;
|
||||
|
|
|
@ -5136,7 +5136,7 @@ QualType Sema::ProduceCallSignatureHelp(Scope *S, Expr *Fn,
|
|||
Decls.append(UME->decls_begin(), UME->decls_end());
|
||||
const bool FirstArgumentIsBase = !UME->isImplicitAccess() && UME->getBase();
|
||||
AddFunctionCandidates(Decls, ArgExprs, CandidateSet, TemplateArgs,
|
||||
/*SuppressUsedConversions=*/false,
|
||||
/*SuppressUserConversions=*/false,
|
||||
/*PartialOverloading=*/true, FirstArgumentIsBase);
|
||||
} else {
|
||||
FunctionDecl *FD = nullptr;
|
||||
|
@ -5151,7 +5151,7 @@ QualType Sema::ProduceCallSignatureHelp(Scope *S, Expr *Fn,
|
|||
else
|
||||
AddOverloadCandidate(FD, DeclAccessPair::make(FD, FD->getAccess()),
|
||||
Args, CandidateSet,
|
||||
/*SuppressUsedConversions=*/false,
|
||||
/*SuppressUserConversions=*/false,
|
||||
/*PartialOverloading=*/true);
|
||||
|
||||
} else if (auto DC = NakedFn->getType()->getAsCXXRecordDecl()) {
|
||||
|
@ -5168,7 +5168,7 @@ QualType Sema::ProduceCallSignatureHelp(Scope *S, Expr *Fn,
|
|||
ArgExprs.append(Args.begin(), Args.end());
|
||||
AddFunctionCandidates(R.asUnresolvedSet(), ArgExprs, CandidateSet,
|
||||
/*ExplicitArgs=*/nullptr,
|
||||
/*SuppressUsedConversions=*/false,
|
||||
/*SuppressUserConversions=*/false,
|
||||
/*PartialOverloading=*/true);
|
||||
}
|
||||
} else {
|
||||
|
@ -5216,14 +5216,14 @@ QualType Sema::ProduceConstructorSignatureHelp(Scope *S, QualType Type,
|
|||
if (auto *FD = dyn_cast<FunctionDecl>(C)) {
|
||||
AddOverloadCandidate(FD, DeclAccessPair::make(FD, C->getAccess()), Args,
|
||||
CandidateSet,
|
||||
/*SuppressUsedConversions=*/false,
|
||||
/*SuppressUserConversions=*/false,
|
||||
/*PartialOverloading=*/true,
|
||||
/*AllowExplicit*/ true);
|
||||
} else if (auto *FTD = dyn_cast<FunctionTemplateDecl>(C)) {
|
||||
AddTemplateOverloadCandidate(
|
||||
FTD, DeclAccessPair::make(FTD, C->getAccess()),
|
||||
/*ExplicitTemplateArgs=*/nullptr, Args, CandidateSet,
|
||||
/*SuppressUsedConversions=*/false,
|
||||
/*SuppressUserConversions=*/false,
|
||||
/*PartialOverloading=*/true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -716,7 +716,7 @@ void Sema::DiagnoseUnknownTypeName(IdentifierInfo *&II,
|
|||
getTypeName(*Corrected.getCorrectionAsIdentifierInfo(), IILoc, S,
|
||||
tmpSS.isSet() ? &tmpSS : SS, false, false, nullptr,
|
||||
/*IsCtorOrDtorName=*/false,
|
||||
/*NonTrivialTypeSourceInfo=*/true);
|
||||
/*WantNontrivialTypeSourceInfo=*/true);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -900,7 +900,7 @@ static void handleAllocSizeAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
|
|||
const Expr *SizeExpr = AL.getArgAsExpr(0);
|
||||
int SizeArgNoVal;
|
||||
// Parameter indices are 1-indexed, hence Index=1
|
||||
if (!checkPositiveIntArgument(S, AL, SizeExpr, SizeArgNoVal, /*Index=*/1))
|
||||
if (!checkPositiveIntArgument(S, AL, SizeExpr, SizeArgNoVal, /*Idx=*/1))
|
||||
return;
|
||||
if (!checkParamIsIntegerType(S, FD, AL, /*AttrArgNo=*/0))
|
||||
return;
|
||||
|
@ -911,7 +911,7 @@ static void handleAllocSizeAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
|
|||
const Expr *NumberExpr = AL.getArgAsExpr(1);
|
||||
int Val;
|
||||
// Parameter indices are 1-based, hence Index=2
|
||||
if (!checkPositiveIntArgument(S, AL, NumberExpr, Val, /*Index=*/2))
|
||||
if (!checkPositiveIntArgument(S, AL, NumberExpr, Val, /*Idx=*/2))
|
||||
return;
|
||||
if (!checkParamIsIntegerType(S, FD, AL, /*AttrArgNo=*/1))
|
||||
return;
|
||||
|
@ -1673,7 +1673,7 @@ void Sema::AddAllocAlignAttr(SourceRange AttrRange, Decl *D, Expr *ParamExpr,
|
|||
ParamIdx Idx;
|
||||
const auto *FuncDecl = cast<FunctionDecl>(D);
|
||||
if (!checkFunctionOrMethodParameterIndex(*this, FuncDecl, TmpAttr,
|
||||
/*AttrArgNo=*/1, ParamExpr, Idx))
|
||||
/*AttrArgNum=*/1, ParamExpr, Idx))
|
||||
return;
|
||||
|
||||
QualType Ty = getFunctionOrMethodParamType(D, Idx.getASTIndex());
|
||||
|
|
|
@ -11168,8 +11168,8 @@ Sema::findInheritingConstructor(SourceLocation Loc,
|
|||
|
||||
CXXConstructorDecl *DerivedCtor = CXXConstructorDecl::Create(
|
||||
Context, Derived, UsingLoc, NameInfo, TInfo->getType(), TInfo,
|
||||
BaseCtor->getExplicitSpecifier(), /*Inline=*/true,
|
||||
/*ImplicitlyDeclared=*/true,
|
||||
BaseCtor->getExplicitSpecifier(), /*isInline=*/true,
|
||||
/*isImplicitlyDeclared=*/true,
|
||||
Constexpr ? BaseCtor->getConstexprKind() : CSK_unspecified,
|
||||
InheritedConstructor(Shadow, BaseCtor));
|
||||
if (Shadow->isInvalidDecl())
|
||||
|
@ -11190,7 +11190,7 @@ Sema::findInheritingConstructor(SourceLocation Loc,
|
|||
Context.getTrivialTypeSourceInfo(FPT->getParamType(I), UsingLoc);
|
||||
ParmVarDecl *PD = ParmVarDecl::Create(
|
||||
Context, DerivedCtor, UsingLoc, UsingLoc, /*IdentifierInfo=*/nullptr,
|
||||
FPT->getParamType(I), TInfo, SC_None, /*DefaultArg=*/nullptr);
|
||||
FPT->getParamType(I), TInfo, SC_None, /*DefArg=*/nullptr);
|
||||
PD->setScopeInfo(0, I);
|
||||
PD->setImplicit();
|
||||
// Ensure attributes are propagated onto parameters (this matters for
|
||||
|
@ -11751,7 +11751,7 @@ buildSingleCopyAssignRecursively(Sema &S, SourceLocation Loc, QualType T,
|
|||
|
||||
// Create the reference to operator=.
|
||||
ExprResult OpEqualRef
|
||||
= S.BuildMemberReferenceExpr(To.build(S, Loc), T, Loc, /*isArrow=*/false,
|
||||
= S.BuildMemberReferenceExpr(To.build(S, Loc), T, Loc, /*IsArrow=*/false,
|
||||
SS, /*TemplateKWLoc=*/SourceLocation(),
|
||||
/*FirstQualifierInScope=*/nullptr,
|
||||
OpLookup,
|
||||
|
|
|
@ -1587,7 +1587,7 @@ void Sema::actOnObjCTypeArgsOrProtocolQualifiers(
|
|||
// add the '*'.
|
||||
if (type->getAs<ObjCInterfaceType>()) {
|
||||
SourceLocation starLoc = getLocForEndOfToken(loc);
|
||||
D.AddTypeInfo(DeclaratorChunk::getPointer(/*typeQuals=*/0, starLoc,
|
||||
D.AddTypeInfo(DeclaratorChunk::getPointer(/*TypeQuals=*/0, starLoc,
|
||||
SourceLocation(),
|
||||
SourceLocation(),
|
||||
SourceLocation(),
|
||||
|
|
|
@ -1083,8 +1083,8 @@ static QualType handleFloatConversion(Sema &S, ExprResult &LHS,
|
|||
LHSType = S.Context.FloatTy;
|
||||
|
||||
return handleIntToFloatConversion(S, LHS, RHS, LHSType, RHSType,
|
||||
/*convertFloat=*/!IsCompAssign,
|
||||
/*convertInt=*/ true);
|
||||
/*ConvertFloat=*/!IsCompAssign,
|
||||
/*ConvertInt=*/ true);
|
||||
}
|
||||
assert(RHSFloat);
|
||||
return handleIntToFloatConversion(S, RHS, LHS, RHSType, LHSType,
|
||||
|
@ -2151,7 +2151,7 @@ recoverFromMSUnqualifiedLookup(Sema &S, ASTContext &Context,
|
|||
return CXXDependentScopeMemberExpr::Create(
|
||||
Context, /*This=*/nullptr, ThisType, /*IsArrow=*/true,
|
||||
/*Op=*/SourceLocation(), NestedNameSpecifierLoc(), TemplateKWLoc,
|
||||
/*FirstQualifierInScope=*/nullptr, NameInfo, TemplateArgs);
|
||||
/*FirstQualifierFoundInScope=*/nullptr, NameInfo, TemplateArgs);
|
||||
}
|
||||
|
||||
// Synthesize a fake NNS that points to the derived class. This will
|
||||
|
@ -7308,10 +7308,10 @@ QualType Sema::CheckConditionalOperands(ExprResult &Cond, ExprResult &LHS,
|
|||
// GCC compatibility: soften pointer/integer mismatch. Note that
|
||||
// null pointers have been filtered out by this point.
|
||||
if (checkPointerIntegerMismatch(*this, LHS, RHS.get(), QuestionLoc,
|
||||
/*isIntFirstExpr=*/true))
|
||||
/*IsIntFirstExpr=*/true))
|
||||
return RHSTy;
|
||||
if (checkPointerIntegerMismatch(*this, RHS, LHS.get(), QuestionLoc,
|
||||
/*isIntFirstExpr=*/false))
|
||||
/*IsIntFirstExpr=*/false))
|
||||
return LHSTy;
|
||||
|
||||
// Emit a better diagnostic if one of the expressions is a null pointer
|
||||
|
@ -9105,7 +9105,7 @@ static void DiagnoseBadDivideOrRemainderValues(Sema& S, ExprResult &LHS,
|
|||
QualType Sema::CheckMultiplyDivideOperands(ExprResult &LHS, ExprResult &RHS,
|
||||
SourceLocation Loc,
|
||||
bool IsCompAssign, bool IsDiv) {
|
||||
checkArithmeticNull(*this, LHS, RHS, Loc, /*isCompare=*/false);
|
||||
checkArithmeticNull(*this, LHS, RHS, Loc, /*IsCompare=*/false);
|
||||
|
||||
if (LHS.get()->getType()->isVectorType() ||
|
||||
RHS.get()->getType()->isVectorType())
|
||||
|
@ -9129,7 +9129,7 @@ QualType Sema::CheckMultiplyDivideOperands(ExprResult &LHS, ExprResult &RHS,
|
|||
|
||||
QualType Sema::CheckRemainderOperands(
|
||||
ExprResult &LHS, ExprResult &RHS, SourceLocation Loc, bool IsCompAssign) {
|
||||
checkArithmeticNull(*this, LHS, RHS, Loc, /*isCompare=*/false);
|
||||
checkArithmeticNull(*this, LHS, RHS, Loc, /*IsCompare=*/false);
|
||||
|
||||
if (LHS.get()->getType()->isVectorType() ||
|
||||
RHS.get()->getType()->isVectorType()) {
|
||||
|
@ -9418,7 +9418,7 @@ static void diagnosePointerIncompatibility(Sema &S, SourceLocation Loc,
|
|||
QualType Sema::CheckAdditionOperands(ExprResult &LHS, ExprResult &RHS,
|
||||
SourceLocation Loc, BinaryOperatorKind Opc,
|
||||
QualType* CompLHSTy) {
|
||||
checkArithmeticNull(*this, LHS, RHS, Loc, /*isCompare=*/false);
|
||||
checkArithmeticNull(*this, LHS, RHS, Loc, /*IsCompare=*/false);
|
||||
|
||||
if (LHS.get()->getType()->isVectorType() ||
|
||||
RHS.get()->getType()->isVectorType()) {
|
||||
|
@ -9512,7 +9512,7 @@ QualType Sema::CheckAdditionOperands(ExprResult &LHS, ExprResult &RHS,
|
|||
QualType Sema::CheckSubtractionOperands(ExprResult &LHS, ExprResult &RHS,
|
||||
SourceLocation Loc,
|
||||
QualType* CompLHSTy) {
|
||||
checkArithmeticNull(*this, LHS, RHS, Loc, /*isCompare=*/false);
|
||||
checkArithmeticNull(*this, LHS, RHS, Loc, /*IsCompare=*/false);
|
||||
|
||||
if (LHS.get()->getType()->isVectorType() ||
|
||||
RHS.get()->getType()->isVectorType()) {
|
||||
|
@ -9800,7 +9800,7 @@ static QualType checkVectorShift(Sema &S, ExprResult &LHS, ExprResult &RHS,
|
|||
QualType Sema::CheckShiftOperands(ExprResult &LHS, ExprResult &RHS,
|
||||
SourceLocation Loc, BinaryOperatorKind Opc,
|
||||
bool IsCompAssign) {
|
||||
checkArithmeticNull(*this, LHS, RHS, Loc, /*isCompare=*/false);
|
||||
checkArithmeticNull(*this, LHS, RHS, Loc, /*IsCompare=*/false);
|
||||
|
||||
// Vector shifts promote their scalar inputs to vector type.
|
||||
if (LHS.get()->getType()->isVectorType() ||
|
||||
|
@ -9969,7 +9969,7 @@ static bool hasIsEqualMethod(Sema &S, const Expr *LHS, const Expr *RHS) {
|
|||
Selector IsEqualSel = S.NSAPIObj->getIsEqualSelector();
|
||||
ObjCMethodDecl *Method = S.LookupMethodInObjectType(IsEqualSel,
|
||||
InterfaceType,
|
||||
/*instance=*/true);
|
||||
/*IsInstance=*/true);
|
||||
if (!Method) {
|
||||
if (Type->isObjCIdType()) {
|
||||
// For 'id', just check the global pool.
|
||||
|
@ -9978,7 +9978,7 @@ static bool hasIsEqualMethod(Sema &S, const Expr *LHS, const Expr *RHS) {
|
|||
} else {
|
||||
// Check protocols.
|
||||
Method = S.LookupMethodInQualifiedType(IsEqualSel, Type,
|
||||
/*instance=*/true);
|
||||
/*IsInstance=*/true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -10478,7 +10478,7 @@ QualType Sema::CheckCompareOperands(ExprResult &LHS, ExprResult &RHS,
|
|||
return QualType();
|
||||
}
|
||||
|
||||
checkArithmeticNull(*this, LHS, RHS, Loc, /*isCompare=*/true);
|
||||
checkArithmeticNull(*this, LHS, RHS, Loc, /*IsCompare=*/true);
|
||||
|
||||
// Handle vector comparisons separately.
|
||||
if (LHS.get()->getType()->isVectorType() ||
|
||||
|
@ -10988,7 +10988,7 @@ QualType Sema::CheckVectorLogicalOperands(ExprResult &LHS, ExprResult &RHS,
|
|||
inline QualType Sema::CheckBitwiseOperands(ExprResult &LHS, ExprResult &RHS,
|
||||
SourceLocation Loc,
|
||||
BinaryOperatorKind Opc) {
|
||||
checkArithmeticNull(*this, LHS, RHS, Loc, /*isCompare=*/false);
|
||||
checkArithmeticNull(*this, LHS, RHS, Loc, /*IsCompare=*/false);
|
||||
|
||||
bool IsCompAssign =
|
||||
Opc == BO_AndAssign || Opc == BO_OrAssign || Opc == BO_XorAssign;
|
||||
|
@ -15626,7 +15626,7 @@ static bool captureInLambda(LambdaScopeInfo *LSI,
|
|||
|
||||
// Add the capture.
|
||||
if (BuildAndDiagnose)
|
||||
LSI->addCapture(Var, /*IsBlock=*/false, ByRef, RefersToCapturedVariable,
|
||||
LSI->addCapture(Var, /*isBlock=*/false, ByRef, RefersToCapturedVariable,
|
||||
Loc, EllipsisLoc, CaptureType, Invalid);
|
||||
|
||||
return !Invalid;
|
||||
|
|
|
@ -1254,7 +1254,7 @@ ExprResult Sema::ActOnCXXThis(SourceLocation Loc) {
|
|||
QualType ThisTy = getCurrentThisType();
|
||||
if (ThisTy.isNull())
|
||||
return Diag(Loc, diag::err_invalid_this_use);
|
||||
return BuildCXXThisExpr(Loc, ThisTy, /*isImplicit=*/false);
|
||||
return BuildCXXThisExpr(Loc, ThisTy, /*IsImplicit=*/false);
|
||||
}
|
||||
|
||||
Expr *Sema::BuildCXXThisExpr(SourceLocation Loc, QualType Type,
|
||||
|
|
|
@ -1106,7 +1106,7 @@ Sema::BuildMemberReferenceExpr(Expr *BaseExpr, QualType BaseExprType,
|
|||
SourceLocation Loc = R.getNameLoc();
|
||||
if (SS.getRange().isValid())
|
||||
Loc = SS.getRange().getBegin();
|
||||
BaseExpr = BuildCXXThisExpr(Loc, BaseExprType, /*isImplicit=*/true);
|
||||
BaseExpr = BuildCXXThisExpr(Loc, BaseExprType, /*IsImplicit=*/true);
|
||||
}
|
||||
|
||||
// Check the use of this member.
|
||||
|
@ -1130,7 +1130,7 @@ Sema::BuildMemberReferenceExpr(Expr *BaseExpr, QualType BaseExprType,
|
|||
|
||||
if (VarDecl *Var = dyn_cast<VarDecl>(MemberDecl)) {
|
||||
return BuildMemberExpr(BaseExpr, IsArrow, OpLoc, &SS, TemplateKWLoc, Var,
|
||||
FoundDecl, /*MultipleCandidates=*/false,
|
||||
FoundDecl, /*HadMultipleCandidates=*/false,
|
||||
MemberNameInfo, Var->getType().getNonReferenceType(),
|
||||
VK_LValue, OK_Ordinary);
|
||||
}
|
||||
|
@ -1147,14 +1147,14 @@ Sema::BuildMemberReferenceExpr(Expr *BaseExpr, QualType BaseExprType,
|
|||
}
|
||||
|
||||
return BuildMemberExpr(BaseExpr, IsArrow, OpLoc, &SS, TemplateKWLoc,
|
||||
MemberFn, FoundDecl, /*MultipleCandidates=*/false,
|
||||
MemberFn, FoundDecl, /*HadMultipleCandidates=*/false,
|
||||
MemberNameInfo, type, valueKind, OK_Ordinary);
|
||||
}
|
||||
assert(!isa<FunctionDecl>(MemberDecl) && "member function not C++ method?");
|
||||
|
||||
if (EnumConstantDecl *Enum = dyn_cast<EnumConstantDecl>(MemberDecl)) {
|
||||
return BuildMemberExpr(BaseExpr, IsArrow, OpLoc, &SS, TemplateKWLoc, Enum,
|
||||
FoundDecl, /*MultipleCandidates=*/false,
|
||||
FoundDecl, /*HadMultipleCandidates=*/false,
|
||||
MemberNameInfo, Enum->getType(), VK_RValue,
|
||||
OK_Ordinary);
|
||||
}
|
||||
|
@ -1163,7 +1163,7 @@ Sema::BuildMemberReferenceExpr(Expr *BaseExpr, QualType BaseExprType,
|
|||
*this, VarTempl, TemplateArgs, MemberNameInfo, TemplateKWLoc))
|
||||
return BuildMemberExpr(
|
||||
BaseExpr, IsArrow, OpLoc, &SS, TemplateKWLoc, Var, FoundDecl,
|
||||
/*MultipleCandidates=*/false, MemberNameInfo,
|
||||
/*HadMultipleCandidates=*/false, MemberNameInfo,
|
||||
Var->getType().getNonReferenceType(), VK_LValue, OK_Ordinary);
|
||||
return ExprError();
|
||||
}
|
||||
|
@ -1822,7 +1822,7 @@ Sema::BuildFieldReferenceExpr(Expr *BaseExpr, bool IsArrow,
|
|||
|
||||
return BuildMemberExpr(Base.get(), IsArrow, OpLoc, &SS,
|
||||
/*TemplateKWLoc=*/SourceLocation(), Field, FoundDecl,
|
||||
/*MultipleCandidates=*/false, MemberNameInfo,
|
||||
/*HadMultipleCandidates=*/false, MemberNameInfo,
|
||||
MemberType, VK, OK);
|
||||
}
|
||||
|
||||
|
@ -1851,7 +1851,7 @@ Sema::BuildImplicitMemberExpr(const CXXScopeSpec &SS,
|
|||
SourceLocation Loc = R.getNameLoc();
|
||||
if (SS.getRange().isValid())
|
||||
Loc = SS.getRange().getBegin();
|
||||
baseExpr = BuildCXXThisExpr(loc, ThisTy, /*isImplicit=*/true);
|
||||
baseExpr = BuildCXXThisExpr(loc, ThisTy, /*IsImplicit=*/true);
|
||||
}
|
||||
|
||||
return BuildMemberReferenceExpr(baseExpr, ThisTy,
|
||||
|
|
|
@ -3931,7 +3931,7 @@ static void TryConstructorInitialization(Sema &S,
|
|||
Result = ResolveConstructorOverload(S, Kind.getLocation(), Args,
|
||||
CandidateSet, DestType, Ctors, Best,
|
||||
CopyInitialization, AllowExplicit,
|
||||
/*OnlyListConstructor=*/true,
|
||||
/*OnlyListConstructors=*/true,
|
||||
IsListInit);
|
||||
}
|
||||
|
||||
|
@ -4118,7 +4118,7 @@ static void TryReferenceListInitialization(Sema &S,
|
|||
if (Sequence) {
|
||||
if (DestType->isRValueReferenceType() ||
|
||||
(T1Quals.hasConst() && !T1Quals.hasVolatile()))
|
||||
Sequence.AddReferenceBindingStep(cv1T1, /*bindingTemporary=*/true);
|
||||
Sequence.AddReferenceBindingStep(cv1T1, /*BindingTemporary=*/true);
|
||||
else
|
||||
Sequence.SetFailed(
|
||||
InitializationSequence::FK_NonConstLValueReferenceBindingToTemporary);
|
||||
|
@ -4833,7 +4833,7 @@ static void TryReferenceInitializationCore(Sema &S,
|
|||
return;
|
||||
}
|
||||
|
||||
Sequence.AddReferenceBindingStep(cv1T1IgnoreAS, /*bindingTemporary=*/true);
|
||||
Sequence.AddReferenceBindingStep(cv1T1IgnoreAS, /*BindingTemporary=*/true);
|
||||
|
||||
if (T1Quals.hasAddressSpace()) {
|
||||
if (!Qualifiers::isAddressSpaceSupersetOf(T1Quals.getAddressSpace(),
|
||||
|
|
|
@ -1328,7 +1328,7 @@ static void addFunctionPointerConversion(Sema &S,
|
|||
S.Context.getTranslationUnitDecl(), From->getBeginLoc(),
|
||||
From->getLocation(), From->getIdentifier(), From->getType(),
|
||||
From->getTypeSourceInfo(), From->getStorageClass(),
|
||||
/*DefaultArg=*/nullptr));
|
||||
/*DefArg=*/nullptr));
|
||||
CallOpConvTL.setParam(I, From);
|
||||
CallOpConvNameTL.setParam(I, From);
|
||||
}
|
||||
|
@ -1376,7 +1376,7 @@ static void addFunctionPointerConversion(Sema &S,
|
|||
CXXMethodDecl *Invoke = CXXMethodDecl::Create(
|
||||
S.Context, Class, Loc, DeclarationNameInfo(InvokerName, Loc),
|
||||
InvokerFunctionTy, CallOperator->getTypeSourceInfo(), SC_Static,
|
||||
/*IsInline=*/true, CSK_unspecified, CallOperator->getBody()->getEndLoc());
|
||||
/*isInline=*/true, CSK_unspecified, CallOperator->getBody()->getEndLoc());
|
||||
for (unsigned I = 0, N = CallOperator->getNumParams(); I != N; ++I)
|
||||
InvokerParams[I]->setOwningFunction(Invoke);
|
||||
Invoke->setParams(InvokerParams);
|
||||
|
@ -1860,7 +1860,7 @@ ExprResult Sema::BuildBlockForLambdaConversion(SourceLocation CurrentLocation,
|
|||
Context, Block, From->getBeginLoc(), From->getLocation(),
|
||||
From->getIdentifier(), From->getType(), From->getTypeSourceInfo(),
|
||||
From->getStorageClass(),
|
||||
/*DefaultArg=*/nullptr));
|
||||
/*DefArg=*/nullptr));
|
||||
}
|
||||
Block->setParams(BlockParams);
|
||||
|
||||
|
@ -1875,8 +1875,8 @@ ExprResult Sema::BuildBlockForLambdaConversion(SourceLocation CurrentLocation,
|
|||
ConvLocation, nullptr,
|
||||
Src->getType(), CapVarTSI,
|
||||
SC_None);
|
||||
BlockDecl::Capture Capture(/*Variable=*/CapVar, /*ByRef=*/false,
|
||||
/*Nested=*/false, /*Copy=*/Init.get());
|
||||
BlockDecl::Capture Capture(/*variable=*/CapVar, /*byRef=*/false,
|
||||
/*nested=*/false, /*copy=*/Init.get());
|
||||
Block->setCaptures(Context, Capture, /*CapturesCXXThis=*/false);
|
||||
|
||||
// Add a fake function body to the block. IR generation is responsible
|
||||
|
|
|
@ -206,7 +206,7 @@ Sema::ActOnModuleDecl(SourceLocation StartLoc, SourceLocation ModuleLoc,
|
|||
PP.getIdentifierInfo(ModuleName), Path[0].second);
|
||||
Mod = getModuleLoader().loadModule(ModuleLoc, {ModuleNameLoc},
|
||||
Module::AllVisible,
|
||||
/*IsIncludeDirective=*/false);
|
||||
/*IsInclusionDirective=*/false);
|
||||
if (!Mod) {
|
||||
Diag(ModuleLoc, diag::err_module_not_defined) << ModuleName;
|
||||
// Create an empty module interface unit for error recovery.
|
||||
|
@ -323,7 +323,7 @@ DeclResult Sema::ActOnModuleImport(SourceLocation StartLoc,
|
|||
|
||||
Module *Mod =
|
||||
getModuleLoader().loadModule(ImportLoc, Path, Module::AllVisible,
|
||||
/*IsIncludeDirective=*/false);
|
||||
/*IsInclusionDirective=*/false);
|
||||
if (!Mod)
|
||||
return true;
|
||||
|
||||
|
|
|
@ -1288,7 +1288,7 @@ Decl *Sema::ActOnPropertyImplDecl(Scope *S,
|
|||
|
||||
Ivar = ObjCIvarDecl::Create(Context, ClassImpDecl,
|
||||
PropertyIvarLoc,PropertyIvarLoc, PropertyIvar,
|
||||
PropertyIvarType, /*Dinfo=*/nullptr,
|
||||
PropertyIvarType, /*TInfo=*/nullptr,
|
||||
ObjCIvarDecl::Private,
|
||||
(Expr *)nullptr, true);
|
||||
if (RequireNonAbstractType(PropertyIvarLoc,
|
||||
|
|
|
@ -6000,7 +6000,7 @@ checkOpenMPLoop(OpenMPDirectiveKind DKind, Expr *CollapseLoopCountExpr,
|
|||
CollapseLoopCountExpr->EvaluateAsInt(Result, SemaRef.getASTContext())) {
|
||||
NestedLoopCount = Result.Val.getInt().getLimitedValue();
|
||||
} else {
|
||||
Built.clear(/*size=*/1);
|
||||
Built.clear(/*Size=*/1);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
@ -6022,7 +6022,7 @@ checkOpenMPLoop(OpenMPDirectiveKind DKind, Expr *CollapseLoopCountExpr,
|
|||
}
|
||||
OrderedLoopCount = Result.getLimitedValue();
|
||||
} else {
|
||||
Built.clear(/*size=*/1);
|
||||
Built.clear(/*Size=*/1);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1950,7 +1950,7 @@ IsTransparentUnionStandardConversion(Sema &S, Expr* From,
|
|||
// It's compatible if the expression matches any of the fields.
|
||||
for (const auto *it : UD->fields()) {
|
||||
if (IsStandardConversion(S, From, it->getType(), InOverloadResolution, SCS,
|
||||
CStyle, /*ObjCWritebackConversion=*/false)) {
|
||||
CStyle, /*AllowObjCWritebackConversion=*/false)) {
|
||||
ToType = it->getType();
|
||||
return true;
|
||||
}
|
||||
|
@ -5423,7 +5423,7 @@ static ExprResult CheckConvertedConstantExpression(Sema &S, Expr *From,
|
|||
: TryCopyInitialization(S, From, T,
|
||||
/*SuppressUserConversions=*/false,
|
||||
/*InOverloadResolution=*/false,
|
||||
/*AllowObjcWritebackConversion=*/false,
|
||||
/*AllowObjCWritebackConversion=*/false,
|
||||
/*AllowExplicit=*/false);
|
||||
StandardConversionSequence *SCS = nullptr;
|
||||
switch (ICS.getKind()) {
|
||||
|
@ -7319,7 +7319,7 @@ void Sema::AddMemberOperatorCandidates(OverloadedOperatorKind Op,
|
|||
++Oper)
|
||||
AddMethodCandidate(Oper.getPair(), Args[0]->getType(),
|
||||
Args[0]->Classify(Context), Args.slice(1),
|
||||
CandidateSet, /*SuppressUserConversions=*/false);
|
||||
CandidateSet, /*SuppressUserConversion=*/false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8420,7 +8420,7 @@ public:
|
|||
isEqualOp ? *Ptr : S.Context.getPointerDiffType(),
|
||||
};
|
||||
S.AddBuiltinCandidate(ParamTypes, Args, CandidateSet,
|
||||
/*IsAssigmentOperator=*/ isEqualOp);
|
||||
/*IsAssignmentOperator=*/ isEqualOp);
|
||||
|
||||
bool NeedVolatile = !(*Ptr).isVolatileQualified() &&
|
||||
VisibleTypeConversionsQuals.hasVolatile();
|
||||
|
@ -8429,7 +8429,7 @@ public:
|
|||
ParamTypes[0] =
|
||||
S.Context.getLValueReferenceType(S.Context.getVolatileType(*Ptr));
|
||||
S.AddBuiltinCandidate(ParamTypes, Args, CandidateSet,
|
||||
/*IsAssigmentOperator=*/isEqualOp);
|
||||
/*IsAssignmentOperator=*/isEqualOp);
|
||||
}
|
||||
|
||||
if (!(*Ptr).isRestrictQualified() &&
|
||||
|
@ -8438,7 +8438,7 @@ public:
|
|||
ParamTypes[0]
|
||||
= S.Context.getLValueReferenceType(S.Context.getRestrictType(*Ptr));
|
||||
S.AddBuiltinCandidate(ParamTypes, Args, CandidateSet,
|
||||
/*IsAssigmentOperator=*/isEqualOp);
|
||||
/*IsAssignmentOperator=*/isEqualOp);
|
||||
|
||||
if (NeedVolatile) {
|
||||
// volatile restrict version
|
||||
|
@ -8448,7 +8448,7 @@ public:
|
|||
(Qualifiers::Volatile |
|
||||
Qualifiers::Restrict)));
|
||||
S.AddBuiltinCandidate(ParamTypes, Args, CandidateSet,
|
||||
/*IsAssigmentOperator=*/isEqualOp);
|
||||
/*IsAssignmentOperator=*/isEqualOp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -8469,7 +8469,7 @@ public:
|
|||
|
||||
// non-volatile version
|
||||
S.AddBuiltinCandidate(ParamTypes, Args, CandidateSet,
|
||||
/*IsAssigmentOperator=*/true);
|
||||
/*IsAssignmentOperator=*/true);
|
||||
|
||||
bool NeedVolatile = !(*Ptr).isVolatileQualified() &&
|
||||
VisibleTypeConversionsQuals.hasVolatile();
|
||||
|
@ -8478,7 +8478,7 @@ public:
|
|||
ParamTypes[0] =
|
||||
S.Context.getLValueReferenceType(S.Context.getVolatileType(*Ptr));
|
||||
S.AddBuiltinCandidate(ParamTypes, Args, CandidateSet,
|
||||
/*IsAssigmentOperator=*/true);
|
||||
/*IsAssignmentOperator=*/true);
|
||||
}
|
||||
|
||||
if (!(*Ptr).isRestrictQualified() &&
|
||||
|
@ -8487,7 +8487,7 @@ public:
|
|||
ParamTypes[0]
|
||||
= S.Context.getLValueReferenceType(S.Context.getRestrictType(*Ptr));
|
||||
S.AddBuiltinCandidate(ParamTypes, Args, CandidateSet,
|
||||
/*IsAssigmentOperator=*/true);
|
||||
/*IsAssignmentOperator=*/true);
|
||||
|
||||
if (NeedVolatile) {
|
||||
// volatile restrict version
|
||||
|
@ -8497,7 +8497,7 @@ public:
|
|||
(Qualifiers::Volatile |
|
||||
Qualifiers::Restrict)));
|
||||
S.AddBuiltinCandidate(ParamTypes, Args, CandidateSet,
|
||||
/*IsAssigmentOperator=*/true);
|
||||
/*IsAssignmentOperator=*/true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -8530,14 +8530,14 @@ public:
|
|||
// Add this built-in operator as a candidate (VQ is empty).
|
||||
ParamTypes[0] = S.Context.getLValueReferenceType(LeftBaseTy);
|
||||
S.AddBuiltinCandidate(ParamTypes, Args, CandidateSet,
|
||||
/*IsAssigmentOperator=*/isEqualOp);
|
||||
/*IsAssignmentOperator=*/isEqualOp);
|
||||
|
||||
// Add this built-in operator as a candidate (VQ is 'volatile').
|
||||
if (VisibleTypeConversionsQuals.hasVolatile()) {
|
||||
ParamTypes[0] = S.Context.getVolatileType(LeftBaseTy);
|
||||
ParamTypes[0] = S.Context.getLValueReferenceType(ParamTypes[0]);
|
||||
S.AddBuiltinCandidate(ParamTypes, Args, CandidateSet,
|
||||
/*IsAssigmentOperator=*/isEqualOp);
|
||||
/*IsAssignmentOperator=*/isEqualOp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -8556,14 +8556,14 @@ public:
|
|||
// Add this built-in operator as a candidate (VQ is empty).
|
||||
ParamTypes[0] = S.Context.getLValueReferenceType(*Vec1);
|
||||
S.AddBuiltinCandidate(ParamTypes, Args, CandidateSet,
|
||||
/*IsAssigmentOperator=*/isEqualOp);
|
||||
/*IsAssignmentOperator=*/isEqualOp);
|
||||
|
||||
// Add this built-in operator as a candidate (VQ is 'volatile').
|
||||
if (VisibleTypeConversionsQuals.hasVolatile()) {
|
||||
ParamTypes[0] = S.Context.getVolatileType(*Vec1);
|
||||
ParamTypes[0] = S.Context.getLValueReferenceType(ParamTypes[0]);
|
||||
S.AddBuiltinCandidate(ParamTypes, Args, CandidateSet,
|
||||
/*IsAssigmentOperator=*/isEqualOp);
|
||||
/*IsAssignmentOperator=*/isEqualOp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -9012,7 +9012,7 @@ Sema::AddArgumentDependentLookupCandidates(DeclarationName Name,
|
|||
continue;
|
||||
|
||||
AddOverloadCandidate(FD, FoundDecl, Args, CandidateSet,
|
||||
/*SupressUserConversions=*/false, PartialOverloading,
|
||||
/*SuppressUserConversions=*/false, PartialOverloading,
|
||||
/*AllowExplicit*/ true,
|
||||
/*AllowExplicitConversions*/ false,
|
||||
ADLCallKind::UsesADL);
|
||||
|
@ -11763,7 +11763,7 @@ static void AddOverloadedCallCandidate(Sema &S,
|
|||
return;
|
||||
|
||||
S.AddOverloadCandidate(Func, FoundDecl, Args, CandidateSet,
|
||||
/*SuppressUsedConversions=*/false,
|
||||
/*SuppressUserConversions=*/false,
|
||||
PartialOverloading);
|
||||
return;
|
||||
}
|
||||
|
@ -11772,7 +11772,7 @@ static void AddOverloadedCallCandidate(Sema &S,
|
|||
= dyn_cast<FunctionTemplateDecl>(Callee)) {
|
||||
S.AddTemplateOverloadCandidate(FuncTemplate, FoundDecl,
|
||||
ExplicitTemplateArgs, Args, CandidateSet,
|
||||
/*SuppressUsedConversions=*/false,
|
||||
/*SuppressUserConversions=*/false,
|
||||
PartialOverloading);
|
||||
return;
|
||||
}
|
||||
|
@ -13066,7 +13066,7 @@ Sema::BuildCallToMemberFunction(Scope *S, Expr *MemExprE,
|
|||
AddMethodTemplateCandidate(
|
||||
cast<FunctionTemplateDecl>(Func), I.getPair(), ActingDC,
|
||||
TemplateArgs, ObjectType, ObjectClassification, Args, CandidateSet,
|
||||
/*SuppressUsedConversions=*/false);
|
||||
/*SuppressUserConversions=*/false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -13262,7 +13262,7 @@ Sema::BuildCallToObjectOfClassType(Scope *S, Expr *Obj,
|
|||
Oper != OperEnd; ++Oper) {
|
||||
AddMethodCandidate(Oper.getPair(), Object.get()->getType(),
|
||||
Object.get()->Classify(Context), Args, CandidateSet,
|
||||
/*SuppressUserConversions=*/false);
|
||||
/*SuppressUserConversion=*/false);
|
||||
}
|
||||
|
||||
// C++ [over.call.object]p2:
|
||||
|
@ -13537,7 +13537,7 @@ Sema::BuildOverloadedArrowExpr(Scope *S, Expr *Base, SourceLocation OpLoc,
|
|||
for (LookupResult::iterator Oper = R.begin(), OperEnd = R.end();
|
||||
Oper != OperEnd; ++Oper) {
|
||||
AddMethodCandidate(Oper.getPair(), Base->getType(), Base->Classify(Context),
|
||||
None, CandidateSet, /*SuppressUserConversions=*/false);
|
||||
None, CandidateSet, /*SuppressUserConversion=*/false);
|
||||
}
|
||||
|
||||
bool HadMultipleCandidates = (CandidateSet.size() > 1);
|
||||
|
@ -13919,7 +13919,7 @@ Expr *Sema::FixOverloadedFunctionReference(Expr *E, DeclAccessPair Found,
|
|||
if (MemExpr->getQualifier())
|
||||
Loc = MemExpr->getQualifierLoc().getBeginLoc();
|
||||
Base =
|
||||
BuildCXXThisExpr(Loc, MemExpr->getBaseType(), /*isImplicit=*/true);
|
||||
BuildCXXThisExpr(Loc, MemExpr->getBaseType(), /*IsImplicit=*/true);
|
||||
}
|
||||
} else
|
||||
Base = MemExpr->getBase();
|
||||
|
|
|
@ -2447,7 +2447,7 @@ StmtResult Sema::BuildCXXForRangeStmt(SourceLocation ForLoc,
|
|||
|
||||
ExprResult SizeOfVLAExprR = ActOnUnaryExprOrTypeTraitExpr(
|
||||
EndVar->getLocation(), UETT_SizeOf,
|
||||
/*isType=*/true,
|
||||
/*IsType=*/true,
|
||||
CreateParsedType(VAT->desugar(), Context.getTrivialTypeSourceInfo(
|
||||
VAT->desugar(), RangeLoc))
|
||||
.getAsOpaquePtr(),
|
||||
|
@ -2457,7 +2457,7 @@ StmtResult Sema::BuildCXXForRangeStmt(SourceLocation ForLoc,
|
|||
|
||||
ExprResult SizeOfEachElementExprR = ActOnUnaryExprOrTypeTraitExpr(
|
||||
EndVar->getLocation(), UETT_SizeOf,
|
||||
/*isType=*/true,
|
||||
/*IsType=*/true,
|
||||
CreateParsedType(VAT->desugar(),
|
||||
Context.getTrivialTypeSourceInfo(
|
||||
VAT->getElementType(), RangeLoc))
|
||||
|
|
|
@ -849,7 +849,7 @@ Sema::LookupInlineAsmVarDeclField(Expr *E, StringRef Member,
|
|||
return CXXDependentScopeMemberExpr::Create(
|
||||
Context, E, T, /*IsArrow=*/false, AsmLoc, NestedNameSpecifierLoc(),
|
||||
SourceLocation(),
|
||||
/*FirstQualifierInScope=*/nullptr, NameInfo, /*TemplateArgs=*/nullptr);
|
||||
/*FirstQualifierFoundInScope=*/nullptr, NameInfo, /*TemplateArgs=*/nullptr);
|
||||
}
|
||||
|
||||
const RecordType *RT = T->getAs<RecordType>();
|
||||
|
|
|
@ -8428,8 +8428,8 @@ bool Sema::CheckFunctionTemplateSpecialization(
|
|||
// here that have a different target.
|
||||
if (LangOpts.CUDA &&
|
||||
IdentifyCUDATarget(Specialization,
|
||||
/* IgnoreImplicitHDAttributes = */ true) !=
|
||||
IdentifyCUDATarget(FD, /* IgnoreImplicitHDAttributes = */ true)) {
|
||||
/* IgnoreImplicitHDAttr = */ true) !=
|
||||
IdentifyCUDATarget(FD, /* IgnoreImplicitHDAttr = */ true)) {
|
||||
FailedCandidates.addCandidate().set(
|
||||
I.getPair(), FunTmpl->getTemplatedDecl(),
|
||||
MakeDeductionFailureInfo(Context, TDK_CUDATargetMismatch, Info));
|
||||
|
@ -9587,7 +9587,7 @@ DeclResult Sema::ActOnExplicitInstantiation(Scope *S,
|
|||
// have a different target.
|
||||
if (LangOpts.CUDA &&
|
||||
IdentifyCUDATarget(Specialization,
|
||||
/* IgnoreImplicitHDAttributes = */ true) !=
|
||||
/* IgnoreImplicitHDAttr = */ true) !=
|
||||
IdentifyCUDATarget(D.getDeclSpec().getAttributes())) {
|
||||
FailedCandidates.addCandidate().set(
|
||||
P.getPair(), FunTmpl->getTemplatedDecl(),
|
||||
|
|
|
@ -2872,7 +2872,7 @@ Sema::DeduceTemplateArguments(ClassTemplatePartialSpecializationDecl *Partial,
|
|||
return Sema::TDK_SubstitutionFailure;
|
||||
|
||||
return ::FinishTemplateArgumentDeduction(
|
||||
*this, Partial, /*PartialOrdering=*/false, TemplateArgs, Deduced, Info);
|
||||
*this, Partial, /*IsPartialOrdering=*/false, TemplateArgs, Deduced, Info);
|
||||
}
|
||||
|
||||
/// Perform template argument deduction to determine whether
|
||||
|
@ -2913,7 +2913,7 @@ Sema::DeduceTemplateArguments(VarTemplatePartialSpecializationDecl *Partial,
|
|||
return Sema::TDK_SubstitutionFailure;
|
||||
|
||||
return ::FinishTemplateArgumentDeduction(
|
||||
*this, Partial, /*PartialOrdering=*/false, TemplateArgs, Deduced, Info);
|
||||
*this, Partial, /*IsPartialOrdering=*/false, TemplateArgs, Deduced, Info);
|
||||
}
|
||||
|
||||
/// Determine whether the given type T is a simple-template-id type.
|
||||
|
@ -5067,7 +5067,7 @@ static bool isAtLeastAsSpecializedAs(Sema &S, QualType T1, QualType T2,
|
|||
Info);
|
||||
auto *TST1 = T1->castAs<TemplateSpecializationType>();
|
||||
if (FinishTemplateArgumentDeduction(
|
||||
S, P2, /*PartialOrdering=*/true,
|
||||
S, P2, /*IsPartialOrdering=*/true,
|
||||
TemplateArgumentList(TemplateArgumentList::OnStack,
|
||||
TST1->template_arguments()),
|
||||
Deduced, Info))
|
||||
|
|
|
@ -751,7 +751,7 @@ static void maybeSynthesizeBlockSignature(TypeProcessingState &state,
|
|||
/*IsAmbiguous=*/false,
|
||||
/*LParenLoc=*/NoLoc,
|
||||
/*ArgInfo=*/nullptr,
|
||||
/*NumArgs=*/0,
|
||||
/*NumParams=*/0,
|
||||
/*EllipsisLoc=*/NoLoc,
|
||||
/*RParenLoc=*/NoLoc,
|
||||
/*RefQualifierIsLvalueRef=*/true,
|
||||
|
|
|
@ -8252,7 +8252,7 @@ void ASTReader::UpdateSema() {
|
|||
// Update the state of pragmas. Use the same API as if we had encountered the
|
||||
// pragma in the source.
|
||||
if(OptimizeOffPragmaLocation.isValid())
|
||||
SemaObj->ActOnPragmaOptimize(/* IsOn = */ false, OptimizeOffPragmaLocation);
|
||||
SemaObj->ActOnPragmaOptimize(/* On = */ false, OptimizeOffPragmaLocation);
|
||||
if (PragmaMSStructState != -1)
|
||||
SemaObj->ActOnPragmaMSStruct((PragmaMSStructKind)PragmaMSStructState);
|
||||
if (PointersToMembersPragmaLocation.isValid()) {
|
||||
|
|
|
@ -2861,7 +2861,7 @@ Stmt *ASTReader::ReadStmtFromStream(ModuleFile &F) {
|
|||
|
||||
case STMT_CXX_TRY:
|
||||
S = CXXTryStmt::Create(Context, Empty,
|
||||
/*NumHandlers=*/Record[ASTStmtReader::NumStmtFields]);
|
||||
/*numHandlers=*/Record[ASTStmtReader::NumStmtFields]);
|
||||
break;
|
||||
|
||||
case STMT_CXX_FOR_RANGE:
|
||||
|
|
|
@ -1447,7 +1447,7 @@ ASTFileSignature ASTWriter::writeUnhashedControlBlock(Preprocessor &PP,
|
|||
Stream.EmitRecord(DIAGNOSTIC_OPTIONS, Record);
|
||||
|
||||
// Write out the diagnostic/pragma mappings.
|
||||
WritePragmaDiagnosticMappings(Diags, /* IsModule = */ WritingModule);
|
||||
WritePragmaDiagnosticMappings(Diags, /* isModule = */ WritingModule);
|
||||
|
||||
// Leave the options block.
|
||||
Stream.ExitBlock();
|
||||
|
|
|
@ -658,8 +658,8 @@ llvm::Error GlobalModuleIndexBuilder::loadModuleFile(const FileEntry *File) {
|
|||
|
||||
// Find the imported module file.
|
||||
const FileEntry *DependsOnFile
|
||||
= FileMgr.getFile(ImportedFile, /*openFile=*/false,
|
||||
/*cacheFailure=*/false);
|
||||
= FileMgr.getFile(ImportedFile, /*OpenFile=*/false,
|
||||
/*CacheFailure=*/false);
|
||||
|
||||
if (!DependsOnFile)
|
||||
return llvm::createStringError(std::errc::bad_file_descriptor,
|
||||
|
|
|
@ -42,8 +42,8 @@ using namespace clang;
|
|||
using namespace serialization;
|
||||
|
||||
ModuleFile *ModuleManager::lookupByFileName(StringRef Name) const {
|
||||
const FileEntry *Entry = FileMgr.getFile(Name, /*openFile=*/false,
|
||||
/*cacheFailure=*/false);
|
||||
const FileEntry *Entry = FileMgr.getFile(Name, /*OpenFile=*/false,
|
||||
/*CacheFailure=*/false);
|
||||
if (Entry)
|
||||
return lookup(Entry);
|
||||
|
||||
|
@ -68,8 +68,8 @@ ModuleFile *ModuleManager::lookup(const FileEntry *File) const {
|
|||
|
||||
std::unique_ptr<llvm::MemoryBuffer>
|
||||
ModuleManager::lookupBuffer(StringRef Name) {
|
||||
const FileEntry *Entry = FileMgr.getFile(Name, /*openFile=*/false,
|
||||
/*cacheFailure=*/false);
|
||||
const FileEntry *Entry = FileMgr.getFile(Name, /*OpenFile=*/false,
|
||||
/*CacheFailure=*/false);
|
||||
return std::move(InMemoryBuffers[Entry]);
|
||||
}
|
||||
|
||||
|
@ -184,7 +184,7 @@ ModuleManager::addModule(StringRef FileName, ModuleKind Type,
|
|||
} else {
|
||||
// Get a buffer of the file and close the file descriptor when done.
|
||||
Buf = FileMgr.getBufferForFile(NewModule->File,
|
||||
/*IsVolatile=*/false,
|
||||
/*isVolatile=*/false,
|
||||
/*ShouldClose=*/true);
|
||||
}
|
||||
|
||||
|
@ -447,7 +447,7 @@ bool ModuleManager::lookupModuleFile(StringRef FileName,
|
|||
|
||||
// Open the file immediately to ensure there is no race between stat'ing and
|
||||
// opening the file.
|
||||
File = FileMgr.getFile(FileName, /*openFile=*/true, /*cacheFailure=*/false);
|
||||
File = FileMgr.getFile(FileName, /*OpenFile=*/true, /*CacheFailure=*/false);
|
||||
if (!File)
|
||||
return false;
|
||||
|
||||
|
|
|
@ -144,7 +144,7 @@ static void recordFixedType(const MemRegion *Region, const CXXMethodDecl *MD,
|
|||
QualType Ty = Ctx.getPointerType(Ctx.getRecordType(MD->getParent()));
|
||||
|
||||
ProgramStateRef State = C.getState();
|
||||
State = setDynamicTypeInfo(State, Region, Ty, /*CanBeSubclass=*/false);
|
||||
State = setDynamicTypeInfo(State, Region, Ty, /*CanBeSubClassed=*/false);
|
||||
C.addTransition(State);
|
||||
}
|
||||
|
||||
|
@ -307,7 +307,7 @@ void DynamicTypePropagation::checkPostStmt(const CXXNewExpr *NewE,
|
|||
return;
|
||||
|
||||
C.addTransition(setDynamicTypeInfo(C.getState(), MR, NewE->getType(),
|
||||
/*CanBeSubclass=*/false));
|
||||
/*CanBeSubClassed=*/false));
|
||||
}
|
||||
|
||||
const ObjCObjectType *
|
||||
|
@ -887,7 +887,7 @@ void DynamicTypePropagation::checkPostObjCMessage(const ObjCMethodCall &M,
|
|||
// MostSpecializedTypeArgsMap. We should only store anything in the later if
|
||||
// the stored data differs from the one stored in the former.
|
||||
State = setDynamicTypeInfo(State, RetRegion, ResultType,
|
||||
/*CanBeSubclass=*/true);
|
||||
/*CanBeSubClassed=*/true);
|
||||
Pred = C.addTransition(State);
|
||||
}
|
||||
|
||||
|
|
|
@ -196,7 +196,7 @@ static void emitDiagnostics(const BoundNodes &Nodes,
|
|||
ADC->getDecl(),
|
||||
Checker,
|
||||
/*Name=*/"GCD performance anti-pattern",
|
||||
/*Category=*/"Performance",
|
||||
/*BugCategory=*/"Performance",
|
||||
OS.str(),
|
||||
PathDiagnosticLocation::createBegin(SW, BR.getSourceManager(), ADC),
|
||||
SW->getSourceRange());
|
||||
|
|
|
@ -115,7 +115,7 @@ bool FindIdenticalExprVisitor::VisitIfStmt(const IfStmt *I) {
|
|||
if (const CompoundStmt *CS = dyn_cast<CompoundStmt>(Stmt1)) {
|
||||
if (!CS->body_empty()) {
|
||||
const IfStmt *InnerIf = dyn_cast<IfStmt>(*CS->body_begin());
|
||||
if (InnerIf && isIdenticalStmt(AC->getASTContext(), I->getCond(), InnerIf->getCond(), /*ignoreSideEffects=*/ false)) {
|
||||
if (InnerIf && isIdenticalStmt(AC->getASTContext(), I->getCond(), InnerIf->getCond(), /*IgnoreSideEffects=*/ false)) {
|
||||
PathDiagnosticLocation ELoc(InnerIf->getCond(), BR.getSourceManager(), AC);
|
||||
BR.EmitBasicReport(AC->getDecl(), Checker, "Identical conditions",
|
||||
categories::LogicError,
|
||||
|
|
|
@ -1208,7 +1208,7 @@ void MallocChecker::checkPostObjCMessage(const ObjCMethodCall &Call,
|
|||
ProgramStateRef State = FreeMemAux(C, Call.getArgExpr(0),
|
||||
Call.getOriginExpr(), C.getState(),
|
||||
/*Hold=*/true, ReleasedAllocatedMemory,
|
||||
/*RetNullOnFailure=*/true);
|
||||
/*ReturnsNullOnFailure=*/true);
|
||||
|
||||
C.addTransition(State);
|
||||
}
|
||||
|
|
|
@ -478,7 +478,7 @@ void NullabilityChecker::checkEvent(ImplicitNullDerefEvent Event) const {
|
|||
return;
|
||||
|
||||
const MemRegion *Region =
|
||||
getTrackRegion(Event.Location, /*CheckSuperregion=*/true);
|
||||
getTrackRegion(Event.Location, /*CheckSuperRegion=*/true);
|
||||
if (!Region)
|
||||
return;
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ static void emitDiagnostics(const BoundNodes &Nodes,
|
|||
ADC->getDecl(),
|
||||
Checker,
|
||||
/*Name=*/"OSObject C-Style Cast",
|
||||
/*Category=*/"Security",
|
||||
/*BugCategory=*/"Security",
|
||||
OS.str(),
|
||||
PathDiagnosticLocation::createBegin(CE, BR.getSourceManager(), ADC),
|
||||
CE->getSourceRange());
|
||||
|
|
|
@ -136,7 +136,7 @@ static void emitDiagnostics(BoundNodes &Match, const Decl *D, BugReporter &BR,
|
|||
ADC->getDecl(), Checker,
|
||||
/*Name=*/(llvm::Twine(ActionMsg)
|
||||
+ " autoreleasing out parameter inside autorelease pool").str(),
|
||||
/*Category=*/"Memory",
|
||||
/*BugCategory=*/"Memory",
|
||||
(llvm::Twine(ActionMsg) + " autoreleasing out parameter " +
|
||||
(IsCapture ? "'" + PVD->getName() + "'" + " " : "") + "inside " +
|
||||
"autorelease pool that may exit before " + Name + " returns; consider "
|
||||
|
|
|
@ -951,7 +951,7 @@ bool RetainCountChecker::evalCall(const CallEvent &Call,
|
|||
// And on the original branch assume that both input and
|
||||
// output are non-zero.
|
||||
if (auto L = RetVal.getAs<DefinedOrUnknownSVal>())
|
||||
state = state->assume(*L, /*Assumption=*/true);
|
||||
state = state->assume(*L, /*assumption=*/true);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@ StringRef RefCountBug::getDescription() const {
|
|||
|
||||
RefCountBug::RefCountBug(const CheckerBase *Checker, RefCountBugType BT)
|
||||
: BugType(Checker, bugTypeToName(BT), categories::MemoryRefCount,
|
||||
/*SupressOnSink=*/BT == LeakWithinFunction || BT == LeakAtReturn),
|
||||
/*SuppressOnSink=*/BT == LeakWithinFunction || BT == LeakAtReturn),
|
||||
BT(BT), Checker(Checker) {}
|
||||
|
||||
static bool isNumericLiteralExpression(const Expr *E) {
|
||||
|
|
|
@ -115,7 +115,7 @@ static void emitDiagnostics(BoundNodes &Match,
|
|||
|
||||
BR.EmitBasicReport(ADC->getDecl(), Checker,
|
||||
/*Name=*/"Memory leak inside autorelease pool",
|
||||
/*Category=*/"Memory",
|
||||
/*BugCategory=*/"Memory",
|
||||
/*Name=*/
|
||||
(Twine("Temporary objects allocated in the") +
|
||||
" autorelease pool " +
|
||||
|
|
|
@ -87,7 +87,7 @@ public:
|
|||
|
||||
if (isNonNullPtr(Call, C))
|
||||
if (auto L = Call.getReturnValue().getAs<Loc>())
|
||||
State = State->assume(*L, /*Assumption=*/true);
|
||||
State = State->assume(*L, /*assumption=*/true);
|
||||
|
||||
C.addTransition(State);
|
||||
}
|
||||
|
@ -106,7 +106,7 @@ public:
|
|||
(Msg.getSelector() == SetObjectForKeyedSubscriptSel ||
|
||||
Msg.getSelector() == SetObjectForKeySel)) {
|
||||
if (auto L = Msg.getArgSVal(1).getAs<Loc>())
|
||||
State = State->assume(*L, /*Assumption=*/true);
|
||||
State = State->assume(*L, /*assumption=*/true);
|
||||
}
|
||||
|
||||
// Record an implication: index is non-null if the output is non-null.
|
||||
|
|
|
@ -23,7 +23,7 @@ AnalysisManager::AnalysisManager(ASTContext &ASTCtx, DiagnosticsEngine &diags,
|
|||
: AnaCtxMgr(
|
||||
ASTCtx, Options.UnoptimizedCFG,
|
||||
Options.ShouldIncludeImplicitDtorsInCFG,
|
||||
/*AddInitializers=*/true,
|
||||
/*addInitializers=*/true,
|
||||
Options.ShouldIncludeTemporaryDtorsInCFG,
|
||||
Options.ShouldIncludeLifetimeInCFG,
|
||||
// Adding LoopExit elements to the CFG is a requirement for loop
|
||||
|
|
|
@ -1259,7 +1259,7 @@ generateEmptyDiagnosticForReport(BugReport *R, SourceManager &SM) {
|
|||
return llvm::make_unique<PathDiagnostic>(
|
||||
R->getBugType().getCheckName(), R->getDeclWithIssue(),
|
||||
R->getBugType().getName(), R->getDescription(),
|
||||
R->getShortDescription(/*Fallback=*/false), BT.getCategory(),
|
||||
R->getShortDescription(/*UseFallback=*/false), BT.getCategory(),
|
||||
R->getUniqueingLocation(), R->getUniqueingDecl(),
|
||||
findExecutedLines(SM, R->getErrorNode()));
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ DynamicTypeInfo getDynamicTypeInfo(ProgramStateRef State,
|
|||
|
||||
// Otherwise, fall back to what we know about the region.
|
||||
if (const auto *TR = dyn_cast<TypedRegion>(Reg))
|
||||
return DynamicTypeInfo(TR->getLocationType(), /*CanBeSubclass=*/false);
|
||||
return DynamicTypeInfo(TR->getLocationType(), /*CanBeSub=*/false);
|
||||
|
||||
if (const auto *SR = dyn_cast<SymbolicRegion>(Reg)) {
|
||||
SymbolRef Sym = SR->getSymbol();
|
||||
|
|
|
@ -1568,7 +1568,7 @@ void ExprEngine::Visit(const Stmt *S, ExplodedNode *Pred,
|
|||
ProgramStateRef NewState =
|
||||
createTemporaryRegionIfNeeded(State, LCtx, OCE->getArg(0));
|
||||
if (NewState != State) {
|
||||
Pred = Bldr.generateNode(OCE, Pred, NewState, /*Tag=*/nullptr,
|
||||
Pred = Bldr.generateNode(OCE, Pred, NewState, /*tag=*/nullptr,
|
||||
ProgramPoint::PreStmtKind);
|
||||
// Did we cache out?
|
||||
if (!Pred)
|
||||
|
|
|
@ -327,30 +327,30 @@ void ExprEngine::processCallExit(ExplodedNode *CEBNode) {
|
|||
ExplodedNodeSet DstPostPostCallCallback;
|
||||
getCheckerManager().runCheckersForPostCall(DstPostPostCallCallback,
|
||||
CEENode, *UpdatedCall, *this,
|
||||
/*WasInlined=*/true);
|
||||
/*wasInlined=*/true);
|
||||
for (auto I : DstPostPostCallCallback) {
|
||||
getCheckerManager().runCheckersForNewAllocator(
|
||||
CNE,
|
||||
*getObjectUnderConstruction(I->getState(), CNE,
|
||||
calleeCtx->getParent()),
|
||||
DstPostCall, I, *this,
|
||||
/*WasInlined=*/true);
|
||||
/*wasInlined=*/true);
|
||||
}
|
||||
} else {
|
||||
getCheckerManager().runCheckersForPostCall(DstPostCall, CEENode,
|
||||
*UpdatedCall, *this,
|
||||
/*WasInlined=*/true);
|
||||
/*wasInlined=*/true);
|
||||
}
|
||||
ExplodedNodeSet Dst;
|
||||
if (const ObjCMethodCall *Msg = dyn_cast<ObjCMethodCall>(Call)) {
|
||||
getCheckerManager().runCheckersForPostObjCMessage(Dst, DstPostCall, *Msg,
|
||||
*this,
|
||||
/*WasInlined=*/true);
|
||||
/*wasInlined=*/true);
|
||||
} else if (CE &&
|
||||
!(isa<CXXNewExpr>(CE) && // Called when visiting CXXNewExpr.
|
||||
AMgr.getAnalyzerOptions().MayInlineCXXAllocator)) {
|
||||
getCheckerManager().runCheckersForPostStmt(Dst, DstPostCall, CE,
|
||||
*this, /*WasInlined=*/true);
|
||||
*this, /*wasInlined=*/true);
|
||||
} else {
|
||||
Dst.insert(DstPostCall);
|
||||
}
|
||||
|
@ -645,7 +645,7 @@ ProgramStateRef ExprEngine::bindReturnValue(const CallEvent &Call,
|
|||
ITraits.setTrait(TargetR,
|
||||
RegionAndSymbolInvalidationTraits::TK_DoNotInvalidateSuperRegion);
|
||||
State = State->invalidateRegions(TargetR, E, Count, LCtx,
|
||||
/* CausedByPointerEscape=*/false, nullptr,
|
||||
/* CausesPointerEscape=*/false, nullptr,
|
||||
&Call, &ITraits);
|
||||
|
||||
R = State->getSVal(Target.castAs<Loc>(), E->getType());
|
||||
|
|
|
@ -1253,7 +1253,7 @@ RegionStoreManager::invalidateGlobalRegion(MemRegion::Kind K,
|
|||
// Bind the globals memory space to a new symbol that we will use to derive
|
||||
// the bindings for all globals.
|
||||
const GlobalsSpaceRegion *GS = MRMgr.getGlobalsRegion(K);
|
||||
SVal V = svalBuilder.conjureSymbolVal(/* SymbolTag = */ (const void*) GS, Ex, LCtx,
|
||||
SVal V = svalBuilder.conjureSymbolVal(/* symbolTag = */ (const void*) GS, Ex, LCtx,
|
||||
/* type does not matter */ Ctx.IntTy,
|
||||
Count);
|
||||
|
||||
|
|
|
@ -525,7 +525,7 @@ SVal SimpleSValBuilder::evalBinOpNN(ProgramStateRef state,
|
|||
case BO_Sub:
|
||||
if (resultTy->isIntegralOrEnumerationType())
|
||||
return makeIntVal(0, resultTy);
|
||||
return evalCastFromNonLoc(makeIntVal(0, /*Unsigned=*/false), resultTy);
|
||||
return evalCastFromNonLoc(makeIntVal(0, /*isUnsigned=*/false), resultTy);
|
||||
case BO_Or:
|
||||
case BO_And:
|
||||
return evalCastFromNonLoc(lhs, resultTy);
|
||||
|
|
|
@ -1606,7 +1606,7 @@ void LinkerDriver::link(ArrayRef<const char *> argsArr) {
|
|||
// Handle generation of import library from a def file.
|
||||
if (!args.hasArg(OPT_INPUT)) {
|
||||
fixupExports();
|
||||
createImportLibrary(/*AsLib=*/true);
|
||||
createImportLibrary(/*asLib=*/true);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1830,7 +1830,7 @@ void LinkerDriver::link(ArrayRef<const char *> argsArr) {
|
|||
// need to create a .lib file.
|
||||
if (!config->exports.empty() || config->dll) {
|
||||
fixupExports();
|
||||
createImportLibrary(/*AsLib=*/false);
|
||||
createImportLibrary(/*asLib=*/false);
|
||||
assignExportOrdinals();
|
||||
}
|
||||
|
||||
|
|
|
@ -348,7 +348,7 @@ public:
|
|||
// IsVolatileSize=true forces MemoryBuffer to not use mmap().
|
||||
return CHECK(MemoryBuffer::getFile(path, /*FileSize=*/-1,
|
||||
/*RequiresNullTerminator=*/false,
|
||||
/*IsVolatileSize=*/true),
|
||||
/*IsVolatile=*/true),
|
||||
"could not open " + path);
|
||||
}
|
||||
|
||||
|
|
|
@ -272,7 +272,7 @@ void LinkerDriver::addFile(StringRef path, bool withLOption) {
|
|||
// Add a given library by searching it from input search paths.
|
||||
void LinkerDriver::addLibrary(StringRef name) {
|
||||
if (Optional<std::string> path = searchLibrary(name))
|
||||
addFile(*path, /*WithLOption=*/true);
|
||||
addFile(*path, /*withLOption=*/true);
|
||||
else
|
||||
error("unable to find library -l" + name);
|
||||
}
|
||||
|
@ -1118,7 +1118,7 @@ void LinkerDriver::createFiles(opt::InputArgList &args) {
|
|||
addLibrary(arg->getValue());
|
||||
break;
|
||||
case OPT_INPUT:
|
||||
addFile(arg->getValue(), /*WithLOption=*/false);
|
||||
addFile(arg->getValue(), /*withLOption=*/false);
|
||||
break;
|
||||
case OPT_defsym: {
|
||||
StringRef from;
|
||||
|
@ -1386,7 +1386,7 @@ static void replaceCommonSymbols() {
|
|||
bss->markDead();
|
||||
inputSections.push_back(bss);
|
||||
s->replace(Defined{s->file, s->getName(), s->binding, s->stOther, s->type,
|
||||
/*Value=*/0, s->size, bss});
|
||||
/*value=*/0, s->size, bss});
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -1540,7 +1540,7 @@ template <class ELFT> void LinkerDriver::compileBitcodeFiles() {
|
|||
|
||||
for (InputFile *file : lto->compile()) {
|
||||
auto *obj = cast<ObjFile<ELFT>>(file);
|
||||
obj->parse(/*IgnoreComdats=*/true);
|
||||
obj->parse(/*ignoreComdats=*/true);
|
||||
for (Symbol *sym : obj->getGlobalSymbols())
|
||||
sym->parseSymbolVersion();
|
||||
objectFiles.push_back(file);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue