summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Checkers/LLVMConventionsChecker.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2011-01-14 22:31:41 +0000
committerTed Kremenek <kremenek@apple.com>2011-01-14 22:31:41 +0000
commit8cb349de8057689e178ab3360f7b99a4f80b9fc3 (patch)
tree3165ad27583d34800c68193b005207fb74043a75 /clang/lib/StaticAnalyzer/Checkers/LLVMConventionsChecker.cpp
parentbea8b40a86b5fb23deb20c5dc357e604eff3efbf (diff)
downloadbcm5719-llvm-8cb349de8057689e178ab3360f7b99a4f80b9fc3.tar.gz
bcm5719-llvm-8cb349de8057689e178ab3360f7b99a4f80b9fc3.zip
Cleanup confused code that redundantly called "getDeclContext()" twice.
Found by clang static analyzer. llvm-svn: 123485
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/LLVMConventionsChecker.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Checkers/LLVMConventionsChecker.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/LLVMConventionsChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/LLVMConventionsChecker.cpp
index eefad95f215..a4a582968fe 100644
--- a/clang/lib/StaticAnalyzer/Checkers/LLVMConventionsChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/LLVMConventionsChecker.cpp
@@ -38,15 +38,13 @@ static bool IsLLVMStringRef(QualType T) {
/// 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) {
OpenPOWER on IntegriCloud