This revision was automatically updated to reflect the committed changes.
Closed by commit rL340174: [NFC] Don't define static function in header 
(UninitializedObject.h) (authored by a.elovikov, committed by ).
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D50963?vs=161458&id=161473#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D50963

Files:
  
cfe/trunk/lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedObject.h
  
cfe/trunk/lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedPointee.cpp


Index: 
cfe/trunk/lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedPointee.cpp
===================================================================
--- 
cfe/trunk/lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedPointee.cpp
+++ 
cfe/trunk/lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedPointee.cpp
@@ -215,12 +215,10 @@
     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)
Index: 
cfe/trunk/lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedObject.h
===================================================================
--- 
cfe/trunk/lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedObject.h
+++ 
cfe/trunk/lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedObject.h
@@ -233,7 +233,7 @@
 /// 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();
 }
 


Index: cfe/trunk/lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedPointee.cpp
===================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedPointee.cpp
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedPointee.cpp
@@ -215,12 +215,10 @@
     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)
Index: cfe/trunk/lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedObject.h
===================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedObject.h
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedObject.h
@@ -233,7 +233,7 @@
 /// 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();
 }
 
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to