summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedPointee.cpp
diff options
context:
space:
mode:
authorAndrei Elovikov <andrei.elovikov@intel.com>2018-08-20 13:45:38 +0000
committerAndrei Elovikov <andrei.elovikov@intel.com>2018-08-20 13:45:38 +0000
commit7d408ff662298e2808786b33a236360ba30c5961 (patch)
treea4e24dc56eb5bdb6654e5528f4709690035c08f6 /clang/lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedPointee.cpp
parent1a00042270d34e8cb9d04da2de454ba5489a76e1 (diff)
downloadbcm5719-llvm-7d408ff662298e2808786b33a236360ba30c5961.tar.gz
bcm5719-llvm-7d408ff662298e2808786b33a236360ba30c5961.zip
[NFC] Don't define static function in header (UninitializedObject.h)
Summary: See also http://lists.llvm.org/pipermail/cfe-users/2016-January/000854.html for the reasons why it's bad. Reviewers: Szelethus, erichkeane Reviewed By: Szelethus Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D50963 llvm-svn: 340174
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedPointee.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedPointee.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedPointee.cpp b/clang/lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedPointee.cpp
index e459d984f72..5817ea775f2 100644
--- a/clang/lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedPointee.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedPointee.cpp
@@ -215,12 +215,10 @@ bool FindUninitializedFields::isPointerOrReferenceUninit(
llvm_unreachable("All cases are handled!");
}
- // Temporary variable to avoid warning from -Wunused-function.
- bool IsPrimitive = isPrimitiveType(DynT->getPointeeType());
- assert((IsPrimitive || DynT->isAnyPointerType() || DynT->isReferenceType()) &&
+ assert((isPrimitiveType(DynT->getPointeeType()) || DynT->isAnyPointerType() ||
+ DynT->isReferenceType()) &&
"At this point FR must either have a primitive dynamic type, or it "
"must be a null, undefined, unknown or concrete pointer!");
- (void)IsPrimitive;
if (isPrimitiveUninit(DerefdV)) {
if (NeedsCastBack)
OpenPOWER on IntegriCloud