[cfe-commits] r123485 - /cfe/trunk/lib/StaticAnalyzer/Checkers/LLVMConventionsChecker.cpp

Argyrios Kyrtzidis kyrtzidis at apple.com
Fri Jan 14 16:29:46 PST 2011


The static analyzer is finding issues in the static analyzer, omg it's becoming self-aware like skynet!!!1!1one

-Argiris

On Jan 14, 2011, at 2:31 PM, Ted Kremenek wrote:

> Author: kremenek
> Date: Fri Jan 14 16:31:41 2011
> New Revision: 123485
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=123485&view=rev
> Log:
> Cleanup confused code that redundantly called "getDeclContext()" twice.
> Found by clang static analyzer.
> 
> Modified:
>    cfe/trunk/lib/StaticAnalyzer/Checkers/LLVMConventionsChecker.cpp
> 
> Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/LLVMConventionsChecker.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/LLVMConventionsChecker.cpp?rev=123485&r1=123484&r2=123485&view=diff
> ==============================================================================
> --- cfe/trunk/lib/StaticAnalyzer/Checkers/LLVMConventionsChecker.cpp (original)
> +++ cfe/trunk/lib/StaticAnalyzer/Checkers/LLVMConventionsChecker.cpp Fri Jan 14 16:31:41 2011
> @@ -38,15 +38,13 @@
> /// Check whether the declaration is semantically inside the top-level
> /// namespace named by ns.
> static bool InNamespace(const Decl *D, llvm::StringRef NS) {
> -  const DeclContext *DC = D->getDeclContext();
>   const NamespaceDecl *ND = dyn_cast<NamespaceDecl>(D->getDeclContext());
>   if (!ND)
>     return false;
>   const IdentifierInfo *II = ND->getIdentifier();
>   if (!II || !II->getName().equals(NS))
>     return false;
> -  DC = ND->getDeclContext();
> -  return isa<TranslationUnitDecl>(DC);
> +  return isa<TranslationUnitDecl>(ND->getDeclContext());
> }
> 
> static bool IsStdString(QualType T) {
> 
> 
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits





More information about the cfe-commits mailing list