diff options
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/ASTMatchers/Dynamic/Marshallers.h | 16 | ||||
-rw-r--r-- | clang/lib/CodeGen/CGOpenMPRuntime.cpp | 9 | ||||
-rw-r--r-- | clang/lib/Sema/SemaType.cpp | 19 | ||||
-rw-r--r-- | clang/lib/StaticAnalyzer/Checkers/VforkChecker.cpp | 6 | ||||
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/CheckerHelpers.cpp | 4 |
5 files changed, 24 insertions, 30 deletions
diff --git a/clang/lib/ASTMatchers/Dynamic/Marshallers.h b/clang/lib/ASTMatchers/Dynamic/Marshallers.h index 64d6b7814ae..6bf887860bc 100644 --- a/clang/lib/ASTMatchers/Dynamic/Marshallers.h +++ b/clang/lib/ASTMatchers/Dynamic/Marshallers.h @@ -1,4 +1,4 @@ -//===--- Marshallers.h - Generic matcher function marshallers -*- C++ -*-===// +//===--- Marshallers.h - Generic matcher function marshallers ---*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -32,7 +32,6 @@ namespace ast_matchers { namespace dynamic { namespace internal { - /// \brief Helper template class to just from argument type to the right is/get /// functions in VariantValue. /// Used to verify and extract the matcher arguments below. @@ -234,7 +233,7 @@ static VariantMatcher outvalueToVariantMatcher(const DynTypedMatcher &Matcher) { template <typename T> static VariantMatcher outvalueToVariantMatcher(const T &PolyMatcher, typename T::ReturnTypes * = - NULL) { + nullptr) { std::vector<DynTypedMatcher> Matchers; mergePolyMatchers(PolyMatcher, Matchers, typename T::ReturnTypes()); VariantMatcher Out = VariantMatcher::PolymorphicMatcher(std::move(Matchers)); @@ -410,7 +409,6 @@ private: return VariantMatcher(); \ } - /// \brief 0-arg marshaller function. template <typename ReturnType> static VariantMatcher matcherMarshall0(void (*Func)(), StringRef MatcherName, @@ -708,9 +706,9 @@ makeMatcherAutoMarshall(ast_matchers::internal::VariadicOperatorMatcherFunc< MatcherName); } -} // namespace internal -} // namespace dynamic -} // namespace ast_matchers -} // namespace clang +} // namespace internal +} // namespace dynamic +} // namespace ast_matchers +} // namespace clang -#endif // LLVM_CLANG_AST_MATCHERS_DYNAMIC_MARSHALLERS_H +#endif // LLVM_CLANG_AST_MATCHERS_DYNAMIC_MARSHALLERS_H diff --git a/clang/lib/CodeGen/CGOpenMPRuntime.cpp b/clang/lib/CodeGen/CGOpenMPRuntime.cpp index 6aa2737cba3..e6bc99eaf56 100644 --- a/clang/lib/CodeGen/CGOpenMPRuntime.cpp +++ b/clang/lib/CodeGen/CGOpenMPRuntime.cpp @@ -2103,11 +2103,11 @@ CGOpenMPRuntime::createOffloadingBinaryDescriptorRegistration() { CGM.getTypes().ConvertTypeForMem(getTgtOffloadEntryQTy()); llvm::GlobalVariable *HostEntriesBegin = new llvm::GlobalVariable( M, OffloadEntryTy, /*isConstant=*/true, - llvm::GlobalValue::ExternalLinkage, /*Initializer=*/0, + llvm::GlobalValue::ExternalLinkage, /*Initializer=*/nullptr, ".omp_offloading.entries_begin"); llvm::GlobalVariable *HostEntriesEnd = new llvm::GlobalVariable( M, OffloadEntryTy, /*isConstant=*/true, - llvm::GlobalValue::ExternalLinkage, /*Initializer=*/0, + llvm::GlobalValue::ExternalLinkage, /*Initializer=*/nullptr, ".omp_offloading.entries_end"); // Create all device images @@ -2119,10 +2119,11 @@ CGOpenMPRuntime::createOffloadingBinaryDescriptorRegistration() { StringRef T = Devices[i].getTriple(); auto *ImgBegin = new llvm::GlobalVariable( M, CGM.Int8Ty, /*isConstant=*/true, llvm::GlobalValue::ExternalLinkage, - /*Initializer=*/0, Twine(".omp_offloading.img_start.") + Twine(T)); + /*Initializer=*/nullptr, + Twine(".omp_offloading.img_start.") + Twine(T)); auto *ImgEnd = new llvm::GlobalVariable( M, CGM.Int8Ty, /*isConstant=*/true, llvm::GlobalValue::ExternalLinkage, - /*Initializer=*/0, Twine(".omp_offloading.img_end.") + Twine(T)); + /*Initializer=*/nullptr, Twine(".omp_offloading.img_end.") + Twine(T)); llvm::Constant *Dev = llvm::ConstantStruct::get(DeviceImageTy, ImgBegin, ImgEnd, diff --git a/clang/lib/Sema/SemaType.cpp b/clang/lib/Sema/SemaType.cpp index f6ad132cde8..fb8e1e76206 100644 --- a/clang/lib/Sema/SemaType.cpp +++ b/clang/lib/Sema/SemaType.cpp @@ -239,7 +239,7 @@ namespace { savedAttrs.back()->setNext(nullptr); } }; -} +} // end anonymous namespace static void spliceAttrIntoList(AttributeList &attr, AttributeList *&head) { attr.setNext(head); @@ -1821,7 +1821,7 @@ namespace { /// /// The values of this enum are used in diagnostics. enum QualifiedFunctionKind { QFK_BlockPointer, QFK_Pointer, QFK_Reference }; -} +} // end anonymous namespace /// Check whether the type T is a qualified function type, and if it is, /// diagnose that it cannot be contained within the given kind of declarator. @@ -1971,7 +1971,6 @@ static bool isArraySizeVLA(Sema &S, Expr *ArraySize, llvm::APSInt &SizeVal) { S.LangOpts.GNUMode).isInvalid(); } - /// \brief Build an array type. /// /// \param T The type of each element in the array. @@ -3004,7 +3003,7 @@ namespace { BlockPointer, MemberPointer, }; -} +} // end anonymous namespace IdentifierInfo *Sema::getNullabilityKeyword(NullabilityKind nullability) { switch (nullability) { @@ -3064,7 +3063,7 @@ namespace { // NSError** NSErrorPointerPointer, }; -} +} // end anonymous namespace /// Classify the given declarator, whose type-specified is \c type, based on /// what kind of pointer it refers to. @@ -3192,7 +3191,6 @@ static PointerDeclaratorKind classifyPointerDeclarator(Sema &S, break; } while (true); - switch (numNormalPointers) { case 0: return PointerDeclaratorKind::NonPointer; @@ -3641,7 +3639,6 @@ static TypeSourceInfo *GetFullTypeForDeclarator(TypeProcessingState &state, T = S.BuildPointerType(T, DeclType.Loc, Name); if (DeclType.Ptr.TypeQuals) T = S.BuildQualifiedType(T, DeclType.Loc, DeclType.Ptr.TypeQuals); - break; case DeclaratorChunk::Reference: { // Verify that we're not building a reference to pointer to function with @@ -4068,7 +4065,6 @@ static TypeSourceInfo *GetFullTypeForDeclarator(TypeProcessingState &state, T = Context.getFunctionType(T, ParamTys, EPI); } - break; } case DeclaratorChunk::MemberPointer: { @@ -4725,7 +4721,7 @@ namespace { void VisitPipeTypeLoc(PipeTypeLoc TL) { TL.setKWLoc(DS.getTypeSpecTypeLoc()); - TypeSourceInfo *TInfo = 0; + TypeSourceInfo *TInfo = nullptr; Sema::GetTypeFromParser(DS.getRepAsType(), &TInfo); TL.getValueLoc().initializeFullCopy(TInfo->getTypeLoc()); } @@ -4859,7 +4855,7 @@ namespace { llvm_unreachable("unsupported TypeLoc kind in declarator!"); } }; -} +} // end anonymous namespace static void fillAtomicQualLoc(AtomicTypeLoc ATL, const DeclaratorChunk &Chunk) { SourceLocation Loc; @@ -4995,7 +4991,6 @@ ParsedType Sema::ActOnObjCInstanceType(SourceLocation Loc) { return CreateParsedType(T, TInfo); } - //===----------------------------------------------------------------------===// // Type Attribute Processing //===----------------------------------------------------------------------===// @@ -5483,7 +5478,7 @@ namespace { llvm_unreachable("unknown wrapping kind"); } }; -} +} // end anonymous namespace static bool handleMSPointerTypeQualifierAttr(TypeProcessingState &State, AttributeList &Attr, diff --git a/clang/lib/StaticAnalyzer/Checkers/VforkChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/VforkChecker.cpp index 26ffee827cf..75aefc0e838 100644 --- a/clang/lib/StaticAnalyzer/Checkers/VforkChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/VforkChecker.cpp @@ -54,10 +54,10 @@ class VforkChecker : public Checker<check::PreCall, check::PostCall, bool isCallWhitelisted(const IdentifierInfo *II, CheckerContext &C) const; void reportBug(const char *What, CheckerContext &C, - const char *Details = 0) const; + const char *Details = nullptr) const; public: - VforkChecker() : II_vfork(0) {} + VforkChecker() : II_vfork(nullptr) {} void checkPreCall(const CallEvent &Call, CheckerContext &C) const; void checkPostCall(const CallEvent &Call, CheckerContext &C) const; @@ -107,7 +107,7 @@ bool VforkChecker::isCallWhitelisted(const IdentifierInfo *II, "execv", "execvp", "execvpe", - 0, + nullptr }; ASTContext &AC = C.getASTContext(); diff --git a/clang/lib/StaticAnalyzer/Core/CheckerHelpers.cpp b/clang/lib/StaticAnalyzer/Core/CheckerHelpers.cpp index d6aeceb1457..ed41914ebd0 100644 --- a/clang/lib/StaticAnalyzer/Core/CheckerHelpers.cpp +++ b/clang/lib/StaticAnalyzer/Core/CheckerHelpers.cpp @@ -75,8 +75,8 @@ bool clang::ento::containsBuiltinOffsetOf(const Stmt *S) { // Extract lhs and rhs from assignment statement std::pair<const clang::VarDecl *, const clang::Expr *> clang::ento::parseAssignment(const Stmt *S) { - const VarDecl *VD = 0; - const Expr *RHS = 0; + const VarDecl *VD = nullptr; + const Expr *RHS = nullptr; if (auto Assign = dyn_cast_or_null<BinaryOperator>(S)) { if (Assign->isAssignmentOp()) { |