This revision was automatically updated to reflect the committed changes.
Closed by commit rL256524: Small refactoring in 
CheckerContext::isCLibraryFunction(). NFC. (authored by dcoughlin).

Changed prior to commit:
  http://reviews.llvm.org/D15794?vs=43688&id=43706#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D15794

Files:
  cfe/trunk/lib/StaticAnalyzer/Core/CheckerContext.cpp

Index: cfe/trunk/lib/StaticAnalyzer/Core/CheckerContext.cpp
===================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/CheckerContext.cpp
+++ cfe/trunk/lib/StaticAnalyzer/Core/CheckerContext.cpp
@@ -57,12 +57,8 @@
     return false;
 
   // Look through 'extern "C"' and anything similar invented in the future.
-  const DeclContext *DC = FD->getDeclContext();
-  while (DC->isTransparentContext())
-    DC = DC->getParent();
-
-  // If this function is in a namespace, it is not a C library function.
-  if (!DC->isTranslationUnit())
+  // If this function is not in TU directly, it is not a C library function.
+  if (!FD->getDeclContext()->getRedeclContext()->isTranslationUnit())
     return false;
 
   // If this function is not externally visible, it is not a C library 
function.


Index: cfe/trunk/lib/StaticAnalyzer/Core/CheckerContext.cpp
===================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/CheckerContext.cpp
+++ cfe/trunk/lib/StaticAnalyzer/Core/CheckerContext.cpp
@@ -57,12 +57,8 @@
     return false;
 
   // Look through 'extern "C"' and anything similar invented in the future.
-  const DeclContext *DC = FD->getDeclContext();
-  while (DC->isTransparentContext())
-    DC = DC->getParent();
-
-  // If this function is in a namespace, it is not a C library function.
-  if (!DC->isTranslationUnit())
+  // If this function is not in TU directly, it is not a C library function.
+  if (!FD->getDeclContext()->getRedeclContext()->isTranslationUnit())
     return false;
 
   // If this function is not externally visible, it is not a C library function.
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to