Index: cfe/trunk/lib/AST/ASTContext.cpp =================================================================== --- cfe/trunk/lib/AST/ASTContext.cpp +++ cfe/trunk/lib/AST/ASTContext.cpp @@ -327,7 +327,7 @@ // FIXME: Adjust alias templates? return D; } -} // unnamed namespace +} // anonymous namespace const RawComment *ASTContext::getRawCommentForAnyRedecl( const Decl *D, @@ -430,7 +430,6 @@ new (*this) comments::FullComment(FC->getBlocks(), ThisDeclInfo); return CFC; - } comments::FullComment *ASTContext::getLocalCommentForDeclUncached(const Decl *D) const { @@ -1921,7 +1920,7 @@ /// getTargetDefaultAlignForAttributeAligned - Return the default alignment /// for __attribute__((aligned)) on this target, to be used if no alignment /// value is specified. -unsigned ASTContext::getTargetDefaultAlignForAttributeAligned(void) const { +unsigned ASTContext::getTargetDefaultAlignForAttributeAligned() const { return getTargetInfo().getDefaultAlignForAttributeAligned(); } @@ -3234,7 +3233,6 @@ return QualType(type, 0); } - /// \brief Retrieve a substitution-result type. QualType ASTContext::getSubstTemplateTypeParmType(const TemplateTypeParmType *Parm, @@ -3934,7 +3932,6 @@ return QualType(tot, 0); } - /// \brief Unlike many "get" functions, we don't unique DecltypeType /// nodes. This would never be helpful, since each such type has its own /// expression, and would not give a significant memory saving, since there @@ -4439,7 +4436,6 @@ llvm_unreachable("Invalid NestedNameSpecifier::Kind!"); } - const ArrayType *ASTContext::getAsArrayType(QualType T) const { // Handle the non-qualified case efficiently. if (!T.hasLocalQualifiers()) { @@ -5853,7 +5849,6 @@ // Just ignore it. case Type::Auto: return; - #define ABSTRACT_TYPE(KIND, BASE) #define TYPE(KIND, BASE) @@ -8851,7 +8846,7 @@ friend class RecursiveASTVisitor; }; -} // end namespace +} // anonymous namespace template static ASTContext::DynTypedNodeList getDynNodeFromMap(const NodeTy &Node, Index: cfe/trunk/lib/Driver/Tools.h =================================================================== --- cfe/trunk/lib/Driver/Tools.h +++ cfe/trunk/lib/Driver/Tools.h @@ -255,7 +255,7 @@ void appendEBLinkFlags(const llvm::opt::ArgList &Args, ArgStringList &CmdArgs, const llvm::Triple &Triple); -} +} // end namespace arm namespace mips { typedef enum { NanLegacy = 1, Nan2008 = 2 } NanEncoding; @@ -278,11 +278,11 @@ bool shouldUseFPXX(const llvm::opt::ArgList &Args, const llvm::Triple &Triple, StringRef CPUName, StringRef ABIName, mips::FloatABI FloatABI); -} +} // end namespace mips namespace ppc { bool hasPPCAbiArg(const llvm::opt::ArgList &Args, const char *Value); -} +} // end namespace ppc /// cloudabi -- Directly call GNU Binutils linker namespace cloudabi { @@ -396,7 +396,7 @@ const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const override; }; -} +} // end namespace darwin /// openbsd -- Directly call GNU Binutils assembler and linker namespace openbsd { @@ -412,6 +412,7 @@ const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const override; }; + class LLVM_LIBRARY_VISIBILITY Linker : public GnuTool { public: Linker(const ToolChain &TC) : GnuTool("openbsd::Linker", "linker", TC) {} @@ -440,6 +441,7 @@ const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const override; }; + class LLVM_LIBRARY_VISIBILITY Linker : public GnuTool { public: Linker(const ToolChain &TC) : GnuTool("bitrig::Linker", "linker", TC) {} @@ -468,6 +470,7 @@ const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const override; }; + class LLVM_LIBRARY_VISIBILITY Linker : public GnuTool { public: Linker(const ToolChain &TC) : GnuTool("freebsd::Linker", "linker", TC) {} @@ -485,7 +488,6 @@ /// netbsd -- Directly call GNU Binutils assembler and linker namespace netbsd { class LLVM_LIBRARY_VISIBILITY Assembler : public GnuTool { - public: Assembler(const ToolChain &TC) : GnuTool("netbsd::Assembler", "assembler", TC) {} @@ -497,8 +499,8 @@ const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const override; }; -class LLVM_LIBRARY_VISIBILITY Linker : public GnuTool { +class LLVM_LIBRARY_VISIBILITY Linker : public GnuTool { public: Linker(const ToolChain &TC) : GnuTool("netbsd::Linker", "linker", TC) {} @@ -525,6 +527,7 @@ const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const override; }; + class LLVM_LIBRARY_VISIBILITY Linker : public GnuTool { public: Linker(const ToolChain &TC) : GnuTool("GNU::Linker", "linker", TC) {} @@ -537,7 +540,7 @@ const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const override; }; -} +} // end namespace gnutools namespace nacltools { class LLVM_LIBRARY_VISIBILITY AssemblerARM : public gnutools::Assembler { @@ -549,6 +552,7 @@ const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const override; }; + class LLVM_LIBRARY_VISIBILITY Linker : public Tool { public: Linker(const ToolChain &TC) : Tool("NaCl::Linker", "linker", TC) {} @@ -561,7 +565,7 @@ const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const override; }; -} +} // end namespace nacltools /// minix -- Directly call GNU Binutils assembler and linker namespace minix { @@ -577,6 +581,7 @@ const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const override; }; + class LLVM_LIBRARY_VISIBILITY Linker : public GnuTool { public: Linker(const ToolChain &TC) : GnuTool("minix::Linker", "linker", TC) {} @@ -605,6 +610,7 @@ const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const override; }; + class LLVM_LIBRARY_VISIBILITY Linker : public Tool { public: Linker(const ToolChain &TC) : Tool("solaris::Linker", "linker", TC) {} @@ -633,6 +639,7 @@ const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const override; }; + class LLVM_LIBRARY_VISIBILITY Linker : public GnuTool { public: Linker(const ToolChain &TC) : GnuTool("dragonfly::Linker", "linker", TC) {} @@ -730,7 +737,8 @@ }; FloatABI getARMFloatABI(const ToolChain &TC, const llvm::opt::ArgList &Args); -} +} // end namespace arm + namespace XCore { // For XCore, we do not need to instantiate tools for PreProcess, PreCompile and // Compile. @@ -785,7 +793,7 @@ const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const override; }; -} +} // end namespace CrossWindows /// SHAVE tools -- Directly call moviCompile and moviAsm namespace SHAVE { @@ -837,27 +845,27 @@ Assemble(const ToolChain &TC) : Tool("PS4cpu::Assemble", "assembler", TC, RF_Full) {} - virtual bool hasIntegratedCPP() const { return false; } + bool hasIntegratedCPP() const override { return false; } - virtual void ConstructJob(Compilation &C, const JobAction &JA, - const InputInfo &Output, - const InputInfoList &Inputs, - const llvm::opt::ArgList &TCArgs, - const char *LinkingOutput) const; + void ConstructJob(Compilation &C, const JobAction &JA, + const InputInfo &Output, + const InputInfoList &Inputs, + const llvm::opt::ArgList &TCArgs, + const char *LinkingOutput) const override; }; class LLVM_LIBRARY_VISIBILITY Link : public Tool { public: Link(const ToolChain &TC) : Tool("PS4cpu::Link", "linker", TC, RF_Full) {} - virtual bool hasIntegratedCPP() const { return false; } - virtual bool isLinkJob() const { return true; } + bool hasIntegratedCPP() const override { return false; } + bool isLinkJob() const override { return true; } - virtual void ConstructJob(Compilation &C, const JobAction &JA, - const InputInfo &Output, - const InputInfoList &Inputs, - const llvm::opt::ArgList &TCArgs, - const char *LinkingOutput) const; + void ConstructJob(Compilation &C, const JobAction &JA, + const InputInfo &Output, + const InputInfoList &Inputs, + const llvm::opt::ArgList &TCArgs, + const char *LinkingOutput) const override; }; } // end namespace PS4cpu @@ -865,4 +873,4 @@ } // end namespace driver } // end namespace clang -#endif +#endif // LLVM_CLANG_LIB_DRIVER_TOOLS_H Index: cfe/trunk/lib/Driver/Tools.cpp =================================================================== --- cfe/trunk/lib/Driver/Tools.cpp +++ cfe/trunk/lib/Driver/Tools.cpp @@ -1,4 +1,4 @@ -//===--- Tools.cpp - Tools Implementations --------------------------------===// +//===--- Tools.cpp - Tools Implementations ----------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -10107,7 +10107,7 @@ if (!Args.hasArg(options::OPT_nostdlib) && !Args.hasArg(options::OPT_nostartfiles)) { - const char *crt1 = NULL; + const char *crt1 = nullptr; if (!Args.hasArg(options::OPT_shared)) { if (Args.hasArg(options::OPT_pg)) crt1 = "gcrt1.o"; @@ -10121,7 +10121,7 @@ CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("crti.o"))); - const char *crtbegin = NULL; + const char *crtbegin = nullptr; if (Args.hasArg(options::OPT_static)) crtbegin = "crtbeginT.o"; else if (Args.hasArg(options::OPT_shared) || Args.hasArg(options::OPT_pie)) Index: cfe/trunk/lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp =================================================================== --- cfe/trunk/lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp +++ cfe/trunk/lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp @@ -32,9 +32,9 @@ LockState(Kind K) : K(K) {} public: - static LockState getLocked(void) { return LockState(Locked); } - static LockState getUnlocked(void) { return LockState(Unlocked); } - static LockState getDestroyed(void) { return LockState(Destroyed); } + static LockState getLocked() { return LockState(Locked); } + static LockState getUnlocked() { return LockState(Unlocked); } + static LockState getDestroyed() { return LockState(Destroyed); } bool operator==(const LockState &X) const { return K == X.K; Index: cfe/trunk/lib/StaticAnalyzer/Core/LoopWidening.cpp =================================================================== --- cfe/trunk/lib/StaticAnalyzer/Core/LoopWidening.cpp +++ cfe/trunk/lib/StaticAnalyzer/Core/LoopWidening.cpp @@ -23,7 +23,7 @@ static const Expr *getLoopCondition(const Stmt *LoopStmt) { switch (LoopStmt->getStmtClass()) { default: - return NULL; + return nullptr; case Stmt::ForStmtClass: return cast(LoopStmt)->getCond(); case Stmt::WhileStmtClass: