diff options
author | Andrei Elovikov <andrei.elovikov@intel.com> | 2018-08-20 13:45:38 +0000 |
---|---|---|
committer | Andrei Elovikov <andrei.elovikov@intel.com> | 2018-08-20 13:45:38 +0000 |
commit | 7d408ff662298e2808786b33a236360ba30c5961 (patch) | |
tree | a4e24dc56eb5bdb6654e5528f4709690035c08f6 /clang/lib | |
parent | 1a00042270d34e8cb9d04da2de454ba5489a76e1 (diff) | |
download | bcm5719-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')
-rw-r--r-- | clang/lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedObject.h | 2 | ||||
-rw-r--r-- | clang/lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedPointee.cpp | 6 |
2 files changed, 3 insertions, 5 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedObject.h b/clang/lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedObject.h index ee9bcecb4ef..bcecfb76ce5 100644 --- a/clang/lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedObject.h +++ b/clang/lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedObject.h @@ -233,7 +233,7 @@ private: /// value is undefined or not, such as ints and doubles, can be analyzed with /// ease. This also helps ensuring that every special field type is handled /// correctly. -static bool isPrimitiveType(const QualType &T) { +inline bool isPrimitiveType(const QualType &T) { return T->isBuiltinType() || T->isEnumeralType() || T->isMemberPointerType(); } 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) |