Index: cfe/trunk/include/clang/AST/Expr.h =================================================================== --- cfe/trunk/include/clang/AST/Expr.h +++ cfe/trunk/include/clang/AST/Expr.h @@ -62,7 +62,6 @@ MemberPointerAdjustment } Kind; - struct DTB { const CastExpr *BasePath; const CXXRecordDecl *DerivedClass; @@ -807,7 +806,6 @@ } }; - //===----------------------------------------------------------------------===// // Primary Expressions. //===----------------------------------------------------------------------===// @@ -1675,7 +1673,6 @@ child_range children() { return child_range(&Val, &Val+1); } }; - /// UnaryOperator - This represents the unary-expression's (except sizeof and /// alignof), the postinc/postdec operators from postfix-expression, and various /// extensions. @@ -2159,7 +2156,6 @@ } }; - /// CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]). /// CallExpr itself represents a normal function call, e.g., "f(x, 2)", /// while its subclasses may represent alternative syntax that (semantically) @@ -3456,7 +3452,6 @@ child_range children() { return child_range(&SubStmt, &SubStmt+1); } }; - /// ShuffleVectorExpr - clang-specific builtin-in function /// __builtin_shufflevector. /// This AST node represents a operator that does a constant @@ -3712,7 +3707,7 @@ /// Create an empty __builtin_va_arg expression. explicit VAArgExpr(EmptyShell Empty) - : Expr(VAArgExprClass, Empty), Val(0), TInfo(0, false) {} + : Expr(VAArgExprClass, Empty), Val(nullptr), TInfo(nullptr, false) {} const Expr *getSubExpr() const { return cast(Val); } Expr *getSubExpr() { return cast(Val); } @@ -4406,7 +4401,6 @@ } }; - class ParenListExpr : public Expr { Stmt **Exprs; unsigned NumExprs; @@ -4452,7 +4446,6 @@ friend class ASTStmtWriter; }; - /// \brief Represents a C11 generic selection. /// /// A generic selection (C11 6.5.1.1) contains an unevaluated controlling @@ -4568,7 +4561,6 @@ // Clang Extensions //===----------------------------------------------------------------------===// - /// ExtVectorElementExpr - This represents access to specific elements of a /// vector, and may occur on the left hand side or right hand side. For example /// the following is legal: "V.xy = V.zw" if V is a 4 element extended vector. @@ -4632,7 +4624,6 @@ child_range children() { return child_range(&Base, &Base+1); } }; - /// BlockExpr - Adaptor class for mixing a BlockDecl with expressions. /// ^{ statement-body } or ^(int arg1, float arg2){ statement-body } class BlockExpr : public Expr { @@ -4984,6 +4975,6 @@ } }; -} // end namespace clang +} // end namespace clang -#endif +#endif // LLVM_CLANG_AST_EXPR_H Index: cfe/trunk/include/clang/AST/OpenMPClause.h =================================================================== --- cfe/trunk/include/clang/AST/OpenMPClause.h +++ cfe/trunk/include/clang/AST/OpenMPClause.h @@ -2513,7 +2513,7 @@ /// OMPDeviceClause() : OMPClause(OMPC_device, SourceLocation(), SourceLocation()), - LParenLoc(SourceLocation()), Device(0) {} + LParenLoc(SourceLocation()), Device(nullptr) {} /// \brief Sets the location of '('. void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; } /// \brief Returns the location of '('. @@ -2593,5 +2593,4 @@ } // end namespace clang -#endif - +#endif // LLVM_CLANG_AST_OPENMPCLAUSE_H Index: cfe/trunk/include/clang/Analysis/CFG.h =================================================================== --- cfe/trunk/include/clang/Analysis/CFG.h +++ cfe/trunk/include/clang/Analysis/CFG.h @@ -229,7 +229,6 @@ return static_cast(Data2.getPointer()); } - private: friend class CFGElement; CFGDeleteDtor() {} @@ -693,7 +692,7 @@ iterator beginAutomaticObjDtorsInsert(iterator I, size_t Cnt, BumpVectorContext &C) { return iterator(Elements.insert(I.base(), Cnt, - CFGAutomaticObjDtor(nullptr, 0), C)); + CFGAutomaticObjDtor(nullptr, nullptr), C)); } iterator insertAutomaticObjDtor(iterator I, VarDecl *VD, Stmt *S) { *I = CFGAutomaticObjDtor(VD, S); @@ -1110,4 +1109,5 @@ } }; } // end llvm namespace -#endif + +#endif // LLVM_CLANG_ANALYSIS_CFG_H Index: cfe/trunk/include/clang/Basic/Attr.td =================================================================== --- cfe/trunk/include/clang/Basic/Attr.td +++ cfe/trunk/include/clang/Basic/Attr.td @@ -113,7 +113,7 @@ // the case of a SubsetSubject, there's no way to express it without this hack. def DeclBase : AttrSubject; def FunctionLike : SubsetSubjectgetFunctionType(false) != NULL}]>; + [{S->getFunctionType(false) != nullptr}]>; def OpenCLKernelFunction : SubsetSubjecthasAttr() @@ -123,7 +123,7 @@ // never be specified in a Subjects list along with FunctionLike (due to the // inclusive nature of subject testing). def HasFunctionProto : SubsetSubjectgetFunctionType(true) != NULL && + [{(S->getFunctionType(true) != nullptr && isa(S->getFunctionType())) || isa(S) || isa(S)}]>; Index: cfe/trunk/lib/CodeGen/CGDebugInfo.h =================================================================== --- cfe/trunk/lib/CodeGen/CGDebugInfo.h +++ cfe/trunk/lib/CodeGen/CGDebugInfo.h @@ -326,7 +326,7 @@ llvm::Value *storage, CGBuilderTy &Builder, const CGBlockInfo &blockInfo, - llvm::Instruction *InsertPoint = 0); + llvm::Instruction *InsertPoint = nullptr); /// Emit call to \c llvm.dbg.declare for an argument variable /// declaration. @@ -593,4 +593,4 @@ } // namespace CodeGen } // namespace clang -#endif +#endif // LLVM_CLANG_LIB_CODEGEN_CGDEBUGINFO_H Index: cfe/trunk/lib/CodeGen/CodeGenModule.h =================================================================== --- cfe/trunk/lib/CodeGen/CodeGenModule.h +++ cfe/trunk/lib/CodeGen/CodeGenModule.h @@ -715,7 +715,7 @@ /// Return the address of the given function. If Ty is non-null, then this /// function will use the specified type if it has to create it. - llvm::Constant *GetAddrOfFunction(GlobalDecl GD, llvm::Type *Ty = 0, + llvm::Constant *GetAddrOfFunction(GlobalDecl GD, llvm::Type *Ty = nullptr, bool ForVTable = false, bool DontDefer = false, bool IsForDefinition = false); @@ -1184,7 +1184,7 @@ // FIXME: Hardcoding priority here is gross. void AddGlobalCtor(llvm::Function *Ctor, int Priority = 65535, - llvm::Constant *AssociatedData = 0); + llvm::Constant *AssociatedData = nullptr); void AddGlobalDtor(llvm::Function *Dtor, int Priority = 65535); /// Generates a global array of functions and priorities using the given list @@ -1251,4 +1251,4 @@ } // end namespace CodeGen } // end namespace clang -#endif +#endif // LLVM_CLANG_LIB_CODEGEN_CODEGENMODULE_H Index: cfe/trunk/lib/CodeGen/TargetInfo.h =================================================================== --- cfe/trunk/lib/CodeGen/TargetInfo.h +++ cfe/trunk/lib/CodeGen/TargetInfo.h @@ -47,7 +47,7 @@ public: // WARNING: Acquires the ownership of ABIInfo. - TargetCodeGenInfo(ABIInfo *info = 0) : Info(info) {} + TargetCodeGenInfo(ABIInfo *info = nullptr) : Info(info) {} virtual ~TargetCodeGenInfo(); /// getABIInfo() - Returns ABI info helper for the target. @@ -219,6 +219,6 @@ llvm::StringRef Value, llvm::SmallString<32> &Opt) const {} }; -} +} // namespace clang -#endif +#endif // LLVM_CLANG_LIB_CODEGEN_TARGETINFO_H Index: cfe/trunk/lib/Sema/TreeTransform.h =================================================================== --- cfe/trunk/lib/Sema/TreeTransform.h +++ cfe/trunk/lib/Sema/TreeTransform.h @@ -7266,7 +7266,7 @@ TreeTransform::TransformOMPCollapseClause(OMPCollapseClause *C) { ExprResult E = getDerived().TransformExpr(C->getNumForLoops()); if (E.isInvalid()) - return 0; + return nullptr; return getDerived().RebuildOMPCollapseClause( E.get(), C->getLocStart(), C->getLParenLoc(), C->getLocEnd()); } @@ -11298,4 +11298,4 @@ } // end namespace clang -#endif +#endif // LLVM_CLANG_LIB_SEMA_TREETRANSFORM_H Index: cfe/trunk/tools/libclang/CIndex.cpp =================================================================== --- cfe/trunk/tools/libclang/CIndex.cpp +++ cfe/trunk/tools/libclang/CIndex.cpp @@ -1523,10 +1523,7 @@ } bool CursorVisitor::VisitObjCInterfaceTypeLoc(ObjCInterfaceTypeLoc TL) { - if (Visit(MakeCursorObjCClassRef(TL.getIFaceDecl(), TL.getNameLoc(), TU))) - return true; - - return false; + return Visit(MakeCursorObjCClassRef(TL.getIFaceDecl(), TL.getNameLoc(), TU)); } bool CursorVisitor::VisitObjCObjectTypeLoc(ObjCObjectTypeLoc TL) { @@ -1644,10 +1641,7 @@ } bool CursorVisitor::VisitDependentNameTypeLoc(DependentNameTypeLoc TL) { - if (VisitNestedNameSpecifierLoc(TL.getQualifierLoc())) - return true; - - return false; + return VisitNestedNameSpecifierLoc(TL.getQualifierLoc()); } bool CursorVisitor::VisitDependentTemplateSpecializationTypeLoc( Index: cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp =================================================================== --- cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp +++ cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp @@ -348,7 +348,7 @@ << "Length])"; } void writeCtorDefaultInitializers(raw_ostream &OS) const override { - OS << getLowerName() << "Length(0)," << getLowerName() << "(0)"; + OS << getLowerName() << "Length(0)," << getLowerName() << "(nullptr)"; } void writeCtorParameters(raw_ostream &OS) const override { OS << "llvm::StringRef " << getUpperName(); @@ -491,7 +491,7 @@ // The aligned attribute argument expression is optional. OS << " if (is" << getLowerName() << "Expr && " << getLowerName() << "Expr)\n"; - OS << " " << getLowerName() << "Expr->printPretty(OS, 0, Policy);\n"; + OS << " " << getLowerName() << "Expr->printPretty(OS, nullptr, Policy);\n"; OS << " OS << \""; } void writeDump(raw_ostream &OS) const override { @@ -2158,7 +2158,7 @@ bool ShouldClone = R.getValueAsBit("Clone"); if (!ShouldClone) { - OS << " return NULL;\n"; + OS << " return nullptr;\n"; OS << " }\n"; continue; } @@ -2192,7 +2192,7 @@ } OS << " } // end switch\n" << " llvm_unreachable(\"Unknown attribute!\");\n" - << " return 0;\n" + << " return nullptr;\n" << "}\n\n" << "} // end namespace sema\n" << "} // end namespace clang\n"; Index: cfe/trunk/utils/TableGen/ClangCommentCommandInfoEmitter.cpp =================================================================== --- cfe/trunk/utils/TableGen/ClangCommentCommandInfoEmitter.cpp +++ cfe/trunk/utils/TableGen/ClangCommentCommandInfoEmitter.cpp @@ -72,7 +72,7 @@ OS << "const CommandInfo *CommandTraits::getBuiltinCommandInfo(\n" << " StringRef Name) {\n"; StringMatcher("Name", Matches, OS).Emit(); - OS << " return NULL;\n" + OS << " return nullptr;\n" << "}\n\n"; } @@ -123,4 +123,3 @@ } } } // end namespace clang -