aboutsummaryrefslogtreecommitdiff
path: root/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
commitc39b5e867df74904ac7e50d225b3cca0db43571f (patch)
treea4db17e703a051ce804caf67c82a9dcbf7fc2a43 /lib/StaticAnalyzer/Checkers/LLVMConventionsChecker.cpp
parent689ebfc4fe005591a052f9bc73d462281c12d606 (diff)
Cleanup confused code that redundantly called "getDeclContext()" twice.
Found by clang static analyzer. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123485 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Checkers/LLVMConventionsChecker.cpp')
-rw-r--r--lib/StaticAnalyzer/Checkers/LLVMConventionsChecker.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/StaticAnalyzer/Checkers/LLVMConventionsChecker.cpp b/lib/StaticAnalyzer/Checkers/LLVMConventionsChecker.cpp
index eefad95f21..a4a582968f 100644
--- a/lib/StaticAnalyzer/Checkers/LLVMConventionsChecker.cpp
+++ b/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) {